Archive

Posts Tagged ‘power’

Selecting a Micro USB Cable to Power Development Boards or Charge Phones

April 27th, 2017 12 comments

Yesterday one person contacted me on Facebook asking me whether there was any chance of me doing a “which usd-micro usb cable is best”, as there’s not much clear information on the Internet. His purpose was to charge his phone, but many development boards come with a micro USB port, and I’ve read many comments about powering the board. It also happened to me, and the main cause can either be the power supply which does not work as rated (usually 5V/2A), or the micro USB cable which may have a resistance a little to high leading to voltage drops. You’ll know you may have a power problem when the board refuses to boot, and usually boot loop, or randomly reboots especially under high load. The first solution is to get a power supply that provide the right voltage and amperage, and you can test that with USB Charger doctor an ultra cheap tool that will show both the voltage and intensity on an LCD display, although it will only work on chargers with a USB port.

But what about the micro USB cable? Let’s consider the actual problem, which is well explained in a post about USB cable resistance, but I’ll summarize below. First all conductor have some tiny resistance, and usually the thicker the cable the less resistance there is. The American Wire Gauge (AWG) value is often used to describe the thickness of the cable, with numbers from 0 to 40 ranging from the larger diameter/smaller resistance/higher capacity to the smaller diameter/larger resistance/lower capacity. For USB cable, AWG20 to AWG28 are often used for USB cables, and the latter seems to be very common for  data wires, but what matters here is the AWG value for the power wires (5V/GND) of the cable. The resistance also depends on the length of the cable with longer cables having a longer resistance, as well as the USB contact resistance, but I’m not sure we can do much about that one. Anyway, that means a short cable with a lower AWG value would be better suited here, as shown in the table below from the aforelinked post using 5V/1A and 5V/1A loads. This table assumes 30 mOhms contact resistance, so the values would be lower if there’s a lower resistance.

Boards can normally work in a range around 5V. For the sake of argument, let’s assume a board taking 4.5V to 5.5V DC input. and would reboot if the voltage drops below 4.5V. If you have a 5V power supply use with a non-optimal AWG rating and length, the voltage will drop more than 0.5V (red zone above) and the board will not work properly. 5V/1A (5W) is a very common on development boards, while getting to 10Watts is possible for you’d need a high load plus possible some USB storage device to reach the power level.

Based on those results, what we want is an AWG20 cable (ideally) with a length of less than one meter, and the shorter the better. So I’ve been looking for such cables on the web and found a bunch. I did not test any, but they may be good candidates to look at:

There are many others, just search for AWG20 micro USB cable, or in some cases micro USB charging cables, and you should find decent cables that should not cause power or charging troubles. The last cable in the list above (eBay) was tested with a Charger Doctor dongle showing 4.95V/3.47A going through the cable (1.8 meter length). The voltage value should be lower when measured at the DIY charging board due the internal resistance of the cable, but it still shows the cable allows around 3 to 4 amps.

Toaster Breadboard Power Supply Supports 3.3V, 5V, and Variable 5V to 16 V Outputs

March 23rd, 2017 3 comments

YwRobot MB102 is a popular power supply for breadboards delivering 5V or 3.3V to both power rails. Bradsprojects’ Toaster power supply offers similar functionalities but beside outputting just 5V or 3.3V, it also adds a 5V to 16V variable output, and takes 5V from its micro or mini USB port.Toaster board specifications:

  • Input Voltage – 5V via USB Mini and USB Micro port
  • Input Current (max) – 1Amp
  • Output Voltage 1 – 3.3 Volts
  • Output Voltage 2 – 5 Volts
  • Output Voltage 3 – Variable 5 Volts to 16 Volts with potentiometer
  • Protection – 1.1Amp Resettable Fuse
  • Output Connection – Standard Dual Rail Breadboard 2.54mm spacing.
  • Dimensions – 50mm x 25mm

You just need a screwdriver and a multimeter to adjust the variable output to your requirement.The Toaster board can be purchased on Tindie for $10 + shipping.

Categories: Hardware Tags: electronics, power

Atomo is a Raspberry Pi Compatible Modular Electronics Prototyping System (Crowdfunding)

March 22nd, 2017 7 comments

