Rotary switch 12-pole as rotary encoder

Hello,

I am just wondering if is there any way with andruino to modify and use a standard 12-pole rotarty switch as a rotary encoder? I am planning to build some panel for Flight Simulator and in several cases I would need this solution.
I am looking for something like this:

Thanks

Do you mean you want your 12 way switch to produce a 4-bit binary code

4 bits equate to 16 options so if you could use a 16 way device here is a commercially available product that doesn't require any intelligent processor Lorlin Electronics – Switch Design and Manufacture from Littlehampton

This kind of part, with 1 common and 12 contacts?
http://www.parts-express.com/pe/showdetl.cfm?partnumber=023-660

I could see wiring it up as voltage divider, read the common on an analog input, map each reading to a 1-12 number.

That switch is described as a "non-shortening" one which basically means it is a "break-before-make" (B-B-M) This would result in total loss of value as the switch moves between stations. With 12 positions (and no "dead" positions) there will be 30 degrees of rotation per location. In all probability a B-B-M arrangement will have a 50% contact area so at best you will experience 15 degrees of known location followed by 15 degrees of no signal etc etc. If you want to use a 12-way switch as a rotary encoder I'd suggest a "make-before-break" (M-B-B) would be a better option. This will then give you 30 degrees of known location followed by 30 degrees of the next location etc etc. Because of the M-B-B feature there will be several degrees of "error" until the break has taken place. However as this will be similar for all locations it simply results in an off-set from the indent positions which can be accommodated by mechanical offset.

jackrae:
That switch is described as a "non-shortening" one which basically means it is a "break-before-make" (B-B-M) This would result in total loss of value as the switch moves between stations. With 12 positions (and no "dead" positions) there will be 30 degrees of rotation per location. In all probability a B-B-M arrangement will have a 50% contact area so at best you will experience 15 degrees of known location followed by 15 degrees of no signal etc etc. If you want to use a 12-way switch as a rotary encoder I'd suggest a "make-before-break" (M-B-B) would be a better option. This will then give you 30 degrees of known location followed by 30 degrees of the next location etc etc. Because of the M-B-B feature there will be several degrees of "error" until the break has taken place. However as this will be similar for all locations it simply results in an off-set from the indent positions which can be accommodated by mechanical offset.

Thanks a lot for the info! As I have already app.10pcs of this B-B-M 12 pole switch I try to figure out a solution to use these. Anyhow my arduino board will arrive in a couple of weeks so I can start to play around later on. Now I am looking for the possible solutions.

CrossRoads:
This kind of part, with 1 common and 12 contacts?
http://www.parts-express.com/pe/showdetl.cfm?partnumber=023-660

I could see wiring it up as voltage divider, read the common on an analog input, map each reading to a 1-12 number.

Yes, this is what I have. Sounds good what you suggest, just maybe I should dig a bit more into details how to execute :slight_smile:
As it was mentioned in another reply, the Break before a new contact can cause any issue in the suggested arrangement?

jackrae:
Do you mean you want your 12 way switch to produce a 4-bit binary code

4 bits equate to 16 options so if you could use a 16 way device here is a commercially available product that doesn't require any intelligent processor Lorlin Electronics – Switch Design and Manufacture from Littlehampton

Thanks Jackrae! But as I have already these switches from the past I am looking for a solution to use these.

You might get some interim values - all depends on when you read the value.
If for example you rotate and then press a 'read' button, only the expected values will be read.
If they are break before make, and you have the common pulled via, then the interim value will always be 1023 (5V), so that reading could be excluded as a choice.