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:
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.
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?
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.