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

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 just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - 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
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.