Push-wheel switches are somewhat older technology, but [John Boxall] from the Little Bird Electronics blog shows us that they are still quite useful today.
In a quick but thorough demonstration, he discusses how this input technology works, showing off both single digit and multi digit inputs. The former is pretty straightforward, with each of the counter’s outputs tied to an I/O pin on his Arduino. Using multiple counter units is ever so slightly more complicated, but the job is made easier through the use of an NXP 74HC4066 bilateral switch. He shares a snippet of Arduino code that toggles through each of the switches, reading in their values one by one.
His walkthrough is a must-see for those who are just getting their feet wet with Arduinos and various input methods. These counters are great for 1-4 digit input needs, but if you require more digits [John] says that a 12-digit keypad would probably be a better way to go.
Stick around to see a short video demo of the switches doing their thing.
[youtube=http://www.youtube.com/watch?v=UMJ_HtExnzU&w=470]
Wouldn’t it be easier to skip the 74HC4066 and attach the commons to floating pins, bringing them high when each digit needs to be read?
I guess Birds on the Wire blog is the same as http://tronixstuff.wordpress.com?
http://tronixstuff.wordpress.com/2011/08/15/tutorial-arduino-and-push-wheel-switches/
George – I post my articles on LBE’s blog as well.
@tronixstuff
Ah! Well awesome stuff!
This is kind of a rough article for someone new to the game. His code could use some more thorough documentation, especially as regards his communication with the 7 segment shield he’s using. Someone new to programming won’t make much sense of his function related to that.
There is a link in the article to an SAA1064 tutorial which thoroughly explains how to use it.
http://bit.ly/p2XkIh
I still think it’d be worth a few lines in the article to discuss what’s happening in the code.
I’m curious Mike, why the plug for NXP in your summary? Could we use a Motorola 74HC4066 or a Texas Instruments 74HC4066, etc, etc?
No reason, just listing off a part in the same manner he did. As you mentioned, any 74HC4066 should suffice.
Don’t worry, we’re not in collusion with NXP, Adafruit, Arduino, or any other number of tinfoil-hat induced theories :)
These would be a really neat idea for a pseudo-retro homebrew ham radio. Instead of an lcd readout, use a set of these with the outputs rigged to a uC running a DDS or some sort of PLL.
Probably best used for FM equipment actually. Probably wouldn’t work great with a hugeass VFO wheel most are used to using.
aren’t these commonly called BCD switches? (binary coded decimal) Or is some other version of thumbwheel switches?
That’s one of the common formats.
I used to use these a lot many years ago. In one particular design, I used a pair of them to input a bin location number to comparator. The comparator compared the input on the wheels to an index code on a rotating shelf.
The comparator output told the motor which way to turn to reach the desired place on the shelf in the shortest time, and then to stop when when the code on the index matched the code set on the wheels. An all hardware implementation that worked great for the application.
I see a problem with using several digits of this as specified. Specifically that numbers with more than one closed bit are just begging for problems. For example, if you have 2 digits and set one to 7 and the other to 9, you’ll have all 4 bits shorted together and read both digits as F, which isn’t even a legit BCD digit.
This problem is soluble in the same way it is solved with scanned keyboard matrices. Add diodes in series with the digit lines of each BCD switch. That way, the switch closures in one digit don’t interfere with the others.
The examples in the article (4994, 6966, and 8421) conveniently avoid this problem. Any instances of 3, 5, 6, 7, or 9 are asking for trouble, and will reap it if any of the other digits are one of those and share any of the on bits.
The first thing I thought of when I saw this article was CPE 1704 TKS. Are there really alpha versions of these wheels? If so, I know what I must build.
@chango: The sad thing, was that I knew exactly what that reference was by just looking at the string.
War Games FTW!
Part two of this article concerning multiple switches has now been published – see http://wp.me/pQmjR-1RW