Help with Power Shutdown
mynet43
Posts: 644
I have a Propeller board that's powered by a 7.4V LiPo rechargeable battery.
I'm looking for a circuit to prevent the battery from becoming discharged. The battery is made up of two cells, each providing 3.7V. The battery is damaged if a cell is discharged below 2.7V.
I'm looking for a simple circuit to turn off the battery when the cell voltage falls below a preset value, say 3.0 V.
I can easily monitor the voltage with an ADC port I'm already using, MCP3208.
I'd like to use something like an FET, to turn off the battery when the Propeller tells it to.
The trick is to design it so the board will restart when the power is cycled. It should always start up and run, regardless of the battery voltage, unless the Propeller tells it to turn off.
This looks like it should be simple, but I haven't figured out the shut-off then restart problem.
Thanks for your help.
Jim
I'm looking for a circuit to prevent the battery from becoming discharged. The battery is made up of two cells, each providing 3.7V. The battery is damaged if a cell is discharged below 2.7V.
I'm looking for a simple circuit to turn off the battery when the cell voltage falls below a preset value, say 3.0 V.
I can easily monitor the voltage with an ADC port I'm already using, MCP3208.
I'd like to use something like an FET, to turn off the battery when the Propeller tells it to.
The trick is to design it so the board will restart when the power is cycled. It should always start up and run, regardless of the battery voltage, unless the Propeller tells it to turn off.
This looks like it should be simple, but I haven't figured out the shut-off then restart problem.
Thanks for your help.
Jim
Comments
Or...you could probably use an op amp with·a pot on pin3 to control the threshold
Thanks for the feedback.
I'm not sure you read the post right. (Or I didn't understand your response.)
I'm trying to have the Propeller shut off the battery. The Prop already knows the battery voltage (from the ADC).
Jim
Post Edited (BADHABIT) : 6/5/2009 1:28:34 AM GMT
Thanks again for the feedback.
I DO want to reboot the board when the power switch is recycled.
Here's a summary:
1. Turn off battery power under Propeller control (board goes dead).
2. When power switch is recycled from off to on, allow battery power to all systems.
I hope this helps.
Jim
Hopefully one of the older guys will verify this, but I think it would work.
BH
Can you be sure that both cells discharge at the same rate, or do you need to monitor them individually?
-Phil
I will leave the battery cell monitoring up to you.
Here is a circuit derived from an auto shut-down circuit I originally designed for the Basic Stamp which had later been revised for the Propeller. The circuit below is an even further improvement on the previous Propeller design.
Circuit operation:
When the "ON" switch is closed, the PMOS transistor turns on which powers a 3.3V regulator (ideally this would be a low drop-out regulator). The regulator supplies power to the NPN transistor via a 330 Ohm resistor keeping it on which in effect holds the switch closed. If the I/O pin is made an OUTPUT and LOW, then the NPN transistor turns off shutting down the power. Now the Diodes serve two purposes they ensure that the I/O pin has enough BIAS to completely turn the NPN transistor off by raising the required voltage threshold to turn on the NPN transistor to about 1.95V compared to the normal 0.65V ... The other reason is that the I/O can be made an INPUT to monitor the state of the power switch. Again by raising the threshold to 1.95V, this ensures that the I/O can detect a logic "1". If the power switch is closed (even if the circuit is already on) the voltage at the base of the NPN transistor drops to about 0.65V resulting in a logic "0" detection from the I/O.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I could monitor the indidividual cells, since that's what I'm using. However, right now my main concern it to avoid damaging the batteries from over discharging.
@Beau,
Thanks so much for the cool circuit. I think it will basically do what I'm looking for. I've been staring at it for a while, and there's still one thing I haven't figured out. If the "ON" switch is closed, how does the transistor turn off the power? I'm sure I just need another cup of coffee, but could someone help me understand this?
Thanks for all the help!
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Now it all makes complete sense!
It wasn't obvious from the diagram.
The way it's set up, I can monitor the switch and turn it off for them when they press it a second time.
Thanks again,
Jim
Note: All power to additional circuitry must either go to the Drain of the Mosfet or the output of the regulator.
When I built this circuit to test it last night, I used a SUD50P06-15L for the P-MOS and a standard 2n3904 for the NPN transistor. The P-MOS was way overkill (just what I happened to have in front of me) you should choose what will be applicable to your current demands.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
You just answered everything I wanted to know but was afraid to ask [noparse]:)[/noparse]
I think that will work perfectly!
Jim
but it might be easier to just add a battery protection circuit to your battery pack.
I've used something like this www.batteryspace.com/index.asp?PageAction=VIEWPROD&ProdID=3117 before and it works pretty well.
I once tried to integrate this functionality into my board but found it was more cost effective to have the protection in the battery pack.
an advantage of these circuits is they also protect from overcharging and over-current which can be dangerous as well.
Thanks for the good info. The price is certainly right, at $3.95 for the complete control board.
I really don't want to use another circuit board. The battery is mounted to my board with velcro. I'm going to make some mods to my board anyway, so I'll probably use Beau's circuit, since he was kind enough to breadboard it to make sure it works. I already have a spare ADC channel, so I can monitor the voltage.
I might also look at the chips referenced in your link. The Mitsumi MM1412 Protection IC and the Panasonic Si4936 MOSFET. They look interesting.
Thanks again,
Jim
I have put this circuit together on a Propeller Proto Board. I modified the proto board by removing the power jack and connecting the output of the PMOS to the supply pin. I have gotten the circuit to work somewhat. When I press the switch, the power comes on. When I manually ground the propeller I/O pin that the NPN base is connected to through the 100Ohm resistor, the power shuts off. But for some reason, I can not get the power to shut off with the I/O pin set as an output and LOW.
I measured the voltage at the I/O pin and it is at about 2V. When the switch is pressed the voltage drops to about 0.75V. But when the I/O pin is set to an output and High or Low the voltage at that pin remains at 2V and does not change. The only way to shut the power off is to manually connect that pin to VSS.
At first I thought that the I/O circuitry could have been damaged in some way, so after checking another pin, I moved the resistor to the new pin. And the same result. I checked the original pin, and it worked fine. The voltage was 0V and 3.3V when set to Low and High respectivly.
I can't figure out why the Prop I/O pin doesnt do anything with this circuit in place.
The only thing I can think of is that the NPN that I am using has some strange characteristics, although I'm pretty sures its just a 2N4400.
Any suggestions?
Thanks,
Marcus
The test code I am using is attached.
PowerTest.spin
-Phil
The circuit that I am referring to is the one Beau attached to his post #10 above.
I had not been writing this program to EEPROM, only to RAM, as I was worried about having the Prop shutdown after start up too quickly if the circuit did work, without allowing time to reprogram. But I did try it with EEPROM and the result was the same.
Should I try adding a third diode in series with the other (2) diodes?
Thanks you your responses. Let me know if there is anything in the image that is unclear.
Sincerely,
Marcus
If I set the "powerPIN" to be 14, and then measure the voltage at pin 14 with a voltmeter, the voltage flips between 0V and 3.3V every one second as expected.
Once I set the powerPIN to 15 (which is the pin the base of the NPN is connected to through the 100 Ohm resistor) and rerun the test, the voltage at pin 15 does not change at all. It remains at the same voltage at the base of the NPN, which is the voltage drop across the diodes.
I agree that something does not seem right.
Thanks,
Marcus
Double-check your connections. It sounds like you've got a direct short between P15 and one of the transistor pins.
-Phil
I have discovered another thing. If the prop pin that is connected to this circuit is set to an output, the prop stops working. I tested this by have 2 pins be controlled. When one of the pins is the pin connected to the Base of the NPN, the other pin remains at 0V. If I choose 2 pins that are not connected to the NPN, they both flip between 0 and 3.3V as expected. It appears that if the pin connected to the NPN is left as an input, the prop works fine. I think that the circuit is causing the prop to freeze or malfunction when the pin connected to it is set as an output.
Thanks,
Marcus
-Phil
If you want the Propeller to keep itself 'alive' set the pin HIGH first before making the direction an OUTPUT.
-Phil
Won't that make things worse? It's the charge on the filter cap that's making enough voltage available to keep the NPN on when the Prop pin tri-states during reset. Maybe a diode connected across the 3.3V regulator: anode to Vdd, cathode to Vin. But I've got my doubts even about that remedy.
-Phil