Power supply and cable issues

30 34717
While it's a well know fact that using Micro USB to charge a device is not the best idea I stumbled across an interesting relation today: Cable length/quality:

I ran a 15 min. stress test two times using exactly the same QUATPOWER PSN5/2000M PSU with two different cables: The first one is 100 cm long. I shut the Banana Pi down on 10:41 and replaced it with a 20 cm long cable and started the test again (utilizing all subsystems including my directly connected SATA SSD):
  1. cd /data && stress -t 900 -c 2 -m 2 -i 2 -d 2
Copy the Code
The results regarding the voltage drops the Banana's PMU reports are interesting:

Fun fact: The formula to get degrees Celsius from the A20's internal thermal sensor values seems to be completely wrong since the uncalibrated values that can be read from the SoC seem to be dependent on the voltage/current (but in a way I don't understand at the moment):

The reported SoC temperatures 'measured' in the second run with the short cable are way too low. So the steps outlined here may provide some graphs regarding the internal SoC's thermal sensor. But currently I have no idea how the formula has to be adjusted to report reliable temperature values from the SoC.



View Rating Log

Edited by tkaiser at Mon Oct 27, 2014 07:57

Since I didn't had any USB power consumers in the above setup I tried it with an older Apple USB keyboard and an optical mouse. I shut the Banana Pi down on 11:26 and tried to start it with the long power cable and both keyboard/mouse attached. The Banana Pi refused to boot and immediately shut down after a few seconds (I then remembered that sudden shutdowns happened also in the past when I plugged in the keyboard and mouse simultaneously while Banana Pi was running).

So I tried again with the shorter reliable 20cm cable and the Banana Pi was up and running at 11:29 again:

Prior to attaching both USB devices idle consumption (11:00-11:25) was in the range of 300mA. With USB devices attached 150mA above with peaks even exceeding the max. consumption while doing the stress test without USB peripherals (11:43-11:58). Between 11:41 and 11:56 I repeated the stress test while USB stuff plugged in. In this scenario the voltage dropped below 4.9V.

So given my prior scenario with an ultra long Micro USB power cable where the voltage dropped below 4.6V under load even without attached USB peripherals it might be a good idea to have a look at both current and voltages (and the PMU's temperature) in situations where the Banana Pi has to power busy external devices like USB disks. Same applies to situations where 2.5" SATA devices are powered by the approriate connector from the Banana Pi (this sort of power consumption isn't handled by the PMU itself but it might further decrease available voltage from the PSU and low voltage levels might even prevent an external disk from spinning up at all!)

You don't need a full blown monitoring solution to read out the values. When you powered your Pi the right way (using the power Micro USB connector between SATA and SATA-pwr port) you can read out current (mA) and voltage (V) with these code snippets:
  1. awk '{printf ("%0.1f",$1/1000); }' </sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/ac/current_now
  2. awk '{printf ("%0.2f",$1/1000000); }' </sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/ac/voltage_now
Copy the Code
If you abuse the USB OTG port then it would read instead
  1. awk '{printf ("%0.1f",$1/1000); }' </sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/usb/current_now
  2. awk '{printf ("%0.2f",$1/1000000); }' </sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/axp20-supplyer.28/power_supply/usb/voltage_now
Copy the Code
BTW: Temperatures seem to be 'back to normal' (or let's better say 'apprehensible') with the short cable -- but I have no idea why:

I'm on way to build some probes to monitor temperature and humidity around my house, and I thought to use the +5V from CON3 or J12.
But reading your thread, it seems I have to find another way ...

Edited by tkaiser at Tue Oct 28, 2014 03:43

My idea wasn't to discourage the use of the Banana Pi (so far it's the fastest ARM based 'server' I ever touched -- and the most inexpensive too) but to get other readers to jump in and measure also some stuff. Installation of RPi-Monitor is really straightforward and done in minutes following this tutorial step by step:

And it would be great if we as a community could collect readings of internal sensors in different load scenarios to combine them with other probes (eg. measuring the real voltage available on the SATA power connector since there's a little coil acting as a resistor and further decreasing the voltage available to a connected SATA disk)

As another example here's the power consumption of my A20-OLinuXino-Lime2 (comes also with an USB OTG port with Mini connector as a power source but also a real power jack: 5.5/2.1 mm). They also have some small circuitry on the board to stabilize 'noisy' power sources and it seems to work pretty good:

When being idle voltage is 5.09V on average (spikes between 5.04-5.11V):

Under some load: Voltage drops on average just down to 4.97V with a negative spike of 4.92V:

BTW: I did run the stress test again ("stress -c 2 -m 2 -i 2 -d2" on the same SSD as used on Banana Pi). But results can not be compared directly since the Olimex board doesn't run stable at 1200 MHz like the Banana Pi (I simply used Bananian 14.09 this time and exchanged the fex files. I would assume that I have to build U-Boot with A20-OLinuXino-Lime2 as target to let it perform reliable at higher speeds like the Banana Pi -- will try next. Until then the max speed the Olimex is able to run seems to be 1008 MHz -- I used this value as /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq for the stress test)

Edited by destroyedlolo at Tue Oct 28, 2014 05:46

I don't want to switch to another board ether : I'm happy with my banana which has unmatched price / power balance (despite the voracity of some greedy dealers )

I didn't face any powering issue : I have a "green" (low consumption) 2TB Sata disk powered and been able even to rebuild GCC which took several hours to compile with high CPU and disk usage.
Now if I want to dispatch several 1wire probe in my home, the problem you reported has to be tracked and potentially, I'll have to find an better way to provide power : I will try to power it up from an ATX psu, with a 3.5'' harddrive and power the PI from it's sata, as Tony suggested.
The problem with that is an ATX PSU consumes lot of energy even when off ...

The other strange thing in my case is the the voltage "drop" seems unrelated with CPU consumption ... so I guess I own a good USB cable but the PSU is not as stable as it is supposed to be.
OR it's the voltage probe that is not accurate.

Edited by tkaiser at Tue Nov 11, 2014 04:25

EDIT: Updated bpi-monitor.tgz and contents of rc.local to include latest findings about reading out the SoC's thermal values

A normal ATX PSU will waste enormous amounts of energy in such a low power environement. But fortunately most PSUs won't even power on unless you provide a really high load

My next test with the Banana Pi + 3.5" SATA disk will be with a Voltek SPEC7188B (5V/3.7A, 12V/0.7A) and I have a couple of old PATA-HDD enclosures (both USB and Firewire) with external fanless PSUs capable of 5V/2A and 12V/2A which make them the perfect companion for Pi+HDD in such a scenario.

Regarding Monitoring (unless you really look at the probes the internal PMU supplies it's just guessing): I just made a quick&dirty add-on for RPi-Monitor: (MD5: e16a03aa414464ca40b80082f1cdabce)

It contains the necessary stuff to measure the A20/AXP209 thermal/voltage/current 'sensors' in RPi-Monitor, the fixed wheezy update-smart-drivedb script from smartmontools and the definition of two simple shell functions to read out temperature values:
  1. /etc/profile.d/
  2. /usr/local/bin/
  3. /usr/sbin/update-smart-drivedb
  4. /etc/rpimonitor/data.conf
  5. /etc/rpimonitor/template/bananian.conf
  6. /etc/rpimonitor/template/cpu_bananian.conf
  7. /etc/rpimonitor/template/pmu_bananian.conf
  8. /etc/rpimonitor/template/temperature_bananian.conf
  9. /etc/rpimonitor/template/temperature_bananian_iso_8859_1.conf
  10. /usr/share/rpimonitor/web/img/pmu.png
Copy the Code
Prerequisits (on a Debian based distro):

1) Installation of RPi-Monitor as described:

  1. apt-get install smartmontools hddtemp iozone3 iperf
Copy the Code
  1. cd / && tar xzf /path/to/bpi-monitor.tgz
Copy the Code
4) Insert the following to /etc/rc.local prior to "exit 0":

5) execute /usr/local/bin/ once, reboot and enjoy 'BPi-Monitor' at Port 8888

You then have the necessary toolset for real benchmarking and disk related testing, the right sensors and you get something like (this is my A20-OLinuXino-LIME2 running Bananian but that makes no difference. I provide that URL approx. 24 hours to explore. Don't forget to go to Configuration --> "Auto refresh status page" to get updates in real time and play around with Statistics. I just started a 15 min. stress test and will then leave the device more or less idle)

If you use the link above and zoom into the temperature graphs you will notice that the SoC's temperature dropped by 4 degrees around 13:36 and by 2 degrees around 13:45 since I touched the A20 with one of my fingers for approx. 30 seconds. Unlike the Banana Pi the Olimex board has no heatsinks attached now so that this sort of tests (which chip's thermal sensor do I really measure? A20 or AXP209?) do work.

Out of curiosity, I just ran a quick comparison. I think your right about the cable and connector quality, but maybe it's not a length issue.

I happen to have ordered my BPi from the same seller, so I also got the Quatpower PSU (which I'm not using atm since it's not working reliable) and a cable that came with it. I never unpacked the cable actually, because I had a spare one which is slightly longer. Anyway, for the test, I unpacked the cable and compared it to the longer one I already had (came with a Logitech device).

The result for me looks like this:
When I use the Logitech USB cable, the voltage during idle is is around 4.95V. When I replace the Logitech cable with the cable that came with the Quatpower PSU, then the voltage during idle is 4.75V. So there is a noticable difference, but in my case it is not due to cable length. In both cases I used a 5V/2A power supply from Asus (came with a tablet computer).

But fortunately most PSUs won't even power on unless you provide a really high load

I did some test with a PC I'll cannibalize, and its PSU power on at least with my Green hard drive attached. It will be good for testing purposes, for my "production server", I need first to check the wast the PSU creates.

My next test with the Banana Pi + 3.5" SATA disk will be with a Voltek SPEC7188B (5V/3.7A, 12V/0.7A)

So with an external power supply, right ?
The Banana only provides 5v ... and I'm worrying for the D5 if your disk consume so much.

About the monitoring : yes, I'm already monitoring the PMU using my very own Domestik tool. I have to tanks you as I discovered about 'current' figure reading your post

And as I said, I have voltage drops totally unrelated to CPU load.


Edited by tkaiser at Wed Oct 29, 2014 04:19
silentcreek replied at Tue Oct 28, 2014 11:46
When I use the Logitech USB cable, the voltage during idle is is around 4.95V. When I replace the Logitech cable with the cable that came with the Quatpower PSU, then the voltage during idle is 4.75V.

What about the overall consumption of your Banana Pi? IIRC you have a busy USB disk attached?

You have to log in before you can reply Login | Sign Up

Points Rules