Posts Tagged ‘power’

$79 Digilent OpenScope Open Source Multi-function Programmable Instrument Works over USB and WiFi (Crowdfunding)

February 1st, 2017 7 comments

Digilent OpenScope is an open source, portable, multi-function programmable instrument used for capturing, visualizing, and controlling analog and digital signals, that works with your smartphone or computer over USB or WiFi, and it can also be used in standalone mode as a development board, like you would use an Arduino or Raspberry Pi board.

OpenScope MZ key features and specifications:

  • MCU – Microchip PIC32 MZ (MZ2048EFG124) MIPS Warrior M-class micro-controller @ up to 200 MHz with 2048KB flash, 512 KB RAM
  • External Storage – micro SD slot
  • Wireless Connectivity – WiFi module
  • USB – 1x micro USB for power and programming over FTDI
  • Programming / Debugging – micro USB port, programming header
  • Expansion – 30-pin Fly Wire connector with:
    • 2x scope channels with 12 bits @ 2 MHz bandwidth and up to 6.25MS/s sampling rate
    • 1x function generator output with 1 MHz bandwidth and up to 10MS/s update rate
    • 10x user programmable DIO pins up to 25 MHz update rate
  • Misc – 4x user LEDs, programming and reset buttons
  • Power Supply – via micro USB or ext pin; programmable power supplies up to 50 mA and +/- 4V

The platform can be used with (soon-to-be) open source, web based Waveforms Live multi-instrument software written in JavaScript and allowing you to  use OpenScope as an oscilloscope, a function generator, a logic analyzer, a power supply, or a data logger.

Since the software runs in a web browser it will work with most operating systems including Linux, Windows, Mac OS X, Android or iOS. As mentioned in the introduction, OpenScope is also a development board, and can be programmed using the Arduino IDE or Microchip MPLAB-X IDE. The company will provide  a programmer’s guide, and make PIC32MZ firmware, the agent source code, the browser app for Android & IOS, the communication protocol, and the JavaScript API available on Github

Digilent launched OpenScope on Kickstarter, where the board can be backed together with a 3D printed enclosure for $79. An “OpenScope Learning Edition” is also offered for $150 with a “parts kit with workbook example”, but no details have been provided for the latter. Delivery is planned for June or August 2017 depending on selected reward, and shipping is free to the US, but adds $20 to the rest of the world.

Satechi USB Type-C Power Meter Measures up to 65 Watts

January 29th, 2017 13 comments

CHARGER Doctor is a popular USB power meter for USB 2.0 ports that can help you check whether your charger delivers the promised amperage, and if you are dealing with USB powered device you can easily measure the power drawn by that device. But we are now in 2017, and USB type C has become more and more popular, and can deliver higher voltages higher than 5V, as well as higher currents. So if you are looking for USB type C power meter, Satechi has you covered.

Satechi USB-C power meter key features and specifications:

  • Voltage Range – 4V-20V
  • Current Range – 50mA-10W
  • Max readable Power – 65W
  • Indicates power over time (mAh) and current direction (e.g. charger to laptop, or laptop to phone).
  • USB 3.1 data pass-through supported
  • Dimensions – 6.3 x 2 x 0.8 mm
  • Weight – 8.6 g

Beside just measuring power usage, several blogs report this USB-C power meter might be able to help you detect bad cables or power adapters, as people have reported frying equipment in the past, and a USB Type-C Authentication Specification has even been announced last year to work around the issue. I’m not sure how you are supposed to do to test cables/adapters safely, as user reviews indicate the display will only turn on if you are actually charging a device.

The meter is currently for sale for $30 on Amazon US, and you may find more details on the product page.

Via Liliputing & Gizmodo

Categories: Hardware, Video Tags: power, satechi, usb

How to Build and Flash ESPurna Open Source Firmware to Sonoff POW Wireless Switch

December 3rd, 2016 33 comments

