Interfacing A Digital Rotary Switch

digital_rotary_switch

[hw640] has put together a well written and detail packed explanation of how to interface with a digital rotary switch. These digital opto encoders have just two outputs with four possible logic levels (00, 10, 11, 01). The relative position of the switch is insignificant but the direction of rotation is what matters.

The short and dirty: Each of the switch’s 2 output pins is attached to a pin change interrupt on the microcontroller. Every time the switch moves it generates either a rising edge or a falling edge on one of the two pins; both edges cause an interrupt. By checking which pin caused the interrupt, then comparing the logic levels of the two pins after that interrupt, we can determine the direction the switch was rotated.

Although this explanation uses a PIC and code written in PicBasic Pro the concepts are discussed in the abstract and would easily be adapted to an AVR or another microcontroller of your choice.

HDDJ: Hard Drive As Rotary Input

dj_hdd

[nvillar] wanted a relatively cheap way to make a rotary input device for audio mixing. After looking at several options including turn tables and professional audio scrubbers, they decided on the hard drive due to its size, price, and the feel of the disk. The geek factor of using a hard drive as an input device probably didn’t hurt either. They provide schematics and details on how to make it all work. There’s a video after the break of the unit sending signals to a computer. No performances though, sorry.

Continue reading “HDDJ: Hard Drive As Rotary Input”