Combine two DPDT switches to have 6 different outputs

Thread Starter

Gauzz

Joined Jan 5, 2011
23
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
Switches2_Diag_2.gif

ON-ON-ON
Switches2_Diag_4.png

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

ebeowulf17

Joined Aug 12, 2014
3,307
You can get 9 different resistance combinations with the following arrangement:
two-switches_9-resistances.png
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.
 

Attachments

Thread Starter

Gauzz

Joined Jan 5, 2011
23
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.

Notes page2.png
 

ebeowulf17

Joined Aug 12, 2014
3,307
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.
 

AnalogKid

Joined Aug 1, 2013
11,043
Start with the *excellent* drawing in post #3.
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
 

Thread Starter

Gauzz

Joined Jan 5, 2011
23
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.
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.
reg3.gif
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
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.
View attachment 150643
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."
 

HW-nut

Joined May 12, 2016
97
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:

dendad

Joined Feb 20, 2016
4,476
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.
 

ebeowulf17

Joined Aug 12, 2014
3,307
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.
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.
 

dendad

Joined Feb 20, 2016
4,476
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.
I often tweak the supply volts on load to test things, so for me this voltage switching would not work.
 

Thread Starter

Gauzz

Joined Jan 5, 2011
23
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.
 

Tonyr1084

Joined Sep 24, 2015
7,899
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.
 

Thread Starter

Gauzz

Joined Jan 5, 2011
23
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.
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.
 
Top