Figure 3.4 shows the wiring diagram for connecting two hall-effect sensors with Arduino UNO:
![](https://static.packt-cdn.com/products/9781788474610/graphics/assets/13b2d06a-70eb-4279-81a3-0b4441d6a1c4.png)
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...