Toggle ON / OFF Switch

Michail Papadimitriou        
Project tested


This project describes how to build a “soft touch” switch. By “soft touch” we mean that you have to push once to set device ON and push again to set device OFF. This kind of switch works by latching a relay to ON state with push of a button and with another push latch is released. It is working like flip-flop states. In that way you can control power to a device using one push button.

The circuit is build around a 555 timer configured in a way that let it latch on one state and an action is required to change state. The  circuit is powered from +5V and there are connectors to connect controlling device. Inspiration from this project and circuit is found here: . We added a relay on output, an indicator led as well as connectors for power, external push button and relay contacts.



Schematic for this circuit can be seen above. The circuit toggles a relay when button S1 is pressed. Operation of this circuit is simple. Pins 6 and 2 of 555 timer are at half power voltage. When output pin 3 is high then capacitor C1 is charged and when it’s low capacitor is discharged. When button is pressed capacitor voltage appears on pin 6 and 2 and output pin 3 changes state as well as capacitor voltage changes. So when output is high capacitor has +5V. When we press the button pin 3 goes low and capacitor goes 0V, when we press button again output goes high again, so we have toggle functionality. When output is high transistor T1 is conducting current and relay is latched, when low relay is released. Diode D1 is used to protect transistor from back voltage generated when relay goes off.

A disadvantage of this circuit is that when we connect power to the circuit relay is engaged. A solution to this can be found on the second reference website below.



Circuit is in OFF state


Push button is pressed and circuit goes to ON state. Relay switch on a high power LED



27 Response on “Toggle ON / OFF Switch

  1. I need two relays output with a momentary output (1 second or less) instead of constant output, each (swaping, one relay momentarily on, the other off, vice versa) . This is to replace mechanical switch of car power door lock with one push-on button. Can you modify the circuit? Thanks.

    1. The easiest way is to build a 12V to 5V power supply using LM7805 and power the circuit. Otherwise you can try to double the resistor values to the closest available value.

  2. Hi guys and Gals, i am new to electronics (about a month and a half) and have a MILLION questions….., however i am only posting my first problem today !

    i have built an inductor based voltage booster with a primary coil of an old transformer, 2 capacitors and a switch (and it works, it actually takes the voltage up very nicely when the button is pushed !!)

    So having been so infinitely successful with this major achievement (hihihihihi) here is my problem…………..

    1) as soon as the voltage appears it disappears ……………………(want to be able to preset the voltage and once achieved, keep it there and stable)
    2) i am using a push button switch. (to “up” the voltage)………….(want the circuit to do the switching, i heard about the 555 and a mosfet)
    3) even with high voltage (around 50), it wont turn a relatively small motor….(circuit must produce enough amps or miliamps to run the motor at full load)
    4) system must be adjustable, varying from 12vdc (with its given miliamp) to around 20vdc (with its given miliamp) (or alternatively adjustable in a 10 – 15volt range either up or down, with a max input volt of 24vdc)

    To put you all in the loop !!, i have a small solar panel (20vdc around 11 watt) and want to use this to power a small electric motor !, currently the battery (12vdc) powers it perfectly, but the solar panel(20v) just doesn’t have the juice (even though the voltage is higher)……………… i would also like to add “soft touch” feature

    as simple as it can be (regards to explanation and schematics) i would appreciate any help !

    much appreciated

  3. hi..just wonder if i can use this as ‘switch’ when i combine it with relay card circuit (which turn the switch ON when got pulse)..

    1. You can connect an external relay to this project that will be activated from another circuit. But i am not sure i fully understand your question, please explain your requirements.

      1. my idea is to make self latch operated switch that can be to use as ON and OFF (combine it as alarm circuit to switch on 12v siren)..

        i’m using relay card circuit to trigger pulse from walkie talkie..and my problem is how to make it remaining ON until manually cut off (trigger again) i got this (maybe) as my best solution if i’m combine both circuit…

        any idea.?

        1. This circuit works by triggering the input using S1. On the first trigger the relay will be activated and will stay ON. On the second trigger the relay will go OFF and this is a stable state also. I think this will be suitable for your project.

        2. I use a motion out side light one side I use a screw on plug the end of the cord plugs into a 12 volt charger two leads too the 12volt alarm at night if a bear comes near motion light comes on and the bell rings too how long you set it you set at the motion light

  4. Great !
    I wondering if this could be modified so you could set a timer and once that timer runs out an alarm went off.


  5. I have 2 12v outlets in my mustang I need to rig a couple of switches to. Instead of drilling holes for big bulky switches I decided I could get a used hazard light switch module that snaps right into the blank space in my dash. But the hazard switch turned out to be a soft switch underneath. Can I use this with your plan and have the relay switching my 12v aux outlet?

  6. Actually I wanna use this for making automatic irrigation system….
    But I’m unable to set threshold voltage
    Can u pls help me where I use variable resistor and what is d value of that pot……..

Leave a Reply

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