ITEAD Studio Sonoff family is comprised of various inexpensive ESP8266 WiFi power switch, and the company sent me two of their latest CE certified models with Sonoff TH16 + external temperature & humidity probe, and Sonoff POW to measure power consumption. I checked the hardware is the first part of the review, and used Sonoff TH16 to control a water pump with the stock firmware and Ewelink Android app in the second part. It works reasonably well, but it relies on the cloud, so if you lose your Internet connection or the service closed, you can’t control the relay manually anymore. Luckily, the UART pins are exposed on Sonoff switches so you can solder a 4-pin header and connect a USB to TTL to flash your own firmware.

Click to Enlarge

Click to Enlarge

Please don’t connect Sonoff devices to the mains when programming them, it’s very dangerous, instead the USB to TTL board will power the system, and will allow you to program the board safely. Later you’ll be able to update the firmware, if needed, over the network.

The next step is to select the firmware you want to use, and I’ve been advised two firmware for ESP8266, namely ESPurna specifically designed for Sonoff devices, and ESPEasy with a larger community of users. The latter may be usable to control the relay, but it has yet to support HLW8012 chip used to measure power consumption in Sonoff POW, so I decided to go with ESPurna.

That’s the description of the firmware from its bitbucket page:

ESPurna (“spark” in Catalan) is a custom C firmware for ESP8266 based smart switches. It was originally developed with the ITead Sonoff in mind. Features:

  • Asynchronous WebServer for configuration and simple relay toggle with basic authentication
  • Communication between webserver and webclient via websockets with secure ticket check
  • Flashing firmware Over-The-Air (OTA)
  • Up to 3 configurable WIFI networks, connects to the strongest signal
  • MQTT support with configurable host and topic
  • Manual switch ON/OFF with button (single click the button)
  • AP mode backup (double click the button)
  • Manual reeset the board (long click the button)
  • Visual status of the connection via the LED
  • Alexa integration (Amazon Echo or Dot) by emulating a Belkin WeMo switch
  • Support for automatic over-the-air updates through the NoFUSS Library
  • Support for DHT22 sensors
  • Support for the HLW8012 power sensor present in the Sonoff POW
  • Support for current monitoring through the EmonLiteESP Library using a non-intrusive current sensor (requires some hacking)
  • Command line configuration

I could not find firmware release for ESPurna, but Xose Pérez – the developer – has provided some basic instructions to build and flash the firmware to Sonoff. Those are not really detailed however, and it took me nearly a full day to successfully build and flash the firmware to Sonoff POW, mostly because I was not quite familiar with most of the tools used. So I’ve reproduced the step I went through in Ubuntu 16.04, and hopefully this can help people getting things done more quickly.

Let’s retrieve the source code, and enter the code directory first:

You can build the project with PlatformIO or the Arduino IDE. The instructions are for PlatformIO so that’s what I used. There are two ways to build the code with the project wither using Platform IDE for Atom and the command line, or simply using the command line. With insights, I ended up using the command line, but I’ll show both methods.

Setup PlatformIO IDE for Atom to build ESPurna

First, you’ll need to download PlatformIO IDE for Atom for your operating systems, and install it. For Ubuntu 16.04, I selected “Download .deb” for Linux and installed it through through Ubuntu Software program. Alternatively, after download, you can install it from the command line:

You can now start Atom program in Ubuntu dash, select Open Project, and browse for espurna/code directory to load the project we’ve just gotten from Bitbucket.

Click to Enlarge

Click to Enlarge

The tick button on the top left corner is to build the project, and the right button just under is to upload the firmware to the target board. But if we try to build the firmware now it will fail with an error about “espressif8266_stage”. That’s because we need to install Espressif 8266 (Stage) development platform. First we need to enable Developer mode in the IDE by going to the top menu to select PlatformIO->Settings->PlatformIO IDE, and checking “Use development version of PlatformIO“.


Click to Enlarge

Now install PlatformIO shell commands from either a system Terminal, or PlatformIO IDE terminal (PlatformIO->Terminal->New Terminal):

and finally install ESP8266 development platform:

At this point you can click on the tick icon to build the default “node-debug” environment, a build output window will show in the IDE, and quickly disappear if the build is successful.

Setup PlatformIO via Command Line to Build ESPurna

If instead we want to use the command line we can install the latest pip version, the developer version of PlatformIO, and the staging version of ESP8266 development platform:

