dotancohen
Posts: 7
Joined: Thu Mar 14, 2013 7:19 pm

How to check output of power supply (Nokia phone charger)

Sun Apr 21, 2013 4:44 am

I have a few mini-USB "phone chargers" lying around, but they mostly seem to be a bit weak. I am currently running the Pi off an original Nokia charger that is rated for 500 mah and it works fine. However, none of the other chargers satisfactorily charge the phone, even those rated for 1000 mah. I certainly don't want to put these suspected "weak" chargers on the Pi! Is there any way to check the power output of these chargers, with either the Raspberry Pi itself or with a general-purpose multimeter? Perhaps some inexpensive purpose-specific tool that I could purchase?

User avatar
rpdom
Posts: 15021
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to check output of power supply (Nokia phone charger

Sun Apr 21, 2013 5:14 am

The simplest test is to get a multimeter, set to a DC Volts that can handle at least 6 Volts and measure the voltage between TP1 and TP2 as marked on the Pi, with programs running and all peripherals attached (wifi, keyboard, mouse and anything else you might be using).

If the voltage is reading between 4.8 and 5.2 volts, the the power supply appears to be able to handle the current required.

You can't easily test the Ampage rating of the supply, because it will only supply what is needed - until it reaches the most it can give and then the voltage will start to drop.

Many of those label can be misleading. Some supplies will give 5V, but only at low power. If you try to take more power then they give less than 5V. The worst I've found so far claimed "5V 1000mA" and gave 5V at 100mA, but dropped down to 3V at 300mA :o

By the way, power supplies are rated in mA. Batteries are rated in mAh. The difference is time (h is for hours). Power supplies should be capable of supplying up to that much power as long as they are switched on. Batteries will supply that much power for an hour, or half that for two hours, twice that for half an hour and so on. One is a maximum rating, the other is capacity.

dotancohen
Posts: 7
Joined: Thu Mar 14, 2013 7:19 pm

Re: How to check output of power supply (Nokia phone charger

Sun Apr 21, 2013 6:55 am

Thank you! You do address the core issue: how to check if the currently-attached power supply is adequate for the current load. Is there any way to programmatically (say, with Python) compare the voltage potential across those pins or is a hardware voltage meter necessary? I would like to leave the Pi in a place that I do not visit often (my mother-in-law's house) and I would like to monitor this parameter as the Pi will be placed under varying loads.

I suppose that I do need to load-test the power supply, in fact that is what I was afraid of. I suppose that I could buy a USB-mini female connector and connect that to a potentiometer, but I'm afraid of overloading (short-circuiting) the power supply. Any thoughts on this?

User avatar
rpdom
Posts: 15021
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to check output of power supply (Nokia phone charger

Sun Apr 21, 2013 7:22 am

There is nothing on the board that can give you the voltage across those points, or anywhere else on the 5V power lines.

You will need to use some external hardware like a meter, or build a circuit with an adc connected to the gpio pins.

Other places to measure the same voltage is between pins 2 (or 4), and 6 (or 9, 14, 20, 25) of P1, the power connections on the USB ports, and between pins 1 and 7 (or 8) of P5.

Testing the PSU with a variable dummy load is one idea. You could even put a meter set to Amps in line with the power to see how much current is being supplied. You would need a fairly heavy duty pot though. A little one like a volume control would burn out at those sort of current levels.

You could use a multi-way switch with a series of resistors on it. Perhaps a chain of five or six 1 Ohm 10 Watt resistors, with a 5 Ohm resistor on the end (to limit the current to 1000mA max) giving a maximum resistance of 10 or 11 Ohm (550mA to 454mA).

dotancohen
Posts: 7
Joined: Thu Mar 14, 2013 7:19 pm

Re: How to check output of power supply (Nokia phone charger

Sun Apr 21, 2013 9:04 am

I do like the idea of a set resistance better, now that I think about it.

V = I*R if I remember Ohm's law right. So, 5v = 1a * Xo, solving for X I would need a 5 Ohm resistor to simulate 1 Amp of current from the power supply. From the following diagram it seems that I test across the two end pins:
http://www.nexus7nexus10.com/forum/nexu ... #post25950
Could you please confirm that my thinking is correct? I am not an EE.

Thank you!
Last edited by dotancohen on Sun Apr 21, 2013 9:09 am, edited 1 time in total.

dotancohen
Posts: 7
Joined: Thu Mar 14, 2013 7:19 pm

Re: How to check output of power supply (Nokia phone charger

Sun Apr 21, 2013 9:08 am

Tell me, is there any type of LED that lights up above a threshold voltage, but not below? With such a LED I could wire a resistor and the LED to a USB mini female connector and then just have a simple binary "Provides 5v at 1000 ma?" tester. That seems like something that I could solder together and share with other Pi users.

I think that a 5v zener diode together with a standard LED might work, but I worry about burning out the power supply with the zener diode.

User avatar
Burngate
Posts: 5972
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: How to check output of power supply (Nokia phone charger

Sun Apr 21, 2013 11:05 am

dotancohen wrote:Tell me, is there any type of LED that lights up above a threshold voltage, but not below?
Yes, but no!
All LEDs work more-or-less like that - when they're lit they have a constant voltage across them, and take whatever current is needed to keep it there. A resistor in series with it controls how much current it takes
dotancohen wrote: With such a LED I could wire a resistor and the LED to a USB mini female connector and then just have a simple binary "Provides 5v at 1000 ma?" tester.
No.
If the LED has 2v across it, the resistor will have 3v across it, and the current will be given by Ohm's law. Less volts will mean less current and so less brightness
dotancohen wrote:I think that a 5v zener diode together with a standard LED might work, but I worry about burning out the power supply with the zener diode.
5v zener in series with 2v LED would need 7v to light it up. Give the pair more than 7v and it will try to take as much current as the PSU can give, up until something breaks, be that the LED, the zener, or the PSU

What you need is some sort of comparator to compare the 5v with a reference. If the 5v is higher, switch the LED on, otherwise keep it off

dotancohen
Posts: 7
Joined: Thu Mar 14, 2013 7:19 pm

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 8:04 am

Burngate wrote:
dotancohen wrote:Tell me, is there any type of LED that lights up above a threshold voltage, but not below?
Yes, but no!
All LEDs work more-or-less like that - when they're lit they have a constant voltage across them, and take whatever current is needed to keep it there. A resistor in series with it controls how much current it takes

I see, thanks. Therefore, would a 5v LED wired in parallel to a 5 Ohm resistor work as simple binary "there is more than 1000 ma being supplied" tester? I understand that the LED probably has non-insignificant resistance, so should I wire up an additional resistor _in_series_ with it (the LED-resistor unit would be _in_parallel_ with the first resistor) to bring its resistance up to 5 Ohms as well? I realize that the _total_ resistance of the entire contraption would be 2.5 Ohm, but the LED would be comparing the voltage across the 5 Ohm resistor it seems to me.

I would connect that across the two outer pins and have a simple tester. I see that all the parts are available for <$5 USD on ebay.

Or is my thinking all wrong? I am not an EE, and have been out of university for quite a few years!

Code: Select all

      --------      ----------------
 +---| 5v LED |----| ? Ohm Resistor |----+
 |    --------      ----------------     |
 |                                       |
 |            ----------------           |
 +-----------| 5 Ohm Resistor |----------+
 |            ----------------           |
 |                                       |
 +                                       +
To charger negative             To charger positive

User avatar
Burngate
Posts: 5972
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 11:02 am

Hmm
In your diagram, your charger is nominally 5v, and you want a yes-no answer to "is it above 5v?"

Assuming dead-on 5v the current through your 5 Ohm resistor will be 1A

Now the other leg
5v LED - I don't know of any - different coloured ones have different voltages, but none have 5v.
Still, you could put a zener of appropriate voltage in series to bring the combination to 5v - a LED is a bit like a zener of 1.5v or 2v or whatever, so just try out different zeners to get your asked-for 5v
Now the resistor
If your LED-zener combination is exactly 5v, and the charger is less than 5v then the LED would be off - so your answer would be correct
If the charger is giving, say 5.25v, then the resistor will have 0.25v across it
How much current do you want through the LED? 10mA? that should light it nicely.
So we want 10mA through a resistor with 0.25v across it - Ohm's law - 25 Ohms
But if there's only 5.05v from the charger, there'll only be 2mA through the LED and it'll be quite dim

What happens if the charger actually gives out nearer 6v? you'll now have 1v across the resistor, and so 40mA going through it and it may not survive (though it may)

I would go for a more complicated curcuit, using a proper comparator, such as LM211, which will give a "yes-no" answer, and use that to drive the LED at a controlled brightness

drgeoff
Posts: 9759
Joined: Wed Jan 25, 2012 6:39 pm

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 11:03 am

There is no such thing as a 5 volt LED. Also you need to consider that the voltage tolerance for guaranteed RPi operation is quite tight (around 5%) which is comparable with the tolerance of zener diodes.

If you are really determined to go further with this you need to be thinking along the lines of an op-amp as a voltage comparator. An accurate temperature compensated reference 'diode' (eg TL431) of around 2.5 volts connected to the - input and a suitable voltage divided version of the PSU voltage on the + input. (Need 1% resistors at least for that.) Op-amp output through indicator LED and series limiting resistor to ground. The op-amp can be powered off the PSU under test. All in parallel with the load resistor.

The above will light the LED if the PSU voltage is not too low. If you want to check for too high you need another comparator (with indicator LED) and another resistive divider. You can use the same precision reference voltage for the two comparators. Ref to + input and second divider chain to - input on second op-amp/comparator.

User avatar
Burngate
Posts: 5972
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 11:16 am


drgeoff
Posts: 9759
Joined: Wed Jan 25, 2012 6:39 pm

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 11:43 am

Burngate wrote:Using op-amps as comparators http://www.analog.com/static/imported-f ... MT-084.pdf
Was that intended to help the OP or to tell me not to use an op-amp as a comparator? :)

User avatar
rpdom
Posts: 15021
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 12:26 pm

I think it would be possible to make a bargraph display with (up to) 10 LEDs on a 4017 chip.

Use a 3.3v reg to make sure the chip gets a fixed voltage, a couple of resistors to divide the input voltage by 2, to get it under 3.3v.
A chain of resistors to set the hi/lo reference voltages for the 4017 to something like 2.35v (half of 4.7v - too low) and 2.65v (half of 5.3v - too high), then you get 10 steps displayed between those levels.
Put red LEDs for the top and bottom two, yellow/amber for the next top and bottom pairs and green for the middle two.

Red = too high/too low. Amber = ok, but not ideal. Green = perfect :)

Shove the 5 ohm resistor on as a dummy load, and you're done.

Just pondering out loud here...

drgeoff
Posts: 9759
Joined: Wed Jan 25, 2012 6:39 pm

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 12:43 pm

rpdom wrote:I think it would be possible to make a bargraph display with (up to) 10 LEDs on a 4017 chip.
Which "4017 chip" are you thinking about?

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 12:58 pm

Simple Go/No Go VOLTAGE indicator, only measures voltages are within 4.8V and 5.2V at point being measured. Accurate measurements should be done with meter on TP1 and TP2 of Pi

Has NO LOADING circuit, which power resistors (which get hot) or other type of load eg a Pi for loading.

Uses standard resistor values and parts available from places like Farnell/RS/etc...
Attachments
VoltageWindow-Measure Rev A.gif
Voltage Window Measurement circuit
VoltageWindow-Measure Rev A.gif (12.06 KiB) Viewed 3138 times
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 1:01 pm

drgeoff wrote:
rpdom wrote:I think it would be possible to make a bargraph display with (up to) 10 LEDs on a 4017 chip.
Which "4017 chip" are you thinking about?
That was my thought as 4017 is normally a decade counter....
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
rpdom
Posts: 15021
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 1:11 pm

drgeoff wrote:
rpdom wrote:I think it would be possible to make a bargraph display with (up to) 10 LEDs on a 4017 chip.
Which "4017 chip" are you thinking about?
Oh bother. Been thinking about other projects.

I mean LM3914, of course!

drgeoff
Posts: 9759
Joined: Wed Jan 25, 2012 6:39 pm

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 3:43 pm

rpdom wrote:
drgeoff wrote:
rpdom wrote:I think it would be possible to make a bargraph display with (up to) 10 LEDs on a 4017 chip.
Which "4017 chip" are you thinking about?
Oh bother. Been thinking about other projects.

I mean LM3914, of course!
That looks feasible. I think you don't need to regulate the supply to the LM3914 as it claims the voltage ref change is <0.03% per volt for supply between 3 and 18 volt. It isn't close tolerance though - anywhere between 1.2 and 1.34 volt - so would need a calibration pot or AOT resistor.

User avatar
Burngate
Posts: 5972
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: How to check output of power supply (Nokia phone charger

Mon Apr 22, 2013 4:40 pm

drgeoff wrote:
Burngate wrote:Using op-amps as comparators http://www.analog.com/static/imported-f ... MT-084.pdf
Was that intended to help the OP or to tell me not to use an op-amp as a comparator? :)
Both? Neither? Just showing off?
I just found it interesting ;)

Return to “Troubleshooting”