Picaxe reboots due to momentary power loss

JPU

Senior Member
Hi all

I have a small circuit powered by a 4.2v battery. The circuit has an 08m2 at its heart. The circuit is very simple and essentially monitors a membrane switch and when depressed it then activates an n channel fet that sinks a puck to power a cree led. It all works perfectly except that the light is used in an environment prone to knocks. The odd knock causes the wire from the battery to move sometimes causing power loss due to movement at the socket. This power loss causes the chip to resent and the cree goes out. The user then has to press the button again, a royal pain in the butt as both hands are involved in the job at hand.

Is there away I can introduce a small cap to smooth out this power loss. Any suggestions as to how would be great. My electronics skills are limited so please speak in layman's tongue.

Many thanks for helping.
 

hippy

Technical Support
Staff member
A capacitor across the circuit power rails might help but a better solution would be in trying to obtain a better physical connection for the supply which isn't so prone to disconnection when knocked or moved.

I don't really understand exactly what you have, and a picture would help there, but you could have the PICAXE remember if the thing is on or off so it can go back to that last state it was in when power is restored after being lost.
 

srnet

Senior Member
Agreed, a capacitor might help, but if as I expect the Cree LED is drawing a significant amount of current, the capacitor would need to be very large indeed.

Although you could get away with a smallish one if you isolated the PICAXE supply and Cree LED supply with a diode.

Far better to cure the problem at source, the dodgy connector.
 

erco

Senior Member
Fix it in software. Every time you toggle the light on, WRITE 1 to an EEPROM memory location, and write 0 to the same location for off. On powerup/reset, READ that EEPROM location and set the light accordingly.

Otherwise add a giant electrolytic to your Picaxe and connect to B+ through a diode so the LED can't drain your cap per srnet.
 

Goeytex

Senior Member
1. Solve the problem at it core cause.
a. Secure the battery with a screw down or
locking mechanism of some kind
b. Use a battery with welded tabs and connectors
c. Glue the battery in place
d. Use your imagination

2. Bandage the problem
a. Large capacitor
b. Cover up the problem with
software as already described

Am I correct in guessing that this is flashight or
"torch" of some kind? (There may not be space for a large cap)

If not then maybe if your reveal the actual application
others can be of more useful and practical help.

Perhaps a photo could also help.
 
Last edited:
Top