I have a car with a rear window that can roll down and up (like side windows). On the car fob, I have an extra button that can control a negative output for the duration of the button pushed (added it in the image as SW1). With two relays I can control the window:

  • RLY1 closed + RLY2 open = is up
  • RLY2 closed + RLY1 open = is down
  • RLY2 closed + RLY1 closed = no movement

So my goal is to alternate the relays when sw1 is pushed. So:

  • SW1 pushed = RLY1 closed, RLY2 open
  • SW1 released = RLY1 closed, RLY2 closed
  • SW1 pushed (second time) = RLY1 open, RLY2 closed
  • SW1 released = RLY1 closed, RLY2 closed
  • start over from the top

If it helps, remembering the previous state for longer period of time is not a big requirement

The circuit below will not work because it will close both relays at the same time, so I am looking for some pointers on what to do between SW1 and the relays. I was scribbling using a transistor and 3 resistors (inspired by: https://www.circuitlab.com/editor/#?id=znxrb4) but I cannot manage to get to a situation where I really alternate between the relays.

Is there anyone that could point me in the right direction here?

current situation

Thank you so much in advance.

  • \$\begingroup\$ Use one NC (normally closed) relay and one NO (normally open) relay. \$\endgroup\$
    – Solar Mike
    Apr 19 at 6:59

1 Answer 1


I believe this circuit would do the trick. The toggling like you want, can be done using a JK flipflop. If you hook up both J and K to 5V, the outputs Q and !Q will toggle everytime on a rising flank on the clock input (I thought it was the rising flank).

That means that every time you push the buttons Q1 and Q2 will both toggle and they are always the inverse of the other. So either Q1 or Q2 is always in a conductive state and they cannot both be conductive at the same moment.

To let the relays work when only the button is pressed I used a 3rd transistor to make a sort of AND-gate. Transistor Q3 only conducts when the button is pressed.

enter image description here

  • \$\begingroup\$ If you use something like a CMOS 4027 flip-flop instead then you wouldn't need an extra 5v supply for the circuit. \$\endgroup\$
    – brhans
    Apr 19 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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