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?
Thank you so much in advance.