Rotary Encoder Kit Tutorial

by mybotic in Circuits > Sensors

5235 Views, 8 Favorites, 0 Comments

Rotary Encoder Kit Tutorial

718d633bee1553e0e4e3fc50c2a615321445076366-nm.jpg

Description:

This rotary encoder kit can be used for sensing motor's position and velocity. It is a very simple kit consisted of an optical beam sensor (opto switch, phototransistor) and a piece of slotted disc. It can be connected to any microcontroller via the 3-pin header. The optical beam sensor detects missing slots of the slotted disc, and generates a pulse train.

It requires +5VDC to power up, and gives a 0V and 5V output. It provides a 5V output when the beam is blocked, and a 0V output when the beam is unblocked. Your microcontroller can simply read the 0-5-0V pulse train to determine how far your motor has traveled, and how fast.

The kit includes a green LED that light up when the beam is uninterrupted.

Specification:

  • Operating Voltage: 4.5-5 VDC
  • Output Signal: Digital output
  • Direct connection to microcontroller (internal pull-up to 5V)
  • Able to read up to 100KHz
  • Slotted Disc Diameter: 26mm
  • PCB Dimension: 22mm x 20mm

Materials Preparation

FT61K1TJJEJY9LQ.LARGE.jpg
FMALNARJJEJY9MK.LARGE.jpg
FK27J56JJEJY9MX.LARGE.jpg
2e87807ef363a4f6a494238691b56d6f1522463880-nm.jpg

For this tutorial, the items needed to run this project are:

  1. Arduino Uno
  2. USB Cable Type A to B
  3. Male to male jumper wire
  4. Female to male jumper wire
  5. Plastic Gear Motor

Hardware Installation

images.jpg
36990025_1836037339773410_1499223686891175936_n.jpg

Diagram above shows the simple connection between Rotary Encoder Kit and Arduino Uno:

  1. 5V > 5V
  2. GND > GND
  3. OUT > D2

Connection between Plastic Gear Motor and Arduino Uno:

  1. Terminal 1 > 5V
  2. Terminal 2 > GND

After completing the connection, connect Arduino Uno to power supply with a USB cable.

Insert Source Code

  1. Download the test code and open it by using Arduino software or IDE.
  2. Make sure that you have choose the right board and the corresponding port (In this tutorial, Arduino Uno is used).
  3. Then, upload the test code into your Arduino Uno.

Downloads

Results

36970965_1836145446429266_997822805254864896_n.jpg
Untitled.png

The slotted disc is mounted to Plastic Gear Motor and placed within the space of the rotary encoder circuit board. The optical beam sensor detects missing slots of the slotted disc and generates a pulse train. By adjusting code in Arduino, Rotary Encoder will be able to detect actual rpm for the Plastic Gear Motor and display on Serial Monitor.

Video

Rotary Encoder Kit