The Digital Contacting Rotary Encoder Mechanism

(article continued from previous page)

The electronic counter project features a continuous rotation dial to adjust settings and values. The dial can be spun clockwise and counter-clockwise beyond 360°. That is, unlike standard potentiometers, the rotary dial doesn’t have a physical stop at any point in the rotation.

A rotary encoder has three pins: A, common, and B. Common is usually hooked to GND but it can be hooked up to 3.3V or 5V or whatever you’d like.

As the dial is turned, an on/off signal is generated out of A and B as if they were ordinary switches being pressed and released. By watching the output pattern, a microcontroller can tell the direction and speed that the dial is turned. (Sample outputs are shown on the next page.)

Top and side view of a Bourns rotary encoder.

Top and side view of a Bourns rotary encoder.

This is a rotary encoder manufactured by Bourns. Rotary encoders are used as continuous rotation dials on devices such as modern radio volume controls.

The rotary encoder for the Adjust Dial on the counter project was purchased from Electronic Goldmine (part #G2072) many years ago. But, that part is now obsolete. The equivalent (and improved) part is 652-ECW1J-C24-BC0024 from Mouser Electronics for $4.24.

These encoders have detents that make clicking noises as the dial is turned. A silent and smooth rotating version (without detents) is 652-ECW0J-C24-BE0024 from Mouser Electronics for $3.82

Rotary encoder installed with a nut and knob.

Rotary encoder installed with a nut and knob.

The rotary encoders aren’t supplied with a securing nut or knob. So, be sure to include some with your order.

The Bourns nuts are very peculiar -- 9 mm with 0.75 mm threads. The only place I can find them is Mouser Electronics, part #481-0009. The price is $0.30 for 1, or $0.03 in quantity 100. If you want 10 or more, you might as well order 100. ($0.30 * 10 = $0.03 * 100 = $3.00). Peculiar pricing for peculiar nuts.

This particular rotary encoder model has a standard 1/4-inch diameter shaft. Matching knobs are available in a variety of sizes, materials, and styles. Electronic surplus stores and eBay are good choices for low prices.

I made the counter project’s knob out of Delrin on a lathe. If you look closely you can see the little tool grooves. Because the encoder shaft is fairly long, two set screws keep it from wobbling. (Actually, the hole fit is tight enough that the screws aren’t even necessary.)

Opening Up a Rotary Encoder

Although it might be possible to force open an encoder with a screwdriver or wire snips, I prefer the less crude method of cutting it open on a milling machine.

Removing plastic rivets by milling off the tops.

Removing plastic rivets by milling off the tops.

The rotary encoder is held together by four plastic rivets. The rivet heads are destructively removed by an end mill. Long parallels hold the encoder flat while providing depth for the shaft off the side of the vise.

The top and spindle shaft of a rotary encoder includes a detent (a spring with bumps) that makes a clicking sound as the shaft is turned.

The top and spindle shaft of a rotary encoder includes a detent (a spring with bumps) that makes a clicking sound as the shaft is turned.

Inside the top of the rotary encoder case is a metal disc spring (also called a spring washer) with small raised areas. The disc of the encoder shaft is impressed with ridges that rub against the bumps in the spring to make clicking sounds as the shaft is turned.

It is generally a matter of application preference as to whether or not you select a rotary encoder with our without detents. Lack of detents results in a smooth, quiet dial. But, the clicking of the detents provides audible and tactile feedback to a user.

Functionally, detents prevent the dial from rotating on its own due to vibration. Additionally, the detents force the disc into a known resting state, which can be wired to use the least amount of power.

But there is more inside of the rotary encoder...