Switch Arduino ON, it does tasks, then Switches self OFF


Please see attached schematic.

I wanted to make a circuit that detects an intruder using a pressure mat (which I guess is really just a big switch you can stand on). The mat triggers a thyristor which powers the Arduino. When the Arduino has finished it’s tasks of sounding alarms etc… the last task it does is make a pin go from LOW to HIGH connected to a transistor which triggers a relay. The relay switches to expose the input of the thyristor to low current (ie below the holding level) and the Arduino switches off.

I made the circuit on breadboard and it worked when I just grounded the thyristor input using a reed relay but the current was too high and it blew the relay.

I would welcome some feedback on the new circuit using the SPDT relay but I’m not sure if there are better ways or I may blow further components etc… The zener diode is there to limit the voltage on the thyristor gate, which along with the resistor R2 is to limit power to the gate. I tried it on a simulator and it works in theory.

Many Thanks

I don't have any comments on your schematic, but have you considered just using sleep mode for your atmega rather than hard powering it up and down? I've seen people claim years of runtime potential out of a AA pack, so you shouldn't have any problems with a large lead acid battery. Then all your circuit would need is a weak pull up on your interrupt pin and your floor switch.

Looks like it might work, but overkill. You don’t need the zener or the 4k7 resistor, the 10k resistor in series with the gate provides all the voltage/current limiting you need. Also I can’t see the point of R3.

If you use a transistor or MOSFET to do the switching instead of a thyristor, you won’t need a relay to switch it off. How about this (see diagram). Pressing the button sets the flip-flop and provides power to the Arduino via the transistor. When the Arduino writes a 1 to the digital output, this resets the flipflop and turns off power to the Arduino provided the button is not pressed. The power consumption of the 4001 in the off state is tiny provided you connect the 4 unused inputs to gnd.

The 4k7 resistor in my circuit assumes that your total load is 100mA or less and you are using a BC327 transistor. If the load is higher you will need a smaller resistor and perhaps a PNP power transistor - you can choose the resistor to limit the transistor collector current to a safe value when the transistor switches on and the capacitors in the Arduino charge.

Hi Guys,

thanks for the suggestions.

have you considered just using sleep mode

I’ll use low-power mode to save juice for the Arduino, but I will still need to switch other power hungry stuff such as lights, klaxons, maybe even video recorder etc…

I’ve dropped the zener and superfluous resistors and all works fine.

I couldn’t get the flip-flop circuit working in the simulator - I might be missing something though. Your suggestion pointed me to google gates and latches etc… I got a NAND D-type latch working in simulator (plse see schematic attached) http://en.wikipedia.org/wiki/Flip-flop_(electronics)#SR_NOR_latch.

Just got flip-flop working with minor ajustments!

I realised I was using a NPN instead of PNP tranny. The original uses PNP.

See attached. I swapped the Arduino PIN to hit the 1st input on NOR gate U1A and the Sensor switch to hit 1st pin on U1B (these are other way round on original).


Glad you got it working. My design used a PNP transistor (BC327, emitter connected to battery, collector to Arduino). Yours uses NPN (collector to battery, emitter to Arduino). That's why you had to swap the inputs. Mine drops about 0.1 volts across the transistor, yours about 0.7v or a bit more, so mine will work down to a lower battery voltage - but that probably doesn't matter.

If the power-hungry devices are switched using n-channel mosfets or npn transistors, you may not need to switch the supply to them, because when the Arduino is powered down the transistors/mosfets will be turned off anyway.

Many Thanks for that.

I just modified my post before I saw your latest post, 'cos I realised my silly mistake of mixing up tranny types. :blush:

It's a steep learning curve! Phew.

I'll go ahead and use the Flip-Flop approach now, but just out of interest, when would you use a thyristor of this low power type?


I just realised a problem with that circuit (both my original and your version). You're running the flip flop from a 12v battery, so the 5v output from the Arduino digital pin is unlikely to be enough to switch it over. I suggest you use an NPN transistor and 2 resistors to amplify the 0v->5v output into a 12v->0v output. Then use one of the spare gates in the 4001 to invert that, giving you a negative going signal to feed into the flip flop. Or replace the 4001 by a 4011 so that you have a flip flop triggered by negative signals instead of positive ones.

The problem with thyristors is that you need to reduce the current through them to near zero to turn them off. The best uses of a thyristor I can think of are with an AC supply, or in a capacitor discharge circuit, or as the crowbar in an over-voltage detector (the crowbar shorts the output of the power supply - the intention is to blow the fuse).