Push For On, Hold For Off, AC Edition

A common theme in modern consumer electronics is having a power button that can be tapped to turn the device on, but needs to be held down when it’s time to shut it off. [R. Jayapal] had noticed a circuit design for this setup when using DC and decided to create a version that could handle AC-powered loads.

The circuit relies on a classic optoisolated triac to switch the AC line, although [R. Jayapal] notes that a relay would also work. The switch circuit consists of two transistors, a comparator, a flip flop and a monostable. As you might expect, the button triggers the flip flops to turn the triac on. However, if you hold the switch for more than a few seconds, a capacitor charges and causes the comparator to trip the output flip flop.

The DC circuit that inspired this one is naturally a bit simpler, although we might have been tempted to simply use the output of that circuit to drive a relay or triac. On the other hand, the circuit is set up to allow you to adjust the time delay easily.

Given the collection of parts, though, we wonder if you couldn’t press some 555s into service for this to further reduce the part count. If relays are too old-fashioned for you, you can always use a solid-state relay or make your own.

17 thoughts on “Push For On, Hold For Off, AC Edition

    1. Meh depends on your tastes, myself I like soldering more than typing… Difficult to believe with my constant bloviating, I know.

      And it would still require something hooked up to the MC that could handle mains AC

    2. i used one with a few extra parts to turn the thing on, control the device with some extra presses and a long press to turn it of. basically i used one pin from the mcu as a hold signal for the power chip, so as soon as the mcu was booted, it took over from the button to hold the ebable pin high. the mcu monitored the button. short presses used for actuons, long press to disable the hold pin.
      switching dc or ac is irrelevant as that is just what you hook up to the digitally controlled pin used for the occasion

  1. Or, one could use a SPDT switch for rock off, rock on functionality. The latch circuit is simpler, and you avoid the annoying ambiguity of not knowing whether your device is booting or shutting down.

  2. I think I want a triac AND a relay. That way if the triac gets stuck off the relay will do the job. And if the triac does work, there will be almost no current going through the relay, so there shouldn’t be any nasty EMF or arcs.
    Of course my design choice make it more complicated, more expensive, and more likely to fail.

  3. Intrigued to hear nobody dincussing inverting the sense of the switch!

    Most mains-powered stuff in my world (that doesn’t already have significant computing power) is tools that can injure if they go wrong (washing machite, heater, etc). If anything should have a “are you really sure?” time delay on it, I vote for ‘turning the device on’ to be delayed!

  4. I recently designed something for my Ender:

    It uses a mains rated DPST button that directly powers a 5V supply.
    A Pico (cheap, implements other things, too) then powers a relay, that latches the mains to the pushbutton.
    The second pole of the pushbutton goes to a nice mains rated optocoupler that needs only two resistors on the mains side, to detect button presses to switch off the supply.

    The only downside is, that, for a ACPI like long press force power off, you’d have to think about a way to signal the user to stop pressing the button.

    The Pico also drives a little OLED for low level information about the other pico functions like temperature monitoring, fan control, 24V Printer Supply control etc.

    I like the possibility to automatically switch off everything to stop wasting energy in standby…

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.