Keeping Picaxe alive with a transistor (or something else?)

simmisj

Senior Member
Hi.
I have an application where I am using a Picaxe that spends most of its time off (battery disconnected). Once a day it is awoken by a button press that connects the battery to the Picaxe. This button can be pressed down from anywhere between 5 seconds and 10 minutes. While the button is pressed the Picaxe sends some data wireless to another Picaxe.

When the button is released I would like the Picaxe to be able to stay awake long enough so I can detect that the button has been released and send data to the receiver telling it that the button has been released. This time has to be something like 1 or 2 seconds.

I tried connecting a transistor between the Picaxe and 5 volts. Then when the button is pressed it powers up the Picaxe and puts a pin high that is connected to the base of the transistor hoping that the transistor would power the Picaxe after the button has been released but that did not work. Maybe I did it wrongly.

I do NOT want to use a relay. They are too bulky for my application.

Any help appreciated.

Cheers!
Simmi
 

premelec

Senior Member
A PMOS transistor with a capacitor in it's gate to keep it alive longer than the gate capacitance - and a large resistor to make sure finally does go off -to discharge the capacitor - PMOS from V+ to PICAXE [drain to PICAXE source to V+] and switch from PMOS gate to V- [R & C from V+ to gate]. Use a logic level PMOS...
 
Last edited:

Dippy

Moderator
I don't think anyone has got that to work. You need another stage for full control.

The easiest method is 2 transistors (MOSFETs will offer much lower current) or using one of the regulator chips with enable.
The advantage of the 2-tran method is that, where applicable, it can be put before a regulator when, for example, using a PP3 battery supply.
I still have my PICAXE 18X (yes, 18X with backlit LCD) circuit in it's box with the same Duracell PP3 that I put in it 5 years ago. I just tried it and it still works.
2-MOSFET with PICAXE pin forming the latch. Button 2 switches off or it switches itself off (via code).

The circuit (and variations) is well dcoumented and mentioned on this Forum at least 10 times - but I can't find it. ECLECTIC!!!!
 

simmisj

Senior Member
As always a fast response :)

Thanks Dippy and eclectic, I took a quick look at that guide before I need to go to bed. Is it tip number 11 in chapter 1 that you are talking about? If so, I hope there is another way since it uses the sleep function to turn off but a big part of my "low current consumption" software strategy is to keep the Picaxe sleeping for most of the time.

Srnet, I will draw up a schematic tomorrow and post it.
premelec, have you tested this method? If so, could you provide a schematic?
 

Bill.b

Senior Member
How long do you require power to be on after the button is released?

In a circuit for the majic switchboard were the operator removes the batteries and the lights remain operating for upto 15 mins,
I used a super capacitor ( 0.47 - 1F) to supply the picaxe after the batteries were removed.


Bill
 

simmisj

Senior Member
Bill.b, I require the power to be on for something like 1 second. Enough for the wireless module to send a series of messages. The system draws something like 10mA at 5V when sending messages. Do you think a physically small super capacitor could manage to supply it with power for 1 second? Any formulas to prove/disprove?

tony_g, thanks for that link. The circuit in post number 2 looks promising and he also confirms that it works. I will try that circuit and if it works then my problem is solved.

Thanks everyone.
 

Hemi345

Senior Member
Bill.b, I require the power to be on for something like 1 second. Enough for the wireless module to send a series of messages. The system draws something like 10mA at 5V when sending messages. Do you think a physically small super capacitor could manage to supply it with power for 1 second? Any formulas to prove/disprove?
Sure, no problem with a supercap. At 10mA, you could probably run for 8-10 minutes on a 2.5F supercap depending on the minimum voltage your circuit requires. Since the PICAXE itself (well, I guess it depends on which model you're using) can run happily on as little as 1.9V, then it's dependent on the rest of your components. Check this thread out, starting with post #3:
http://www.picaxeforum.co.uk/showthread.php?25365-adding-rechargable-battery-backup-to-picaxe-circuit&highlight=supercap

Also, Maxim has a good online calculator for figuring out run time using supercaps: http://www.maximintegrated.com/design/tools/calculators/product-design/supercap.cfm
 

Goeytex

Senior Member
Here is a very simple way of doing what you want. No transistors or supercaps needed.

Delay OFF.png

Assuming a battery supply with no regulator:

1. Switch Pressed.
A. Picaxe gets continuous power.
B. Capacitor C2 charges to +V
C. Picaxe operates normally
2. Switch is released.
A. Power is supplied to Picaxe by Capacitor C2.
B. When high level at C.3 is removed, R3 Pulls C.3 Low
1. Low on C.0 tells Picaxe to immediately send a byte of data
2. Capacitor C2 begins discharging
3. Data byte sent.​
3. Picaxe turns off when voltage gets too low

This is not a theoretical circuit. I built it on a breadboard and it works perfectly. A 220uF cap will easily keep the Picaxe alive and supply
enough current to send "Goodbye World" (13 bytes of data).
 
Last edited:

Hemi345

Senior Member
Here is a very simple way of doing what you want. No transistors or supercaps needed.

View attachment 16148

Assuming a battery supply with no regulator:

1. Switch Pressed.
A. Picaxe gets continuous power.
B. Capacitor C2 charges to +V
C. Picaxe operates normally
2. Switch is released.
A. Power is supplied to Picaxe by Capacitor C2.
B. When high level at C.0 is removed, R3 Pulls C.0 Low
1. Low on C.0 tells Picaxe to immediately send a byte of data
2. C.2 begins discharging
3. Data byte sent.​
3. Picaxe turns off when voltage gets too low

This is not a theoretical circuit. I built it on a breadboard and it works perfectly. A 220uF cap will easily keep the Picaxe alive and supply
enough current to send "Goodbye World" (13 bytes of data).
Your text doesn't quite match your schematic, but i get the gist.

He can probably size up the cap in your suggestion to power his circuit since he states his circuit consumes something like 10mA and he needs "enough for a wireless module to send a series of messages".
 
Top