Fork me on GitHub

Project Notes

#119 RotaryEncoderModule

Testing a Rotary Encoder module controlling an LED 8x8 display

Here’s a quick video of the circuit in action:



In the RotaryEncoderMethods project I determined that the Rotary library was by far the best option for reading a rotary encoder.

This project is similar, but uses a rotary encoder “module” that includes switch functionality. The module I am using is this one from seller on aliexpress. The module has built-in 10kΩ pull-up resistors on the signal lines, and external connections as follows:

Label Use
CLK Trigger rotational read on falling edge
DT(DAT) When CLK triggered, DT pulled low for counter-clockwise, DT pulled high for clockwise
SW Switch output - pulls the output low when pressed
+ Upper supply rail (5V)
GND Ground

Note the CLK/DT nomenclature is just a simplification of the underlying workings of the rotary encoder. These pins are actually just the regular two quadrature output phases of the encoder. Treating one as a clock and the other as the direction indicator is a workable analogy though.

This sketch uses the rotary encoder to control the position of a single enabled LED on an 8x8 LED display. This makes the accuracy of encoder input quite obvious, as it is very easy to single-step the LED position backwards and forwards.

The rotary encoder module includes a switch (press on the encoder shaft). This is hooked up to clear/reset the display.



The Schematic

The Build

Credits and References

About LEAP#119 Sensor8x8 LEDArduino
Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is my personal collection of electronics projects, usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting (IMHO!).

The projects are usually inspired by things found wild on the net, or ideas from the sources such as:

Feel free to borrow liberally, and if you spot any issues do let me know. See the individual projects for credits where due. There are even now a few projects contributed by others - send your own over in a pull request if you would also like to add to this collection.