Pages: [1]   Go Down
Author Topic: Rotary switch 12-pole as rotary encoder  (Read 929 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1378
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26572
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: August 08, 2012, 11:37:45 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1378
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26572
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: