Go Down

### Topic: Rotary switch 12-pole as rotary encoder (Read 1 time)previous topic - next topic

#### kolenat

##### Aug 08, 2012, 08:36 am
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:
http://www.737ng.co.uk/simple%20encoder.pdf

Thanks

#### jackrae

#1
##### Aug 08, 2012, 12:01 pm
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  http://www.lorlin.co.uk/PDF/BCK.pdf

#2
##### Aug 08, 2012, 06:36 pmLast Edit: Aug 08, 2012, 06:37 pm by CrossRoads Reason: 1
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### jackrae

#3
##### Aug 08, 2012, 07:53 pm
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.

#### kolenat

#4
##### Aug 08, 2012, 08:45 pm

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.

#### kolenat

#5
##### Aug 08, 2012, 08:47 pm

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
As it was mentioned in another reply, the Break before a new contact can cause any issue in the suggested arrangement?

#### kolenat

#6
##### Aug 08, 2012, 08:49 pm

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  http://www.lorlin.co.uk/PDF/BCK.pdf

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

#7
##### Aug 08, 2012, 09:18 pm
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up

Please enter a valid email to subscribe