Maker Pro
Maker Pro

Simple power supply questions

thomaskwscott

Nov 6, 2013
16
Joined
Nov 6, 2013
Messages
16
I've wired everything up as above but I'm experiencing some strange results. I would try to explain but figured the easiest thing was to draw the whole thing out so please see the attached image,

The relay is of the normally closed type and when running on battery power the battery charger and 5V power supply are disconnected. These are ganged together so that both will always be connected or disconected simultaneously (the dashed power brick). The idea is that when the power supply is connected the battery will be isolated and the power supply will take over responsibility for powering whatever is on the output of the regulator. This means the battery has in effect nothing connected to it and can be safely connected to the battery charger.

This all seems to be working correctly and i've been testing it without the battery charger. However i'm having trouble proving the battery is isolated. I thought i could measure voltage across the points marked in red on the picture and should read zero but in fact i'm seeing around 2.8V. I assume this is coming off the 5V power supply but I can't see how any voltage can get to this point.
 

Attachments

  • powerDiag1.png
    powerDiag1.png
    50.7 KB · Views: 108

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
To answer your question, it may be that there is some leakage in your diode. If you're using a high impedance meter it may read this as a small voltage. The cure is to temporarily place a resistor (say 10k) across the test points and see if the voltage drops to close to zero (it might fall to 3mV). If it does then you can say that the battery is effectively isolated.

There may be a couple of other gotchas too.

1) Beware of the output falling to zero briefly as you disconnect your 5V.

2) I assume the 14V is not really 14V, but a charger designed especially for the 9V battery that you're using. If not, I pity your poor 9V battery.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That is not the best way to arrange the circuit.

1. The diode between the 5V power supply output and the main positive output will drop some voltage; this can be minimised by using a Schottky diode but it can't be eliminated. So if the adapter produces 5.0V the circuit might only receive 4.7V or so.

2. The relay contact should switch the positive connection from the battery, not the negative one. This ensures that all negative points on the circuit are always at the same potential. Sometimes, external circuits can connect negative points together, and that would defeat the relay contact, but even if not, it's good practice to keep negatives together and switch the positive connections.

3. Speaking of negatives and positives, I find your diagram really hard to read. It's normal to draw the common negative rail horizontally at the bottom of the drawing, and have voltage sources and loads shown vertically.

4. The diode between the battery positive and the regulator input isn't needed.

Try changing the relay contact position and see whether that fixes the problem.
 

thomaskwscott

Nov 6, 2013
16
Joined
Nov 6, 2013
Messages
16
Hi Guys,

Many thanks for the replies, I've not had a chance to test with the resistor yet as I have to go buy one (maybe i should invest in a little stock....). In the mean time I've tried to address what you guys have said and drawn a new diagram with common earth rail at the bottom and it does indeed make things look a lot cleaner. I really appreciate the help with things like this aswell as the help with the electronics principles. I'm way out of my league here and half the reason i took this project on was to learn how to do things properly.

To address steve's points first:

1) Beware of the output falling to zero briefly as you disconnect your 5V.

I really need to avoid this. The power supply is for a small computer and i do not want power to be interrupted to this as it's switched from battery to mains power and back again. I was hoping to organise this by staggering the connections so that the relay is disconnected before the 5V supply. If there is a relatively easy way to achieve this electronically i would be very interested in it.

2) I assume the 14V is not really 14V, but a charger designed especially for the 9V battery that you're using. If not, I pity your poor 9V battery.

You are correct, the 14V supply is a properly designed battery charger. I'm not even sure it's 14V, just remember measuring that across it at one point.

And for Kris' points:

1. The diode between the 5V power supply output and the main positive output will drop some voltage; this can be minimised by using a Schottky diode but it can't be eliminated. So if the adapter produces 5.0V the circuit might only receive 4.7V or so.

I actually experienced this whilst testing. The voltage dropped and the screen started flickering, I was going to ask about it after i had solved the other issues.

4. The diode between the battery positive and the regulator input isn't needed.

