Figure 3.4 shows the wiring diagram for connecting two hall-effect sensors with Arduino UNO:
Figure 3.4: Wiring diagram for the encoder
Use the existing circuit you built in Chapter 2, Building a Mini Round Robot with Original ESP8266, to control the two DC gear motors with SparkFun Dual TB6612FNG (1 A) motor driver, Arduino UNO, ESP8266 (ESP-01), and a Bi-Directional Logic Level Converter. The following steps describe how to connect the two wheel encoders with Arduino UNO:
- Hall-effect sensor attached to the left wheel:
- Connect the Signal wire of the hall-effect sensor to Arduino digital pin 2.
- Connect the Power wire of the hall-effect sensor to Arduino 5V.
- Connect the Ground wire of the hall-effect sensor to Arduino GND.
- Hall-effect sensor attached to the right wheel:
- Connect the Signal wire of the hall-effect sensor to Arduino...