Option A — simplest, if you have a DPDT latching (bistable) relay or you can use a push-on/push-off (maintained) pushbutton
- This is the cleanest: a maintained pushbutton toggles the relay state or a bistable (flip) DPDT relay changes contacts each push. Only one relay and one pushbutton required.
ASCII wiring diagram (12 V coil example — adapt voltages as needed):
+V -----(push-on/push-off)------+---- Coil + (of DPDT latching relay)
|
Coil
|
GND -----------------------------+---- Coil -
DPDT contacts (common = C, normally closed = NC, normally open = NO)
Pole A Pole B
C1 -----* *----- NO1 C2 -----* *----- NO2
\ / \ /
NC1 NC2
Wire the two poles to the lights so:
C1 -> +V (or supply hot)
NO1 -> Light1 -> GND
NO2 -> Light2 -> GND
When relay is in position A (one coil state) NO1 closes → Light1 on.
When relay toggled to position B (other state) NO1 opens and NO2 closes → Light2 on.
Step wiring:
- Use a DPDT latching relay whose two contact poles swap between Light1 and Light2 when the relay is toggled.
- Feed the lamp common from the relay poles as above.
- Use a push-on / push-off switch to energize the relay coil (or use the relay’s coil polarity reverse toggle if it’s a polarity-sensitive latching type).
Why this is easiest: the relay
remembers the state mechanically — no electronics or extra relays needed.
Option B — if you only have momentary relays (non-latching) and one momentary pushbutton
Use a tiny CMOS flip-flop (CD4013 dual D-flip flop) or a small microcontroller to convert the momentary button presses into a toggling output that drives two DPDT relays (or two coils of one DPDT relay if you have a latching coil driver). This is slightly more parts but robust and common in hobby builds.
Block diagram + wiring summary:
- Pushbutton (momentary) -> debounce circuit -> clock input of a D flip-flop (CD4013).
- Configure the D-FF as a toggle: tie D = /Q (inverted Q) so each clock pulse toggles Q.
- Q drives Relay K1 coil (via driver transistor). /Q drives Relay K2 coil (via driver transistor).
- Use the relays’ DPDT contacts to feed Light1 when K1 is active, and Light2 when K2 is active. If you prefer only one relay physically, use a DPDT relay driven by one coil for Light1 and the other pole for Light2, but two small relays is simplest.
Schematic (logic + relay drivers in text):
PB ---||---(R,C debounce)---CLK of CD4013
Vcc -> CD4013
CD4013: connect D = !Q
So each CLK pulse toggles Q.
Q ----> transistor driver ----> Relay K1 coil -> GND
/Q ---> transistor driver ----> Relay K2 coil -> GND
Use relay contacts:
K1.NO -> Light1 -> GND
K2.NO -> Light2 -> GND
(Or wire commons to supply as appropriate)
Parts:
- CD4013 (or CD74xx equivalent)
- 2 small DPDT relays (coil voltage matching supply)
- 2 NPN transistors (e.g. 2N2222) or small MOSFETs, base resistors, flyback diodes across each coil
- debounce: RC or small Schmitt debounce (recommended)
Why this works: the flip-flop counts (toggles) on each push; Q = 1 -> Light1, Q = 0 -> Light2. Using DPDT relays keeps mains isolation for the lights.
Which to pick?
- If you have a latching (bistable) DPDT relay or can use a push-on/push-off switch, use Option A. It’s the simplest wiring and uses only the relay and the switch.
- If you only have momentary relays and want the pushbutton to be momentary, use Option B (CD4013 + drivers). It’s cheap, reliable, and gives exactly the press-once/press-again behavior.
Quick wiring checklist (practical)
- Decide coil voltage (12 V, 24 V, 5 V) and use relays and transistor drivers matching that.
- Add diodes across relay coils (flyback diodes) if driving from DC.
- Put a debounce (RC or small IC) on the pushbutton for reliable counting.
- If lights are mains voltage, only switch the mains with the relay contacts — keep coil and logic isolated and powered separately.