2
\$\begingroup\$

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.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Bradman175 Mar 13 '17 at 21:48
  • \$\begingroup\$ 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? \$\endgroup\$ – Bradman175 Mar 13 '17 at 21:56
  • 3
    \$\begingroup\$ 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. \$\endgroup\$ – Trevor_G Mar 13 '17 at 22:18
  • \$\begingroup\$ Ask 3 engineers get 5 answers lol. Op seems clear to me we just have different interpretations. \$\endgroup\$ – Passerby Mar 13 '17 at 22:21
  • 1
    \$\begingroup\$ @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... \$\endgroup\$ – ilkkachu Mar 14 '17 at 12:09
6
\$\begingroup\$

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.

schematic

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.

schematic

simulate this circuit

\$\endgroup\$
  • 3
    \$\begingroup\$ Using a microcontroller is really the only sane way of doing this. \$\endgroup\$ – pipe Mar 14 '17 at 11:29
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – skyfoot Mar 16 '17 at 15:09
6
\$\begingroup\$

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:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Passerby Mar 13 '17 at 21:55
  • 1
    \$\begingroup\$ @Passerby: Well, yes. Isn't that the general idea of a "Master" switch -- it overrides the individual controls? \$\endgroup\$ – Dave Tweed Mar 13 '17 at 21:57
  • 3
    \$\begingroup\$ I read the question as a reset switch. \$\endgroup\$ – Passerby Mar 13 '17 at 21:58
4
\$\begingroup\$

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.

enter image description here

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

\$\endgroup\$
  • \$\begingroup\$ How expandable is this? \$\endgroup\$ – Passerby Mar 14 '17 at 3:15
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – Misunderstood Mar 14 '17 at 3:27
  • 2
    \$\begingroup\$ @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. \$\endgroup\$ – Misunderstood Mar 14 '17 at 3:35
4
\$\begingroup\$

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.

schematic

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).

\$\endgroup\$
  • \$\begingroup\$ @Bradman175 Not if it's a center-off switch. :) \$\endgroup\$ – Jeff Bowman Mar 14 '17 at 0:40
  • \$\begingroup\$ I'm oblivious. My mistake. (I wish the circuit simulator made it more clear.) \$\endgroup\$ – Bradman175 Mar 14 '17 at 0:41
  • \$\begingroup\$ @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. \$\endgroup\$ – Jeff Bowman Mar 14 '17 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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