Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with Battery Backup Circuit

Status
Not open for further replies.

Robert1

New Member
I need help with a circuit that would switch to battery power when the AC power is disconnected. Does the following look like it would work? I am a little concerned that if the unit is running on AC power that there may be a “reverse” voltage across the transistors CE junction if the battery power is low. Will this damage the transistor or will the transistor just block the reverse current flow. Was also hoping to extend the battery life as long as possible. Is this design very low power or is there a better way.

Thanks.
 

Attachments

  • Circuit Diagram.PDF
    5.7 KB · Views: 415
Looks to me like the transistor will block the power supply without any issues.
 
I'd guess that the micro is part of the "Logic load". If that's the case then you'll be trying to set the micro Vcc to 0V. The protection diode on the "O" pin will then pull the "O" pin to 0V plus one diode drop. The transistor will turn on.
 
Sounds good!

Thanks Brownout. I was worried I was going to smoke something.


Thanks mneary. The uC is not part of the logic load. It is powered by a "diode OR" of the battery and AC/DC power supply (which I did not show in the diagram for simplicity sake). I will put the uC in sleep mode but I needed a way to cut off the rest of the logic load from drawing down the batteries. Could not think of a better way to do it.
 
Usually a transistor is not used. Instead the supply voltage is a little higher than the battery voltage so the battery can be charged then a diode stops the battery from discharging into the supply if the supply stops.
 
Thanks mneary. The uC is not part of the logic load. It is powered by a "diode OR" of the battery and AC/DC power supply (which I did not show in the diagram for simplicity sake). I will put the uC in sleep mode but I needed a way to cut off the rest of the logic load from drawing down the batteries. Could not think of a better way to do it.
Your circuit is good. With the uC on its own power and in sleep, there's no leakage path. The transistor should do the job just fine. Make sure the other uC pins are set to 'input' before (when) you go to sleep to eliminate other leakage through the I/O pins.

Suggestion for slight improvement: When it's 'on', there's about a hundred microamps wasted as base current, and the 2N3906 will begin to have bothersome voltage loss at collector currents of 2mA or so. A logic-level P-channel MOSFET (not JFET) with a high value resistor (2.2 meg) from gate to source would be lower loss.

[edit]Note that this curcuit as described does not recharge the batteries. Some NiMH cells have disappointing self-discharge rates, so a circuit like this might work longer with alkaline batteries,[\edit]
 
Last edited:
Thanks audioguru. Don't think I can use a diode since the logic load would then over-discharge (and permanently damage) the NiMH cells. I needed a way to isolate the load when the batteries are sufficiently drained. When the uC notices that the batteries are low , it would tri-state the output that is connected to the base of the transistor to turn power off to the logic load and then put itself to sleep.
 
Transistor vs MOSFET

Thanks mneary!!! Great stuff - just what I needed. I had hoped to use alkaline batteries but the enclosure I am using does not allow for servicing of the batteries so I had to go with a recharging arrangement.

I originally had a MOSFET but I switched to a transistor because I thought that a MOSFET would cause a problem with the batteries. My limited understanding of MOSFETs is that they bidirectional and will pass current both ways when turned on??? If true, then whenever the unit is powered from the AC/DC supply, the MOSFET would pass current back to the NiMH cells. I would have no way to stop the current when the batteries were fully charged and this would eventually cause the batteries to overheat, vent and go bad. I was hoping that the transistor would block this inadvertent overcharging of the cells.

I did not show the entire diagram for simplicity sake and since I was fairly confident that I had the rest of the circuit designed properly. I have attached the entire power supply circuit. Does this all seem ok or am I still off base. Thanks.
 

Attachments

  • Modified PIC Power Circuit.PDF
    22.9 KB · Views: 332
I'm glad you caught me on the MOSFET feeding back into the battery.:eek:

If your sensors need only 5mA you can supply their power directly from a PIC I/O, without the PNP.

As I look at the control pin of the LM317, I wonder what will happen when the µC has it turned off. When the control pin is set to (H) it would regulate at the µC'c Vcc plus its setpoint. If you set the pin to 'input' it will float until it reaches the µC's Vcc. You might need the BC548.
 
Thanks again mneary! Good point about the BC548. You are turning into a life saver. :)

I was going to set the PIC output to the regulator’s ADJ pin to low to turn the regulator off and tri-state the PIC output to turn the regulator on. I was hoping the battery would hold the regulator’s ADJ voltage at no more than .7V (for the diode) above the maximum battery voltage (which appears to be around 4.5V). This would put the ADJ pin at no more than 5.2V total which would be under the PICs maximum voltage for an I/O pin (VCC + .3 or 5.3V). However, I did not account for the possible failure of one of the battery cells. Not sure how batteries typically fail but if one of the failure modes looks like an open circuit, I think I would be in trouble. To test, I removed the batteries from my breadboard and the ADJ pin voltage went to 5.4 volts. Since this above the PICs maximum voltage on an I/O pin, my guess is that I could damage it if this ever happened?

So I guess if I put the BC548 back in I would protect the I/O pin but still could go above the maximum VCC for the PIC in the case of a battery failure and a slightly higher input voltage from my unregulated AC/DC adapter. Do you think I might be able to take care of both these problems with a 5 volt zener breakdown diode between the 12 Ohm and 1 KOhm resistors (and not add back in the BC548)? Or have I completely missed the reasoning for adding the 548 back in?

On the power issue:

I was really hoping to power the sensors directly from an output pin on the PIC but did not seem to be able to doing without losing a significant amount of battery operating time. The IN5815 is dropping .3V and VOH on the PIC is Vcc - .7 so it looks like I will be dropping as much as a volt of battery power if I go through the PIC. The operating voltage range of the battery is 4.2 (fully charged) to 3.3 (drained). Since the sensors will only operate down to 2.7V, the unit would stop functioning when the batteries drain to around 3.7 volts. So, It appeared as though I would only be unable to use ½ my battery power by going through the PIC. That is why I was using the 2N3906. I was hoping to get a much smaller voltage loss across the transistors junction when pulling 5mA. If the drop is no larger than 3.3-2.7 or .6 volts, I should be able to use the entire range of the battery supply. Does this seem reasonable?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top