You can check the build environment is set properly by running the following command in espurna/code directory:

It will automatically download, build and install all dependencies and build for “node-debug” firmware for NodeMCU board. If it is successful, it will end as follows:

So I find the command line option much more easy and straightforward.

Build ESPurna for Sonoff POW

However, we are not using NodeMCU board here, but Sonoff POW, and there are two environments defined just for that:

  • sonoff-pow-debug – Build firmware to flash over serial
  • sonoff-pow-debug-ota – Build OTA firmware to upgrade the firmware over the network

The parameters for each environment are all defined in platformio.ini. First we need to build sonoff-pow-debug environment:

But it failed with an error message related to hlw8012 library:

I reported the issue on Bitbucket, but the main developer could not reproduce the issue. Eventually I found out that it could be a PlatformIO bug, as the system does not recursively checking for includes outside of main.ino. So I added <hlw8012.h> in the main.ino as follows:

and the build could complete:

Since we’ve already changed the code, you may also consider changing “#define ADMIN_PASS  fibonacci” in code/src/config/general.h to use a different default password. The password can also be changed in the web interface, but this makes sure you won’t have a device somewhere with the default password common to most users.

Flashing Firmware to Sonoff POW

Now that we’ve made sure the firmware could build, it’s time to flash it to the device.

First we need to setup some udev rules to allow flashing over serial:

Now connect the USB to TTL to a USB port on your computer, press the button (connected to GPIO0) on Sonoff POW for several seconds until both LEDs are off to make sure you are in bootloader mode, and start flashing with:

Success! Great. If you have your own firmware to flash it may be useful to know the actual command used to flash the firmware was:

Building and Flashing the ESPurna filesystem

Wait! We’ve just flashed the firmware, isn’t it all? Nope, as the webserver files are stored in another partitions, and compressed in a single index.html.gz file for better performance. The exact reasons why are further explained here.

We’ll need Node.js and gulp command line client:

Now inside espurna/code folder , we can check if building the file systems works with two commands:

Here my successful gulp attempt:

Finally, we can run the following (which also runs the two commands above) to flash the file system to the board, after entering bootloader mode by pressing the button:

Now that’s done.

A Quick look at ESPurna Web Interface

ESPurna firmware and filesystem has now been flashed to Sonoff POW. But does it work?

Click to Enlarge

Click to Enlarge

I can see a new SONOFF_POW_XXXXX access point, so that does look good. I can connect using the default password “fibonacci”, then go to my web browser to access, and login again with admin/fibonacci credentials.

Click to Enlarge

Click to Enlarge

ESPURNA 1.03 interface goes to the status menu first, and there I can turn on and off the relay remotely, and check the power consumption in watts, which remains at 0 watt since I have not connected it to the mains yet. It’s also possible to turn the relay on and off with the button, and there an option to select whether to turn on or off the relay at boot time, which is great since I need it on at all times.

The web interface also allows you to change general parameters including the hostname and password, as well as enable or disable the HTTP API (disabled by default). The WiFi section is used to connect to up to 3 wireless routers, the MQTT section lets you configure an MQTT (Mosquito) broker, and the power section is used to calibrate the power monitoring device.

If you just intend to check the current power consumption and turn on and off the switch with your phone, you don’t have to do anything else. But I’d like to find some ways to draw daily, weekly, monthly charts of my office power consumption using either MQTT or the HTTP API. I’ll have to study how to do that, and that will hopefully be the topic of my next post about Sonoff POW.

Sonoff POW can be purchased on ITEAD Studio for $10.50 plus shipping, but is currently out of stock with the company manufacturing a third batch soon.

This Video Shows Vulkan API’s Higher Power Efficiency Compared to OpenGL ES API on ARM SoCs

October 20th, 2016 1 comment

Vulkan was introduced as the successor of OpenGL ES in March 2015, promising to take less CPU resources, and support multiple command buffers that can be created in parallel and distributed over several cores, at the cost of slightly more complex application programming since less software work in done inside the GPU drivers themselves with app developers needing to handle memory allocation and thread management.

