Arduino Rotary Encoder Tutorial

Home/Arduino Projects/Arduino Rotary Encoder Tutorial

Arduino Rotary Encoder Tutorial

Dear friends, welcome back! Today, we take a look at rotary encoders using Arduino.

Intro to Arduino Rotary Encoder Tutorial

A rotary encoder, this device here, is an electromechanical device, that converts angular position or rotation of a shaft into analog or digital code. In simple words, when i turn the shaft to the right it increases its valueand when i turn it to the left, it decreases its value.

The main advantage of the rotary encoders is that we can turn them unlimited times. So, this rotary encoder has 20 positions.

Let’s look.

We are now at position 10, so the value is 10.

Let’s go back to position 0 by turning it to the right. You can see that the value is 20 I can still turn it to the right and the value increases.

When I turn it to the left, the value decreases and the position decreases as well.

Rotary encoders are used in many applications that require precise and unlimited rotation, like industrial control, robotics or computers and microcontrollers, like the projects that we are building.

Another very useful feature of this rotary encoder is that it has a button embedded. As you can see, I can click the rotary encoder and Arduino recognizes the click and shows clicked message here.

——————–
WHERE TO BUY
——————–

1. Arduino Mega: http://bit.ly/ArduinoMega

2. Nokia 5110 LCD: http://bit.ly/NOKIA5110

3. Rotary Encoder: http://bit.ly/RotaryEncoder

4. Wires: http://bit.ly/WiresArduino

5. Small Breadboard: http://bit.ly/SmallBreadboard

Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!

——————–

LIBRARIES
——————–

Encoder library: https://github.com/0xPIT/encoder/tree/arduino

TimerOne library: https://github.com/PaulStoffregen/TimerOne

——————–

CODE OF THE PROJECT
——————–

Download

 

 

 

——————–

SUBSCRIBE ON YOUTUBE

——————–

Never miss a video: Subscribe to educ8s.tv

2017-03-31T12:43:23+00:00
Close