# Combine two DPDT switches to have 6 different outputs

Discussion in 'Power Electronics' started by Gauzz, Jul 14, 2017.

1. ### Gauzz Thread Starter Member

Jan 5, 2011
22
0
Hello maybe you can help me.

I'm trying to do a LM317 regulator with 6 different voltages by changing the R1 resistance values.

I have two toggle switches, they are DPDT, one is ON-OFF-ON and the other one is ON-ON-ON, I'm wondering if I wire them together in series I can have 6 different resistance outputs because the first switch can be in two states and the second one in three, so in theory 2x3=6? I've been trying to wire the switches but I always end up shorting things up.

These are the switches I'm using:

ON-OFF-ON

ON-ON-ON

So maybe you can point me to a schematic or tell me if it's even possible to achieve.

Last edited: Jul 14, 2017
2. ### IMP002017 Member

Jan 28, 2017
187
30
I am not 100% here but I think your issue is going to be with the ON ON ON switch.

3. ### ebeowulf17 Distinguished Member

Aug 12, 2014
2,682
526
You can get 9 different resistance combinations with the following arrangement:

Switch 1 on the left lets you choose:
• R4
• R4 in parallel with R1
• R4 in parallel with R5
Switch 2 on the right lets you choose:
• R2 in parallel with R3
• R2 in parallel with R7
• R6 in parallel with R7
The two switches are in series, so you add up the switch 1 total resistance and the switch 2 total resistance to get your grand total. This was just the first way I thought to draw it up - you could also use a wire instead of either R1 or R5 so that switch 1 is just a wire in one setting. You could also skip R3 and R6 - keeping them there allows you to fine tune the resistances with the switch at either extreme, but doesn't give you more selections, only more control over what the resistance of each selection is.

• ###### two-switches_9-resistances.pdf
File size:
23.8 KB
Views:
8
Tonyr1084 and IMP002017 like this.
4. ### crutschow Expert

Mar 14, 2008
21,416
6,137
It certainly would be a lot easier if you just used a 6-position rotary switch.

Gauzz likes this.
5. ### Gauzz Thread Starter Member

Jan 5, 2011
22
0
Hello again, I kinda gave up on this project because it's just to difficult but I think I'll give it a second try. I have tried a million things but I want to show you the basic circuit I made.

TR is the total resistance I want to have, it's not a real resistor, there is where I put my multimeter to check the resistance.
SW1 is the ON-OFF-ON switch.
SW2 is the ON-ON-ON switch.
There are 4 resistors and one jumper.

I colored the switch pins to make it easier to understand all the switching positions.

Now to explain, when I put SW1 in the first position and SW2 in the three possible positions I have no issues. I get the resistance values I want.

When I put SW1 in the second position and SW2 in the first it's all fine because I can set the value of R4 to my liking, when SW1 is still in the second position and SW2 is on the third (through the jumper) I have no issues because I want the same resistance from R4.

The problem I have is with R3 because I want it to have a different resistance but I can't change the value of R3 because it will affect the value of SW1 when it is set to the first position.

So I was thinking I could instead set SW1 (position 2) in parallel with SW2 in order to have 2 resistors (instead of only R4) in parallel with R2 and R3, that way I can set their values to my liking.

But there is where I fail, I feel the solution is way more complicated than I think.

6. ### ebeowulf17 Distinguished Member

Aug 12, 2014
2,682
526
Well, I agree with @crutschow's comment from a while ago - you could've saved yourself 8 months of heartache and confusion by just using a rotary switch.

Nevertheless, part of me is intrigued by weird math problems, so I'm curious to see if I can find a solution. I have a few questions:
1. Is there a reason you're not using the "off" position of the switch to get more resistance values, like in the diagram I shared earlier? It might open up more possibilities.
2. What 6 resistance values are you trying to achieve?
3. How accurate do you want them to be? And don't say "as accurate as possible." That's not helpful. Is 20% variation acceptable? I'm guessing not. How about 10%, 5, 2.5, 2? It's impossible to get perfect, but we might be able to get within an acceptable margin of error.

Gauzz likes this.
7. ### AnalogKid AAC Fanatic!

Aug 1, 2013
7,579
2,147
Assign 1 ohm to all resistors.
Calculate the 9 possible equivalent resistances.

