All Tutorials / DJ Sures / Use Arduino for Wheel Encoder Counter

Use Arduino for Wheel Encoder Counter

Description

Have your Arduino count motor encoder rotations. Connect the Arduino to your EZ-B UART #0 port to send the encoder counts.

Controls

This tutorial uses the following controls. Select a control to view the manual page.

Connect The Wires

There are two sets of wires which will need to be connected:

1) The Arduino to the encoder
2) The Arduino to the EZ-B

Encoder
Connect the encoder wires to your Arduino pins 2 and 3. These pins are interrupt pins. The code will count the number of changes between HIGH and LOW state of these pins.
- pin 2: Encoder #1
- pin 3: Encoder #2

EZ-B
Connect the Arduino's TX and RX ports to the UART #0 of the EZ-B. Consult the ez-b datasheet to locate the UART #0 port.

- Connect EZB UART 0 TX to ARDUINO RX
- Connect EZB UART 0 RX to ARDUINO TX
- Connect Arduino GND to EZ-B GND