# Master switch to turn on and off independent lights

i am adding some led lighting to a dolls house where each room can be turned on and off independently but i would like a master switch which turns all lights off(simple) but should turn on all lights even if they were off before. I just can't figure how to get this to work.

Example

• With 2 LEDs in the system.
• When the master switch is turned on all LEDs turn on.
• Led1 is switched off, led2 is kept on. -When the master switch is turned off all LEDs turn off.
• And then when the master switch is turned on all LEDs are turned on.

• Just making sure, you want the master switch to override the state of all the LEDs, where the individual switches then set the state of their own LEDs. This won't really work well with switches. Buttons are better. Mar 13 '17 at 21:48
• Do you have to use switches? Firstly you would need to make the circuit edge triggered, which already requires complicated circuitry. Are buttons an option? Preferably 6 in this case? Mar 13 '17 at 21:56
• It seems pretty clear to me, between the title and the text. He wants a master switch that will turn all lights on or all lights off regardless of the "independent" switches. Mar 13 '17 at 22:18
• Ask 3 engineers get 5 answers lol. Op seems clear to me we just have different interpretations. Mar 13 '17 at 22:21
• @skyfoot, but if turning the master switch on turns on all the lights, how do you want to go back to controlling the lights individually? By just toggling the individual switches? By having three positions in the master: on-off-individual? I think this is something you may want to think through, if only because half the answer have interpreted this in one way, and half in another... Mar 14 '17 at 12:09

You will not be able to do the last step without resetting relays (costly, not easy to find), complex logic circuit (hardware intensive) or a microcontroller. A microcontroller solution with push buttons will be super easy. On/off switches will require slightly more code but pretty easy too.

The microcontroller solution can be cheap, and consist of nothing more than the switches and some resistor + Transistor pairs (and your leds of course). Depending on how many lights you could skip the transistors too. The internal Pull-Ups are enough for the inputs, but external ones can be used too.

simulate this circuit – Schematic created using CircuitLab

Code would be simple:

Boot/Power On{
turn all lights on, set inputs;
Wait for button press{
At button press toggle light;
At master button turn all lights off;
At second master button, go to boot.
}
}


Or skip the master button and use a hard power switch turning the microcontroller off. When turned on it starts at boot. Cuts down on some of the coding.

simulate this circuit

• Using a microcontroller is really the only sane way of doing this.
– pipe
Mar 14 '17 at 11:29
• This is the only way I see I can get what I wont. I'll probably use a cut down Arduino and add a flickering fireplace. Mar 16 '17 at 15:09

Your description is kind of vague, but I understand it to mean that you want a 3-position master switch: "All Off", "All On" and the third state in which all of the LEDs are controlled individually. You'll need some diodes:

simulate this circuit – Schematic created using CircuitLab

• Your three state logic doesn't seem to be what op asked for but it would be an okay alternative. It would mean the switches are useless if left in the third state. Mar 13 '17 at 21:55
• @Passerby: Well, yes. Isn't that the general idea of a "Master" switch -- it overrides the individual controls? Mar 13 '17 at 21:57
• I read the question as a reset switch. Mar 13 '17 at 21:58

Despite I'm using buttons rather than switches, you can achieve this using a 4013 dual D flip-flop with set and reset, where you have a flip-flop per LED configured as a T flip-flop to toggle the LED's state with a single button. But the main point we're using this is for the SET and RESET functions which can turn all LEDs on and off.

Note that I put debouncing circuitry to prevent accidental extra triggering of the clock. The SET and RESET do not need this.

• How expandable is this? Mar 14 '17 at 3:15
• This is nearly perfect. It's how I would have done it if you had not. I would have used a TTL 74 dual D. I would be tempted to use an MC14490 for the debounce. Mar 14 '17 at 3:27
• @Passerby expansion is unlimited. The only drawback is there are no quad or octal flip flops with a preset, so it requires a 14 pin IC for every two switches. The same circuitry could also be done in a small PLD. If the number of switches grew, a PLD would be the way to go. Or a micro. Depends on what the OP knows and what developments tools are at their disposal. And the number of switches. Mar 14 '17 at 3:35

If you're comfortable with each of your individual light switches being SPDT, and you're comfortable having separate master switches (or one center-off DPDT master switch), you can do this without any additional components.

simulate this circuit – Schematic created using CircuitLab

In Figure 1, when the master-on switch is open, then each of the individual switches has one pole on and one pole off. When the master-on switch is closed, then each of the individual switches has both poles "on", effectively overriding the individual switches. Of course, the separate off switch prevents any current flowing, so it overrides everything (including the master-on switch).

Figure 2 uses a single center-off DPDT switch as the master. This works mostly the same way, where having the switch in the "up" position powers both terminals of each switch, "center" isolates ground and prevents all current from flowing, and "down" connects ground and exactly one pole of each individual switch (allowing for normal operation).

• @Bradman175 Not if it's a center-off switch. :) Mar 14 '17 at 0:40
• I'm oblivious. My mistake. (I wish the circuit simulator made it more clear.) Mar 14 '17 at 0:41
• @Bradman175 Me too. It'd help if CircuitLab had a DPTT or explicitly-center-off DPDT switch, though I admit I didn't dig deeply or try to create/customize a part to make the simulation work. Mar 14 '17 at 1:09