The Pushbutton Rotary Encoder

After building several projects with numerous pushbuttons and switches I thought there had to be a better way to do things. My original Pic-EL had a rotary encoder but I never used it. I decided that a pushbutton encoder and a LCD display could replace any number of buttons and switches if a menu interface were used. Certainly a lot of amateur radio gear today is designed that way; not everyone likes it but it is very effective. So I went on DigiKey and searched for a rotary encoder. I found the Grayhill 62P22-L4. It was inexpensive and had the features I wanted. I made a few projects with it, including the cable tester, the electric blanket controller, and the thermostat

When I was building my appliance timer, I ran into a problem with the Greyhill encoder. If you wiggled the shaft, it would generate spurious pulses to the software. I replaced the encoder twice before I concluded that I must have a bad batch of encoders. Certainly, my earlier projects did not have this problem. I looked on DigiKey and found another pushbutton encoder, a CTS series 290 rotary encoder. The CTS part number is 290VAB0R201B2 and the Digikey p/n is  CT3007-ND.

CTS encoderUnlike the Greyhill encoder, the CTS encoder has no LED inside and consumes no power. The odd thing about the CTS encoder is that for each rotary detent, it outputs all 4 codes instead of one code as with the Grayhill. Once you figure this out and change the program accordingly, the encoder works just fine. As a bonus the shaft is a standard size making it much easier to fit a knob.

Rotary encoders output different kinds of codes. The ones I have dealt with output a 'quadrature 2-bit code' which tells you whether the shaft is turning clockwise or counterclockwise. Check the spec sheet carefully.

I wrote an article in August 2008 Nuts & Volts titled How to Use the Pushbutton Rotary Encoder. The demo project used a PIC16F84A with a Greyhill rotary encoder, a one-digit LED display and a buzzer. If you're looking for the project files, they can be downloaded here. I would suggest using the CTS encoder, and all the support code can be found in my appliance timer project.

Update. QST Magazine published an article on rotary encoders in the June 2011 edition, Hands-On Radio Experiment 101 Rotary Encoders, which is more comprehensive than my article. There was a follow-up in the March 2012 edition, Technical Correspondence column which adds even more more information. W2ORO uses the term "pulses per detent" to describe what I observed with the Greyhill (1 pulse) and CTS (4 pulses) devices. Interestingly, he also mentions a bad signal problem with one manufacturer's part, just as I had experienced.

EC11-1B-18TUpdate 2. I found another inexpensive encoder similar to the CTS above. It is made by Changzhou Xinze Electronic Co., and the model number is EC11-1B-18T. It cost C$3.50 in 2012/04 (now C$1.00 in 2016-12). It can be panel mounted which is nice, but does not come with a nut! My support code for the CTS encoder works with this encoder; for an example see my Nokia Clock project. I purchased a few of them from iStore, in China (alas this web site is gone and I can't find this encoder anywhere now.)

VE3LNY's Electronics Notebook Page