Can this be removed because of the change in relay position? I put it in to attempt to protect the battery from the 5V power source when in "charging mode". I've been trying to play it safe and completely isolate the battery when it is connected to the charger.

I've attached a new version of the circuit that i will solder up and test ASAP, if you see any obvious gotchas i would be much obliged.
 

Attachments

  • powerdiag.png
    powerdiag.png
    46.1 KB · Views: 96

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That's a start, and it's much easier to follow, but that circuit has a problem: the relay coil is powered from the outgoing 5V rail, so when that rail is energised from the 5V power supply OR from the battery, the relay will open!

You need some way to isolate the 5V power supply from the regulator output, so the relay can be powered only from the DC power supply, and will not be energised when the battery and regulator are supplying the load. This is the original reason for the diode in the 5V line, I guess.

This approach is not really workable. I strongly recommend that you use a higher voltage from your power supply, and feed it into the INPUT of the regulator. This can be done with diodes, and their voltage drop will not affect the 5V output voltage. You can also avoid the relay.

See my explanation in post #2 on this thread, starting from the third paragraph.
 

thomaskwscott

Nov 6, 2013
16
Joined
Nov 6, 2013
Messages
16
Hi Kris,

I have to admit that i didn't understand the alternative in post 2 (because i wasn't thinking in terms of a common ground rail) and so tried to press on with the other option. However, i have just re read it and i think i now get it (and it's genius!). I've included another diagram to show how i think it would look and let me see if i've got the theory right.

When the power supply is switched on the potential is reversed (because there is a higher voltage at the power supply than the battery). This should mean that current would attempt to flow into the battery but this is blocked by a diode. This diode effectively creates a barrier that completely isolates the battery allowing it to be charged.

As usual though this raises a couple of questions for me. Doesn't the higher power supply voltage affect the output voltage from the regulator? and if so do i need a resistor or something to drop it down? Also I assume my power supply voltage will need to be higher than the maximum voltage the battery charger can supply too as that could switch the potential direction again?

Many thanks for your help and sorry for dragging you round the houses to get to this point.
 

Attachments

  • powerdiag.png
    powerdiag.png
    39.5 KB · Views: 85

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, you've got it.

The higher input voltage doesn't affect the regulator output - the regulator regulates its output voltage; you just need to provide an input voltage that's high enough to cover the dropout voltage (the minimum required input-to-output voltage differential) and low enough that it doesn't damage the regulator.

A switching regulator handles a wide input voltage range better than a linear regulator does. A linear regulator can dissipate a lot of heat if there's a large input-to-output differential. But you're using a switching regulator, right?

Yes, your power supply voltage needs to be higher than the maximum battery voltage under charge.

No problems :)
 

thomaskwscott

Nov 6, 2013
16
Joined
Nov 6, 2013
Messages
16
I'm using a lm2596 buck switching regulator so i think i will be fine. I didn't know ytou could change the input voltage so easily. They are remarkably useful devices!

One final question before i try and put this all together. My battery charger says 8.6-11.2V on it (which makes sense as it's designed to charge either 7.2V or 9.6V packs). Will a 12V power supply provide enough difference if the charger is running at 11.2? I can go higher but 12V 2A power supplies are very cheap.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Most general purpose regulators have a fairly wide input voltage range.

If the charger never outputs more than 11.2V you will be fine with a 12V supply. But 11.2V is only 1.4V per cell and I believe NiMH cells sometimes want more than 1.4V during charge... But if the charger says 11.2V I guess you can believe it.
 

thomaskwscott

Nov 6, 2013
16
Joined
Nov 6, 2013
Messages
16
Just a quick note to say that a 15V power supply arrived yesterday and i hooked it up and it all works brilliantly. Many thanks for all your help it is much appreciated.

This project has really got me intersted in electronics in general and also highlighted how little i know. I have one book (Starting Electronics by Keith Brindley), do you have an recommendations for other resources to set me on the right path?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Great! Well done. You're welcome. I don't have any recommendations for books or other learning resources, but others here probably do.
 
Top