A Power(less) story


9 posts
by jamesh » Fri Oct 11, 2013 8:50 am
Well, never thought I'd be caught out by this one.

I've been testing changes to the camera code. On of them was reintroducing a keypress to take capture option that went missing a couple of months back. But I couldn't get it to work - whatever I did the getchar() to get the keypress wasn't detecting anything. It only went wrong during the app running - command line was working fine once out of the app.

However,I was, occasionally, getting network drop outs. At one point, a firmware update seemed to fix it, but then the drop out returned. So chatting with Dom, he reckoned power. But I'm using a benchtop power supply capable of 2A at 5v, so wasn't expecting that to be the problem.

Investigation showed, that the getchar() only stopped working once the camera was started. Curiouser and curiouser. But what could it be?

So, finally, I test the voltage TP1-TP2. And even with the bench power supply, the voltage is 4.0v, and drops to 3.8 when the camera is on. Camera was still working, but obviously not enough power to drive the keyboard as well. Double checking with a SS phone charger, and the problems go away.

But how can a benchtop power supply fail to run the Pi?

Turns out that the extension cable I made to connect the PS terminals to a female USB connector from which I then use a normal uUSB- cable to power the Pi has a high resistance. Shortening it to about 10cm (from about 1m) and the problem has gone!

So, turns out that even after all my recommendations and comments on 'make sure your power supply is up to scratch when using the camera' I still hadn't learnt my own lesson.

I have now.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11576
Joined: Sat Jul 30, 2011 7:41 pm
by gregeric » Fri Oct 11, 2013 10:05 am
Glad you got that sorted James, more speed to your development. Would be an interesting use-case of the PiNoir camera - point it at the problem & see where the power losses are!
Posts: 79
Joined: Mon Nov 28, 2011 10:08 am
by redhawk » Fri Oct 11, 2013 11:17 am
It's amazing how much voltage you can lose using poor quality cabling I had the same problem using a Poundland "Blackberry data cable" thinking I could power the Pi with it.
Even when I cut back the wire to 10cm I still had considerable voltage losses until I cut it back completely to the connector itself and soldered on some better wires :)

Richard S.
Last edited by redhawk on Fri Oct 11, 2013 11:50 am, edited 2 times in total.
User avatar
Posts: 3328
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by RaTTuS » Fri Oct 11, 2013 11:28 am
I've had a 10 port usb hub with a PSU that had the thinnest wires in existence ....
I think wet sting would of been better

[OK I knew the PSU was not up to it 1Amp for 10 ports .... - but even so it was down to 4.7V by the time it hit the HUB without anything plugged in .. right in the bin it went and my proper 7A unit went on to power it no worries]
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
"That's not right, the badgers have moved the goalposts."
User avatar
Posts: 4696
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by hippy » Fri Oct 11, 2013 12:07 pm
RaTTuS wrote:I think wet sting would of been better

Finally took the plunge, so to speak, and my foot of wet string measured approximately 10 Megaohms but I understand the sentiment. I am quite impressed people can create a metal wire with such a high resistance.

Surely there are standards as to what a cable carrying a USB logo or labelled as USB compliant must comply to ? I am not an expert but I did find this ...

http://www.usb.org/developers/devclass_docs/CabConn20.pdf wrote:Cables must contain two data-lines of 28 AWG, and a power pair of 28 AWG to 20
AWG. Power pairs smaller than 28 AWG are prohibited.


28AWG is standard ribbon cable and should have an expected resistance of around 0.07R per foot.

Perhaps "charger cables" are exempt from standards so maybe the best recommendation is to only use USB logo data cables and let trading standards know when they fail to comply.
Posts: 763
Joined: Fri Sep 09, 2011 10:34 pm
by FTrevorGowen » Fri Oct 11, 2013 4:45 pm
FWIW I've measured the (+ve) "core" resistance of a number of USB cables of various types acquired over the years. Most were supplied with hubs or printers but there are a couple of "esoteric" ones incorporating blue LEDs. The data can be found at:
http://www.cpmspectrepi.webspace.virgin ... esChk.html
Trev.
Mainly running "Wheezy Raspbian" on five Pi's (an A, B1, 2xB2 & a B+). Notes about them begin at http://www.cpmspectrepi.webspace.virginmedia.com/raspberry_pi/raspiidx.htm
User avatar
Forum Moderator
Forum Moderator
Posts: 1733
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
by jamesh » Fri Oct 11, 2013 7:47 pm
FTrevorGowen wrote:FWIW I've measured the (+ve) "core" resistance of a number of USB cables of various types acquired over the years. Most were supplied with hubs or printers but there are a couple of "esoteric" ones incorporating blue LEDs. The data can be found at:
http://www.cpmspectrepi.webspace.virgin ... esChk.html
Trev.


I reckon my extension cable was about 0.7 for 1m. Then I need to add on the uUSB cable itself, which probably put it at 2M long, probably over an ohm in total. I'm still using the uUSB itself, just with a much shorter extension and all is fine.
Soon to be unemployed software engineer currently specialising in camera drivers and frameworks, but can put mind to most embedded tasks. Got a job in N.Cambridge or surroundings? I'm interested!
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11576
Joined: Sat Jul 30, 2011 7:41 pm
by FREEPI'S » Fri Oct 11, 2013 7:57 pm
COOL STORY
I HAD A PROBLEM SIMILAR
Posts: 1
Joined: Fri Oct 11, 2013 7:52 pm
by Lob0426 » Fri Oct 11, 2013 11:52 pm
I had similar problems early in my trials of back-powering a RasPi.

Cable length was one of the culprits as USB cables wires are very small. The other was loss (high resistance) at the USB connectors. Hard wiring the USB powered hub directly solved the problem (4.25v to 4.92v).

I found later that 1/10" pin headers are more convenient and show very little loss.

In a more recent project I put the power adapter inside the case with the RasPi. The wire length from the PSU board (5V) is less than 6". The power into the box is 110V (U.S.). I actually saved 1 watt by powering this way rather than having the adapters original 6 foot small gauge cable. The 6 feet of large gauge wire at 110V has very little resistance in comparison.
512MB version 2.0 as WordPress Server
Motorola Lapdock with 512MB
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!
User avatar
Posts: 1903
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.