3 switches, 7 lamps (no solid state) - Page 1
Forum section: electronics / projects

author: Cyberdragon
author_rank: Super Contributor
timestamp: February 27, 2019, 05:19:35 pm
content: i'm trying to come up with a system to switch 7 lamps on (indevidually) with 3 spdt switches and relays (just for funsies).I'm trying to figure out the most efficient wat to do it. Getting the light to switch on when all switches are on is easy, when all switches are on, none of the secondary switch contacts have power which shuts of a spdt relay that disconnects the common from most lamps and connects it to the remaining lamp. Each switch is connected to a light through the nc contacts of other relays.What I'm still trying to figure out is the logic that drives the other three lamps.Aslo, the current circuit requires the same voltage for coils and lamps. So I'd have to have a different circuit using dual pole relays for different voltages (IE LV coils and mains bulbs).

author: Nusa
author_rank: Super Contributor
timestamp: February 27, 2019, 05:55:59 pm
content: If by lamps, you mean LED's, check out charlieplexing. 3 pins can control 6 led's, 4 pins can control 12.If you mean something higher wattage/voltage that requires a relay, you won't be able to make do with less than one relay per lamp. Not if they're to be independently controlled.As for input, there are 8 possible combinations of 3 switches. If you eliminate the all-off state, that leaves 7. If your microcontroller monitors the 3 switches and waits long enough (a full second after first switch change maybe) for you to pick your combination, you could specify which lamp to toggle status on. The all-off state could either mean no change, or turn everything off.

author: Cyberdragon
author_rank: Super Contributor
timestamp: February 27, 2019, 07:17:02 pm
content: I should clarify ONLY spdt switches and relays (making this from scrap), for a demonstration of relay logic (no solid state allowed). The lamps can be whatever (maybe not even the same).EDIT: It'll be AC, so polarity reversal is nonexistant.

author: AlfBaz
author_rank: Super Contributor
timestamp: February 27, 2019, 08:20:21 pm
content: Is there a limit to the number of relays you would like to use?If not the easiest way to do it would be each switch turns on 4 spdt relays, 12 in total. Then it's a simple matter of wiring the appropriate switches in series using binary weights assigned to each group of relays

author: Benta
author_rank: Super Contributor
timestamp: February 27, 2019, 08:34:10 pm
content: Nice little exerciseYou'll need 7 spst relays for the lamps, 3 spdt switches and 4 spdt relays for the additional logic.

author: larrybl
author_rank: Regular Contributor
timestamp: February 27, 2019, 08:48:09 pm
content: 000 0ff001 lamp 1010 lamp 2011 lamp 3100 lamp 4101 lamp 5110 lamp 6111 lamp 7Binary says it may ne possible with three switches and 7 relays, How to wire it up

author: ebastler
author_rank: Super Contributor
timestamp: February 27, 2019, 09:14:52 pm
content: Easy. You only need three relays, each with 7 dual-throw contacts.You can even save money on the switches since they only need to be SPST.

author: Benta
author_rank: Super Contributor
timestamp: February 27, 2019, 09:15:29 pm
content: Quote from: larrybl on February 27, 2019, 08:48:09 pmThat is very basic and obvious. But the problems is that both switches and relays are SPDT. With DPDT switches, only the 7 relays would be necessary.To emulate the DPDT switches, 4 extra relays are needed.

author: Benta
author_rank: Super Contributor
timestamp: February 27, 2019, 09:17:45 pm
content: Quote from: ebastler on February 27, 2019, 09:14:52 pmToo much Korn tonight?

author: ebastler
author_rank: Super Contributor
timestamp: February 27, 2019, 09:25:59 pm
content: Quote from: Benta on February 27, 2019, 09:17:45 pmNah, it's only four in the afternoon here; I'm in the US at the moment.(Which also implies a lack of Korn, but some Bourbon might do later today...)But seriously, I don't think the OP specified the type of relay in his rules of the game, so my solution counts.

author: Cyberdragon
author_rank: Super Contributor
timestamp: February 27, 2019, 09:31:35 pm
content: I made a circuit using 7 relays, but that's with the lamps and coils in the same circuits (so either low or mains).Quote from: Benta on February 27, 2019, 08:34:10 pmonly 4 spdt? I tried using only 4 spdt and couldn't figure it out. note DPDT relays allowed)

