Picaxe turning itself off

martinn

Member
I have a datalogger running off a 12v lead acid battery. Is there any way for the Picaxe that is monitoring battery voltage to shut the datalogger down when the voltage gets to a predetermined level (that is, before damage occurs to the battery)? The only low power idea I have had is to use a latching relay which the Picaxe shuts off once the battery gets to a set level?

Martin
 

BeanieBots

Moderator
Latching relay is exactly how I would do it.
Only requires brief pulse and offers perfect isolation. No leakage.
Make sure you have a good sized electrolytic cap on the 12v side of your 5v relay so that there is enough energy to maintain the "off" coil for a about 20mS after the contacts open. About 220uF should do.
If other equipment is turned off by the same relay, then also fit a blocking diode between 12v and the cap or the cap will be drained by the other load.
 

MFB

Senior Member
Power-down circuitry

In the August issue of Nuts & Volts magazine there was a PICAXE-18X based article about a FRAM recorder for model rocketry, which included a useful power-down circuit that used a MAX883 regulator. When a momentary action push button first applies power to the circuit, a PICAXE output latches the regulator on. When memory is full the latch is removed and the recorder is powered down (few uA battery drain).

The push button could be retailed for your application but the latch would be removed when an ADC input dropped below a pre-defined level. The ADC would of course measure battery voltage via a potential divider. If interested in the details, you could download a copy of the article from the www.nutsvolt.com.
 

MFB

Senior Member
Sorry about the missing 'S'. But you found the correct page for the August issue. Why can't you access the article?
 

MFB

Senior Member
Dippy,

If you have to use a regulator anyway, then even a couple of transistor and resistors could represent an overhead. The PICAXE would still need to measure battery voltage and remove the latch. Therefore, some battery current would still flow thru the potential divider (on the ADC input) when the circuit was powered-down.

For really low drain it would be better to use the MAX388’s low battery detector circuit, rather than an ADC input, and monitor its output via a PICAXE digital input. This would allow much higher resistor values to be used for the potential divider at the battery detector input.
 

Dippy

Moderator
MFB:
a) You can have the transistor method (though not as shown in that link) on the battery side of the regulator. So no quiescent current from reg. MOSFET method will use microamps on or off. Not much of an overhead really.
b) I've just read MAX883(?) Data Sheet. Input voltage MAX Vin is 11.5V (12V abs max)..I'd be worried.
 

MFB

Senior Member
Dippy,

I probably did not make it clear that the battery drain -when the circuit is powered down- would not all be thru the switching transistors but down the potential divider at the ADC input. Using the high impedance battery monitoring input of the MAX 883, rather than the ADC, would allow the two potential divider resistor values to increase from about 22K to M Ohms. Regarding the input limit of this device, I normally include a series protection diode and have never had a problem with a lead acid battery (but if its part of an automotive system, then definitely worry!).

However, As I don’t get commission from Maxim, I would have no hesitation in recommending higher voltage regulators, with similar shut-down and low battery monitoring features, from other manufacture.
 

Dippy

Moderator
Yes I see.
I was merely giving an option assuming Martinn already had his regulator and didn't want to buy another. Also, depending on your country the MAX may be difficult to get unless scrounging, sorry, sourcing free samples from Maxim .
And I'm not a fan of relays in apps like this.
 

KMoffett

Senior Member
Martin,

I used a 'two transistor" power switch similar to what others have described, with an 08M. The original ran on 4.5 v batteries so there was no need for a regulator. The push button initially powers-up the PICAXE. I added a regulator U2/C2/C3 to drop the your 12v to 5v for the PICAXE, and a voltage divider R4/R5 to set the shut-down voltage for the 08M's 0-5v ADC input. In the program, the first thing to do is set P0 high to latch on the power. Then periodically compare the value on P1 to whatever value you have chosen for the trip-point. If lower than the trip-point value, make P0 low. There is no current drawn from the battery after that. I have not bench tested this modified circuit...but it should work for any PICAXE.

Ken
 

Attachments

Tom2000

Senior Member
Neat circuit, Ken.

Out of curiosity, what's the function of R3? Thanks!

[break]

And for martinn, here's an example of a regulator that has an enable/disable pin. If you can't find one that has both a shutdown and a battery monitor facility, you could use something like this.

You'd turn on the regulator by grounding the enable pin with a momentary pushbutton. You would keep it on with an 08M lead set as an output, sending a low. To turn it off, you'd set the 08M pin as an input.

Good luck,

Tom
 
Last edited:

KMoffett

Senior Member
Tom,
C1 makes sure the 08M stays up long enough to properly end the program. R3 is there to make sure C1 discharges in case of very low quesent current in the PICAXE circuit. These would vary with a particular PICAXE circuit configuration.
Ken
 

andrew_qld

Senior Member
You can buy off the shelf voltage monitors form Texas Instruments and Maxim. Designed for battery powerd stuff they will lower or raise a pin if volts drop too low.
 

Dippy

Moderator
That's good. My circuit was almost identical to Ken's. I had my switch different that's all.
Well, plenty of info to get on with it now.
 

martinn

Member
This is a great forum, thanks for all the suggestions, I am going to play with them all, particularly as I have never played with MOSFETs before.

Martin
 

Dippy

Moderator
Neat... you haven't been searching for 4 months have you Ken ? :)

Seriously though, nice. I noted the 5mA (if I read it correctly), so not suitable for some low power circuits. And low power circuits would (cough, cough) never use such a regulator. But horses for courses and it certainly has apps. It's a good excuse to show off and use an SCR, so I'll add it to my Grimoire.
Cheers.
 

KMoffett

Senior Member
Dippy,

Yup, been searchin' high and low (or 1 & 0, or Vdd & Vss) for months for a better power-off circuit. ;) Actually came across the circuit on Roman's site from a link in a different search. (I Love Google!)

I did a little checking on SCR hold currents and found some sensitive gate ones that, though they have a Maximum Ih of 5mA, had a Typical Ih of only 0.5mA. :) Might make it worth trying for some purposes, as you say.

http://www.onsemi.com/pub_link/Collateral/NCR169D-D.PDF

I like odd little circuits that you don't see every day, but serve the purpose. One I happened across one time and have marvled at (simple pleasures :) ), is a push-on/push-off relay:

http://radiomagonline.com/notebook/radio_pushonpushoff_switch_2/

He doesn't say it but the relay voltage has to be 1/2 the supply voltage. And R1 and R2 resistances are equal to the coil resistance.

Ken
 
Top