opengl-es-vs-vulkanThis was just a standard at the time, so it still needed some time to implement Vulkan, and work is still in program but ARM showcased the power efficiency of Vulkan over OpenGL ES in the video embedded at the end of this post.

The demo has the same graphics details and performance using both OpenGL ES and Vulkan, but since the load on the CPU in that demo can be distributed over several CPU cores with Vulkan against a single core for OpenGL ES, it’s possible to use low power cores (e.g. Cortex A53) operating at a lower frequency and voltage, hence reducing power consumption.

ARM also measured that the complete OpenGL ES demo would use 1270 joules against 1123 Joules for the Vulkan demo, resulting in about 15% energy savings in this “early stage” demo.

Categories: Android, Video Tags: gpu, opengl, power, vulkan

Sonoff Pow is a $10.50 ESP8266 WiFi Relay Box that also Measures Power Consumption

October 10th, 2016 24 comments

In a recent article about Sonoff TH10/TH16 WiFi relays with sensor probes support, we also saw that ITEAD Studio started to have a nice family of home automation products. The company has now added one more item to the Sonoff family with Sonoff Pow support up to 16A/3500W input, and the first to also include power consumption measurements.

sonoff_powSonoff Pow specifications:

  • SoC – Espressif ESP8266 Tensila L106 32-bit MCU up to 80/160 MHz with WiFi
  • Connectivity – 802.11 b/g/n WiFi with WPA/WPA2 support
  • Relay – HF152F-T relay with 90 to 250 VAC input, up to 16A (3500 Watts)
  • Terminals – 6 terminal for mains and load’s ground, live and neutral signals.
  • Programming – Unpopulated 4-pin header for flashing external firmware
  • Misc – LEDs for power and WiFi status, power consumption circuitry with 1% accuracy.
  • Dimensions – 114 x 52 x 32mm
  • Temperature range – -40 ℃ to 125 ℃

sonff-esp8266-power-consumptionThe wireless relay can be controlled using Ewelink app for Android or iOS. But beside manually turning on and off the device, or settings timer like with all other Sonoff devices, you can also check real-time, daily or monthly power usage.


There’s some limited info on the Wiki,  and I could not find any API incase you want to measure the power consumption from your own app or program. But at least they’ve release the schematics showing HLW8012 chip (Datasheet in Chinese)  is used to measure power consumption, and is connected to ESP8266 via SCL and PWM1 pins. The 4-pin header would also allow you to flash you own firmware relatively easily on the board.

The company also mentions “this is a customizable product. Based on the original prototype, we can make the customized prototype that meets your requirements”, so if you order in quantities you should be able to get a slightly modified hardware and customized firmware.

ITEAD Studio home automation products used not to have any kind of CE/FCC/UL/TUV/ETL certifications, but the company recently got CE certification for their Sonoff switch, which explains the CE logo on the unit.

Sonoff Pow is available now for $10.50 plus shipping.

Thanks to Harley for the tip.

Broadlink MP1 is a $20 WiFi Power Strip with 4 Independent Sockets

August 29th, 2016 20 comments

There are plenty of WiFi sockets going around such as Broadlink SP2 or Kankun KK-SP3, but in some cases it might be both more convenient and cheaper to get a WiFi power strip, and Broadlink MP1 offers just that with 4 sockets that can be controlled and programmed (timer) independently, and sold for just $19.88 on Banggood.

Broadlink_MP1Broadlink MP1 specifications:

  • Connectivity – 802.11b/g/n WiFi, controllable over 3G/4G with smartphone
  • 4 multi-standard (EU/US/AU, but not UK) sockets
  • Power input – 10A/250V (max)
  • Power output – 10A/250V (max)
  • Rated power – 2000W Total
  • Misc – Power button
  • Dimensions –  254mm x 60mm x 32mm; 50cm sockets spacing; cord Length – 1.5m with AU plug (Adapter provided for other countries)
  • Weight – 450g

The power strip can be controlled via Broadlink ihc (Intelligent Hone Control) app available for Android and iOS, which lets you independently manually turn on or off or set timers for each sockets. You can also use IFTTT to control the sockets, but it may require Broadlink SC1 “housekeeper”.  There does not seem to be an easy way to control the power strip with a computer.