author: Nusa
author_rank: Super Contributor
timestamp: February 27, 2019, 09:40:46 pm
content: Quote from: Benta on February 27, 2019, 09:15:29 pmStrange, With 7 spdt relays, I can't see any need for more than 3 spst switches. With dpdt switches, you can make do with 4 spdt relays I believe.It's easier to think of this as an 8 light problem, then simply eliminate one light when you're done.

author: ebastler
author_rank: Super Contributor
timestamp: February 27, 2019, 09:47:21 pm
content: Assuming that DPDT relays are allowed, but only SPDT switches:Three switches and three relays should be enough.Switch 1 directly multiplexes the voltage to two channels.Switch 2 controls relay 1 to multiplex those 2 to 4 channels.switch 3 controls relays 2 and 3 to multiplex those 4 to 8 channels.Use six SPDT relays instead if you want to avoid DPDT.

author: Benta
author_rank: Super Contributor
timestamp: February 27, 2019, 09:52:06 pm
content: "DPDT relays allowed"This is not what you originally wrote.In that case, 7 SPST for the lamps, and 2 DPDT relays for logic.Edit: 7 SPST, not SPDT.

author: Nusa
author_rank: Super Contributor
timestamp: February 27, 2019, 10:13:34 pm
content: Quote from: ebastler on February 27, 2019, 09:47:21 pmNow take the next step and use switch 2 directly instead of using a relay. And if you decide to allow switch 3 to be 4pdt, you can eliminate all relays.

author: ebastler
author_rank: Super Contributor
timestamp: February 27, 2019, 10:15:35 pm
content: Quote from: Nusa on February 27, 2019, 10:13:34 pmOf course. But the rules in the original post are pretty clear regarding the switches -- SPDT only.There's room for interpretation regarding the relays.

author: Cyberdragon
author_rank: Super Contributor
timestamp: February 27, 2019, 10:27:28 pm
content: Quote from: Benta on February 27, 2019, 09:52:06 pmYou misread, I said only the switches had to be spdt. I would have specified spdt relays, I just said relays. Though I should specify common relays, so no 7 pole nonesense.EDIT: I don't think relays for each light are needed. Ebastlers circuit has switches 2 and 3 isolated so they could be low voltage while only switch one sees mains, allowing for the use of low voltage relay coils.

author: bsudbrink
author_rank: Frequent Contributor
timestamp: February 28, 2019, 12:09:30 am
content: Sorry for the ugly drawing, I don't have access to a real tool right now...Anyway, is there any reason this wouldn't work:

author: bsudbrink
author_rank: Frequent Contributor
timestamp: February 28, 2019, 12:10:30 am
content: By the way, omit "L0" as required.

author: Benta
author_rank: Super Contributor
timestamp: February 28, 2019, 12:13:34 am
content: On thinking a bit further, this can be reduced to two DPDT relays.

author: ebastler
author_rank: Super Contributor
timestamp: February 28, 2019, 12:27:38 am
content: Quote from: bsudbrink on February 28, 2019, 12:09:30 amClever. But the final stage will give you one brightly lit lamp and several glowing lamps (connected in series).

author: ebastler
author_rank: Super Contributor
timestamp: February 28, 2019, 12:28:49 am
content: Quote from: Benta on February 28, 2019, 12:13:34 amPlus how many switches of which type?

author: bsudbrink
author_rank: Frequent Contributor
timestamp: February 28, 2019, 12:34:39 am
content: Quote from: ebastler on February 28, 2019, 12:27:38 amAh. Shoot, I was thinking LEDs.

author: Benta
author_rank: Super Contributor
timestamp: February 28, 2019, 12:47:10 am
content: Quote from: ebastler on February 28, 2019, 12:28:49 amThree SPDT switches as specified.

author: ebastler
author_rank: Super Contributor
timestamp: February 28, 2019, 01:08:22 am
content: Quote from: Benta on February 28, 2019, 12:47:10 amHmm... I can’t figure out how that would work. Cards on the table, please!