Atomo is a modular electronics protyping system comprised of four elements: Control, I/O, Power, and Connector, with the PCBs for each category color-coded with respectively red, blue, green, and black. The connector board connects power, I/O and control(ler) boards together in a way that’s supposed to be neater than most hand made prototypes.

The whole ecosystem includes 15 different boards:

    • Controllers with 26-pin Raspberry Pi compatible header
      • 2 IO Module Controller (CM-M2K22-A) based on NXP Kinetis K22F MCU
      • 4 IO Module Controller (CM-M4K64-A) based on NXP Kinetis K64F MCU
      • 8 IO Module Controller (CM-M8K64-A) based on NXP Kinetis K64F MCU

        2 IO and 8 IO Controller Boards – Click to Enlarge

    • Connectors
      • 8 IO Module Connector (GM_M8P2_A) – Dim: 145mm x 100mm; power up to 40V @ 64A
      • 4 IO Module Connector (GM_M4P1_A) – Dim: 71mm x 100mm; power up to 40V @ 32A
      • 2 IO Module Connector (GM_M2P1_A) – Dim: 71mm x 65mm; power up to 40V @ 16A
      • 2 IO Module Low-Power Connector (GM_M2P0_A) – Dim: 71mm x 65mm; Good for low power 5V/3.3V designs

        8 IO Modules Connector Board

    • IO Boards
      • Single Stepper Driver with Sensing IO Module (IO-001ST1-A)
      • Triple Stepper Driver with Limits IO Module (IO-002ST3-A)
      • Single Stepper and Heater Driver with Limits and Dual Temp (Thermistor + Thermocouple) IO Module (IO-003ST1TC1-A)
      • Single Stepper and Heater Driver with Limits and Dual Temp (2x Thermistor) IO Module (IO-003ST1TH1-A) with ADC, I2C, SPI, PWM

        Atomo IO-003ST1TH1-A – Click to Enlarge

    • Power Boards
      • 1X ATX Power Module (PM-ATX1X-A) for 1 ATX power supply with support for 3.3V, 5V, 12V plus a higher voltage up to 40V @ 32A
      • 2X ATX Power Module (PM-ATX2X-A) for 2 ATX power supply with support for 3.3V, 5V, 12V plus a higher voltage up to 40V @ 64A
      • 10A 5.5mm Barrel Plug Power Module (PM-VIN10A-A) – Input from 15V, 2A up to 24V 10A. Output: 12V, 5V, and 3.3V
      • 13W POE Power Module (PM-POE13W-A) – Output 12V, 5V, and 3.3V; network data passthrough; auxiliary 5.5mm barrel plug 12V output.

        2x ATX Board

They also have one expansion module with USB input & UART headers, a USB port, an Ethernet port, and a 26-pin header, which you can use if you don’t connect the controller board to a Raspberry Pi.

So now, you have to decide about your project’s power and IO requirements, select the boards, and put it all up together.  That’s what it looks like when the Raspberry Pi comes into play together with four IO modules and one ATX power board.

Now you’ll need to program the NXP Kinetis based controller board using  KDS and MCUXpresso, with low-level drivers using DMA provided by the developer, as well as board profiles with standard pin and clock configurations. ARM mbed compatibility, and RTOS integration are also planned for the future.

The video below introduces Atomo ecosystem, and shows a project with four LED strips.

Atomo has recently launched on Indiegogo, and the developer aims to raise at least $5,000 to fund mass production. Rewards start at $19 for the 2 IO controller board, and up to $48 for the 8 IO controller with the expansion board. The IO, power, and connector boards are not offered through Indiegogo – no wonder the campaign has not raised that much so far -,  but a 10% coupon is included with all perks to purchase them on Atomo Systems online shop.

While Atomo Systems is a one person company, but the project has “Arrow Certification” meaning this campaign has a working prototype that has been certified by Arrow Electronics, so hopefully project failure due to technical or manufacturing troubles is less likely. Shipping is free worldwide, and delivery is scheduled for June 2017.

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

February 1st, 2017 8 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 36 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“.

platformio_core_enable_development_version

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 http://192.168.4.1, 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.

sonoff-pow-android-app

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.