Arduino Based LED Chaser using Rotary Encoder

Summary of Arduino Based LED Chaser using Rotary Encoder


This project demonstrates interfacing a rotary encoder with an Arduino Uno to detect the position and angular movement of a motor shaft. The rotary encoder outputs pulses through its signal pins that correspond to the shaft's rotational position and direction. By analyzing the sequence of falling edges on the encoder's output pins A and B, one can determine whether the shaft moves clockwise or counterclockwise and calculate the degree of rotation, improving position accuracy depending on the encoder's resolution.

Parts used in the Rotary Encoder Interface with Arduino:

  • Arduino Uno
  • Rotary Encoder Module
  • Connecting wires
  • Power supply (5V)

In this project we are going to interface a ROTARY ENCODER with ARDUINO.  ARDUINO UNO is an ATMEGA controller based development board designed for electronic engineers and hobbyists. In ARDUINO we have 20 I/O pins, so we can program 20 pins of UNO to be used as either input or output.

Arduino-LED-Chaser

A ROTARY ENCODER is used to know the position of movement and angular movement of a motor or axis. It’s a three terminal device usually, with power and ground pins there are total 5 terminals. A ROTARY ENCODER module is shown below.

Rotary-Encoder

The pins of a rotary encoder are:

  • Ground
  • Positive connected to +5V
  • Output signal A pin
  • Output signal B pin
  • Clock pin or common pin

The ENCODER provides pulses representing the change in the shaft position for the systems to understand. Consider a ROTARY ENCODER is powered up and the shaft is moved.

Output-Signal-Format

As shown in above table, consider the shaft is moved clock wise. With this there will be Falling Edge at the A terminal then at B terminal.

Consider the shaft is moved Anti clock wise. With this there will be Falling Edge at the B terminal then at A terminal.

This edge will occur once for 360/20 = 18 degrees (This is for a Encoder with 20 position, this changes from type to type, higher the count greater the accuracy).

With both above conditions, we can get direction and degree of rotation. Thus we get required parameters for getting the position of a shaft.

Read More:  Arduino Based LED Chaser using Rotary Encoder


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top