Now you know the most basic set of possible resistance value ratios. Some may be equal to others, or such a small difference that they are not useful, but you will have a starting point. Next is to alter some resistor values to see how the range of ratios changes. This is the kind of thing Excel was invented for.

ak

Gauzz likes this.
8. ### Gauzz Thread Starter Member

Jan 5, 2011
22
0
I could get a rotary switch for \$1 but then I wouldn't know the answer .

1. I want to use the OFF position of SW1 to turn OFF the whole circuit (now that you mention this, it may be impossible to do it?).
2. The resistance values are (non standard values):

SW1
Position 1. 116 Ohm
Position 2. 333 Ohm

SW2 (with SW1 in the first position)
Position 1. 147 Ohm
Position 2. 45 Ohm
Position 3. 0 Ohm (jumper)

SW2 (with SW1 in the second position)
Position 1. 4667 Ohm
Position 2. 366 Ohm
Position 3. 0 Ohm (jumper)

So the total values are 263, 161, 116, 5000, 699, 333

3. I'm trying to get the tolerance down to 1% but 5% is acceptable.

This it the circuit I'm trying to make. R2 is a 1k pot.

Last edited: Apr 16, 2018
9. ### ebeowulf17 Distinguished Member

Aug 12, 2014
2,682
526
I don't have time to look at the datasheets right now, but I believe I've heard that leaving that position open circuit (aka trying to use the switch off position as off) makes the regulator totally unregulated, passing maximum voltage to the output and maybe doing other bad things.

Not sure - could be remembering that wrong, but I suspect you don't ever want that switch combo open circuit, or "off."

10. ### ebeowulf17 Distinguished Member

Aug 12, 2014
2,682
526
Totally get that! As long as you know there's an easier way, I'm all for working out the puzzle. I love a challenge!

Gauzz likes this.

Mar 10, 2018
2,613
568
Thumb wheel switch a great way of doing this -

Regards, Dana.

12. ### HW-nut Member

May 12, 2016
93
21
5 resistance values with an ‘off’ function is easy enough. From a design perspective, you need to define the required output voltages. A 2 pole rotary switch is a good approach. 1 pole is used for on/off and the other is used to set the output. I like this approach because the switch positions are independent.

Upon further thought, 6 values and an off position is possible.

Last edited: Apr 16, 2018
13. ### crutschow Expert

Mar 14, 2008
21,416
6,137
The best you can do with an LM317 is to connect the Adj pin to ground, which will give a miniumum output of 1.2V.
Leaving it open will give the maximum output voltage.

Feb 20, 2016
2,408
649
Be carefull using a rotary switch as a "normal" one will open the connection between switch positions and as has been mentioned, max o/p volts will appear to the load as you switch. Make before break rotary switches are available, but what is wrong with using a pot? Even a multiturn one if you want fine adjustment.

Gauzz likes this.
15. ### ebeowulf17 Distinguished Member

Aug 12, 2014
2,682
526
That's a good observation, but I have to assume you'd never switch this thing with the load connected anyway, right? Maybe I'm just paranoid, but I wouldn't make sudden step changes in supply voltage with the circuit live and the load connected, even with the make before break scenario. I'd turn off the power and/or disconnect the load before switching settings.

Gauzz likes this.

Feb 20, 2016
2,408
649
I often tweak the supply volts on load to test things, so for me this voltage switching would not work.

ebeowulf17 likes this.
17. ### Gauzz Thread Starter Member

Jan 5, 2011
22
0
OK thanks for all the help, I think that I'll go with a ON-OFF switch and the ON-ON-ON or maybe even just a potentiometer in R2, good catch about the open circuit in R1 but I'm not too concerned about using a toggle switch on R1, I tested and the voltage doesn't go to the maximum (only to the R2 limited maximum). If I open the circuit in R2 the voltage goes to the maximum.

18. ### Tonyr1084 Distinguished Member

Sep 24, 2015
2,949
679
Even a toggle switch has a moment of "No Connection". When you switch between values there is a brief period of time when the contacts leave one position, travel through open air and then make the new contact.

And how many times do you actually shut down a power source when switching between voltages? Me? I'm prone to throwing the switch without thinking of powering down first. Guess that's why I leak smoke from time to time.

19. ### Gauzz Thread Starter Member

Jan 5, 2011
22
0
Yeah, it's just a fraction of a second and with R1 the voltage spike isn't that high, maybe a capacitor can help a bit.