The strip is also sold for around $25 and up on Aliexpress, GeekBuying and GearBest [Update: Now $19.78 promo]. It’s been around for a few months already, but I have not found any hacks yet, and could not find the processor used in the strip. However I know it’s likely not running OpenWrt and there’s no SSH access. Reading further, I did find another model, Broadlink MP2, with 3 power sockets, and 3 USB ports that’s said to be based on a Mediatek solution, and sold for $27.59.

More information can be found on Broadlink MP1 and MP2 pages (in Chinese only).

The USB Type-C Authentication Specification Aims to Prevent Damage from Non-Compliant Cables and Adapters

April 13th, 2016 2 comments

The new USB Type-C standard is great, as cables are reversible so it does not matter if you connect them up or down, it can handle USB 3.1 data speed, as well as carrying video and up to 100W power thanks to USB-C power delivery. In theory all is great, but in practice, many USB-C cables are not compliant, and Benson Leung, a Google employee, has found that many USB-C cable sold on Amazon were not compliant, with even one damaging his Pixel 2 laptop and two USB PD analyzers.

His reviews on Amazon, as well as customer complaints, probably lead the company to ban the sale of non-compliant cable or adapter, but to really mitigate the issue, a technical solution was needed, and that’s why the USB 3.0 Promoter Group has defined the Authentication Protocol for USB Type-C as part of the USB Power Delivery 3.0 specifications.



Key characteristics of the USB Type-C Authentication solution include:

  • A standard protocol for authenticating certified USB Type-C chargers, devices, cables and power sources
  • Support for authenticating over either USB data bus or USB Power Delivery communications channels
  • Products that use the authentication protocol retain control over the security policies to be implemented and enforced
  • Relies on 128-bit security for all cryptographic methods
  • Specification references existing internationally-accepted cryptographic methods for certificate format, digital signing, hash and random number generation

Authentication will check the capabilities and certification status, before transferring user data and power. This will also prevent malicious embedded software or hardware to exploit a connection.

At least that’s the plan. I understand existing devices with USB-C port will be able to get a firmware update to support USB-C authentication, but obviously many devices will never be updated, so in the meantime you’ll have to be cautious, and one way to protect your devices from bad USB-C cables or adapters is to purchase one from Benson Leung Amazon list, which he has personally tested.

Via Liliputing and Arstechnica.

Categories: Hardware Tags: power, standard, usb

Henes Broon T870 is a Kids’ Electric Car Controlled by an Android Tablet

February 11th, 2016 No comments

If you ever wanted to played around with an electric car that’s a bit better than an RC toy, but don’t quite have the cash for a full-size Tesla model, Henes has designed an electric card for you your younger kids that’s controlled by an Android tablet and allows both manual and remote driving.
Henes_Broon_T870Henes Broon T870 specifications:

  • Tablet – 7″ Android 4.4.2 tablet PC smart system with HD resolution display, micro SD, HDMI and audio output
  • ARM Cortex-M3 based main control system
  • Bluetooth remote control
  • Built-in stereo speakers
  • Functioning hood & doors
  • 4 wheel drive with high density urethane tires
  • Spring suspension & shock absorbers
  • Leather bucket seat and seat belt
  • Foot pedal accelerator
  • Bright Headlight / Aux Light / Turn Signal Light / Tail/Brake/BackUp Lights
  • Motors – Dual 24V driving motors
  • Battery – Rechargeable 24V 7Ah battery pack for a little over 2 hours drive, or up to 20 km.
  • Dimensions – 134 x 73 x  63.5 cm
  • Weight- N/A

The car can reach up to 8 km/h, with a maximum sit capacity of 35 kilograms. The company recommends parents to use the remote control for kids between 1.5 and 3 years old, and let them drive themselves up to 5 year old or more (subject to height & weight).


The tablet shows a dashboard like on “adult’s cars” with a tachometer, and a better level indicator. You can also adjust the lights, brake modes, adjust the speed level, play music, set remote control mode, and more. The promo video does not show much about the tablet, but shows a little how the car can be used.

Henes Broon T870 sells for $1,275 on Amazon US, and more information can also be found on Hemes Emporium website.