author: Benta
author_rank: Super Contributor
timestamp: February 28, 2019, 01:37:13 pm
content: OK, here goes:First you do a 2:4 demux using two SPDT switches. One switch connected to L, the other to N. Four lamps are connected between the four outputs from the switches in the four combinations possible. Now you can light each bulb independently.In the second stage you add the third switch that controls two DPDT relays between the first two switches and the lamps. Add a second group of four lamps. The relays switch between the two groups of lamps. Now you have a 3:8 demux. Remove one lamp of your choice, and you can control all seven lamps individually, plus turn them all off.

author: mikerj
author_rank: Super Contributor
timestamp: February 28, 2019, 01:37:41 pm
content: Quote from: bsudbrink on February 28, 2019, 12:09:30 amThis suffers from a trap that is very easy to fall into when using relay logic. In any position, one of the eight lamps will be at full brightness, but the lamp it is paired with has a path to ground through the other three pairs of lamps. This means the paired lamp will illuminate but at lower brightness and the rest of the lamps may also glow dimly if there is sufficient current.

author: DDunfield
author_rank: Regular Contributor
timestamp: February 28, 2019, 01:53:19 pm
content: Quote from: Cyberdragon on February 27, 2019, 05:19:35 pmIf SPDT relays, then 5(**) relays - if you can use DPDT then it becomes three.**EDIT - apparently I can't count - It's 6 relays if SPDT - still becomes 3 with DPDT **If S1 cannot be DT then add a relay.If S2 can be DPDT then subtract two relays (or 1 with DPDT relays)If S3 an be 4PDT then subtract 4 relays (or 2 with DPDT relays) - ie: no relays at all assuming S2 is DPDTDave

author: ebastler
author_rank: Super Contributor
timestamp: February 28, 2019, 02:16:01 pm
content: Quote from: Benta on February 28, 2019, 01:37:13 pmMaybe I am misunderstanding, but I think this first stage suffers from the same fallacy as bsudbrink's design: In addition to the desired current path through one lamp, there will be an additional path throughtwothreeother lamps connected in series.I ran out of room on my "DaveCAD" sticky note, hence have not looked at the second stage yet.Edit: Just saw your post pop up and disppear again. Your diagram is the same as what I have on my sticky note, and I guess you did spot the unwanted path after posting.

author: ebastler
author_rank: Super Contributor
timestamp: February 28, 2019, 03:00:30 pm
content: Quote from: DDunfield on February 28, 2019, 01:53:19 pmHmm, your diagram seems to showsixSPDT relays?

author: Benta
author_rank: Super Contributor
timestamp: February 28, 2019, 03:03:02 pm
content: Quote from: ebastler on February 28, 2019, 02:16:01 pmYou're right, I just identified the issue myself.

author: DDunfield
author_rank: Regular Contributor
timestamp: February 28, 2019, 03:09:05 pm
content: Quote from: ebastler on February 28, 2019, 03:00:30 pmSorry, typo - yes 6 relays. If you can use DPDT it still becomes 3.Dave

author: ebastler
author_rank: Super Contributor
timestamp: February 28, 2019, 03:26:35 pm
content: Quote from: Benta on February 28, 2019, 03:03:02 pmYes, those old-fashioned relays, switches and lamps, where current stubbornly flows in both directions, can be buggers to work with!I played with concepts for a relay computer for a while. If you choose "no diodes allowed" as one of your design constraints, you quickly needmanyrelays withmanycontacts, even for simple bit-serial designs. Diodes help!

author: Cyberdragon
author_rank: Super Contributor
timestamp: March 01, 2019, 06:11:05 am
content: I've decided to include the 8th lamp in the final project and just call it lamp 0 (for state 0), just to show that there's always a current path in this arrangement. I also found exactly 3 120V relays in the junk this is to be made from so yay no transformer!The power will come in through a junction box at the bottom splitting it to the three switches (and box grounds). The relays will be mounted on a rail above the three switches with black wires coming in for main power and the coils and the white neutrals returning to the power inlet box. The lamps will all be at the top with their neutrals and grounds daisy chained before returning to the main box. However, depending on wire size, this may exceed the input box capacity so I might have to split the neutrals and grounds to a seperate box (obviously still grounding the main box). Red interconnects between each relay, and black ouputs up from the relays to each lamp.