ElectronicsAuthor:

Rotary Encoder Counter with TM1637

An Arduino study that reads rotary-encoder direction through interrupts and displays an increasing or decreasing count on a TM1637 module.

ArduinoC++TM1637Interrupts
Rotary Encoder Counter with TM1637

About the Project

A compact embedded experiment that reads rotary-encoder motion with direction information and sends the resulting count to a four-digit TM1637 LED display.

How It Works

Encoder channels A and B connect to Arduino interrupt pins. Each rising edge triggers forward() or backward(); the level of the other channel determines direction and increments or decrements the counter. The main loop calls showNumberDec() only when the value changes.

Technologies

  • Arduino C++: interrupt routines and counter state.
  • TM1637Display: four-digit display driver.
  • Hardware interrupts: capture of encoder pulses outside the main loop.

Hardware

Arduino Uno/Mega/Nano, four-wire rotary encoder, and TM1637 display.

Technical Notes

The sketch demonstrates basic quadrature direction reading; it does not add a separate debounce filter for mechanical contact bounce.

Source Code

View the project on GitHub.