3
\$\begingroup\$

Inspired by the Shutdown Controller for Raspberry Pi in a car I would like to know if it is possible to build a similar circuit working with ~230V AC instead of 12V DC.

I have a power adaptor where I connect my Raspberry Pi to 5V DC and a small audio amplifier to 12V DC. My Idea is to realise a circuit which initiates a graceful shut down of the Raspberry Pi by pressing a switch and which cuts the mains AC to the power adaptor afterwards. The reason: As a matter of principle I don't want the power adaptor to idle around and burn 2-3W while no components are connected. Pressing the switch again should restore power to the adaptor which then re-powers my Raspberry and audio amplifier.

Does this seam realisable also without any backup battery? Which modifications to the above linked answer would I have to make? Would I find appropriate relays? How to deal with the mentioned voltage divider (to 3.3V) on mains?

Other solutions for only the Raspberry Pi:

\$\endgroup\$
  • \$\begingroup\$ Are you happy with using a push-button that uses the 230VAC power? \$\endgroup\$ – Andy aka Jul 20 '13 at 11:09
  • \$\begingroup\$ Nothing is built yet. It can be any other switch/button. I thought of a rotary potentiometer with switch which is supposed to operate max. 250V AC. \$\endgroup\$ – Michi Jul 20 '13 at 13:04
1
\$\begingroup\$

WARNING - THE FOLLOWING CIRCUIT USES 230VAC POWER - TAKE GREAT CARE AND DO NOT ATTEMPT THIS IF YOU ARE A BEGINNER IN ELECTRONICS - IT COULD HURT MORE THAN YOUR PRIDE.

I think that it's worth considering the following idea. Using a triac to switch on and off your power adapter. For a start here is a document that gives the basic background idea and below is the "model" circuit: -

enter image description here

The real detail of the the above circuit is not included here; I've detailed an idea below but first consider what is happening above. There is a dropper resistor and capacitor in series which will always supply power to a zener diode. This is the main limitation of this design - there may be an inherent power draw from your AC supply of about 100mW. This is, of course, a lot less than the 2 or 3 watts your adapter burns when idle. You need to consider if this is OK for you.

The circuit needs to draw some residual power because the circuit needs to apply a continuous 10mA (or thereabouts) to the triac to switch it on and keep it on. I'd make an initial estimate that the dropper resistor and capacitor need to provide about 20mA to the zener.

This sounds a bit like 5W? Well, no because the capacitor will drop most of the voltage and the resistor is there to current limit to protect the zener from current surges. If the capacitor drops 220VAC at 20mA it has an impedance of 11,000 ohms (reactive). At 50Hz this equates to 290nF so maybe with a 220nF, the current taken will be 15mA and is mainly reactive power so doesn't get clocked by your electricity meter. Chances are this will be enough to power the latch and triac. The dropper resistor should be maybe 470 ohms restricting worst-case peak current from 230VAC to about 230 * 1.414 / 470 = 0.7A. It may work with a higher value resistor but I wouldn't go less than 470R and it needs to be adequately voltage rated for up to 250VAC.

The latcher: -

enter image description here

EDIT, I've shown a HC cmos chip but I don't think this will drive enough current to the triac so you'll need to find one that can drive 10mA possible a 74AC14 but please check.

This uses two inverters wired back-to-back to produce a basic latch circuit. The pushbutton when pressed will override whatever the latch output is and the capacitor will provide some debounce - it could be lower (say 10nF) if the switch is low on contact bounce.

REMEMBER, ONLY ATTEMPT THIS CIRCUIT IF YOU ARE CONFIDENT ABOUT WORKING WITH ELECTRONICS CONNECTED TO AC POWER - NOT FOR BEGINNERS.

\$\endgroup\$
  • \$\begingroup\$ Thanks for the detailed explanation! I still have to figure out how to signalise a shutdown-command to my Raspberry Pi (via 3.3V to a GPIO pin). Then, how would I realise a delayed triggering within the latch circuit to switch my power adaptor after the Raspberry's shutdown? \$\endgroup\$ – Michi Jul 24 '13 at 10:04
  • \$\begingroup\$ @Michi these details need a little work for sure \$\endgroup\$ – Andy aka Jul 24 '13 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.