Thumbwheel switches have detent buttons (technically called a "pushwheel") or a wheel that you can push to change a number up or down by one. Inside they have switch logic that encodes the number on the dial as, typically, octal, hex, BCD (Binary Coded Decimal) . This encoding is then sourced to or sank from the external pads where it can be read and displayed (as with LED's), decoded with IC's (e.g. 4029,74HC93,and 74HC590), or hooked into input pins of a microcontroller and further processed.
My favorite local electronics shop had a bin full of ones that looked like old SCSI device ID switches so I grabbed a few to see how they worked. The numbers go from 0 to 15 so I think this would traditionally be called a hex switch, but I'll be referring to them as binary because of the output we're working with. Don't confuse binary with BCD; they are not the same thing. Ok, let's go!
Remove these ads by
Signing UpStep 1Parts List
You Probably Need These
- A binary pushwheel or thumbwheel switch. These can be had at the major electronics outlets online, or if you're in Colorado, check out J.B. Saunders in Boulder. They have them on the cheap!
- A solderless breadboard
- A soldering iron, solder, hookup wire (I used 24 gauge stranded because it's very bendable)
- An AVR microcontroller
- I'm using an ATmega328p sitting in a Bare Bones Board from Modern Device
- I'm using the USB BUB to program the AVR
Optional
- Four LED's (for illustration of the encoding)
- Four resisters (for the LED's. I used 200 Ohm that I had already on my bench (I'm lazy2))
- Four diodes if you're paranoid about running reverse polarity into the pins of your MCU
Something to write or compile your firmware
- I use AVR Studio 4.16 SP1 but you can also use:
Windows
- WinAVR for Windows AVR development
FreeBSD / Linux (other *NIX variant)
pkg_add -r avr-gcc -or- cd /usr/ports/devel/avr-gcc/ && make install clean pkg_add -r avr-libc pkg_add -r avr-gdb
- For Linux, you'll be installing the same thing but using your particular package management utility.
Mac
- I have no experience here, so I'd suggest Ladyada's tutorial for this.
Now that you know what you need, we'll put it together, but in order to do that you need to know how the binary switch works.....so let's move on to the next step!
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|












































