Working with the Pololu Zumo robot for Arduino
In this section, we will make a simple robot with simple movements based on avoiding obstacles. If the robot faces an obstacle, the robot will turn left to avoid it. To make this happen, we can use an Ultrasonic module to detect an obstacle.
I usually use HC-SR04 as an Ultrasonic module. It's cheap, and you can buy it on dx.com, banggood.com, and AliExpress. You can see the HC-SR04 module form in the following figure:
The HC-SR04 module provides four pins: VCC, GND, Trigger, and Echo. You can connect Trigger and Echo pins to Arduino digital I/O. But how can you connect the HC-SR04 module into Pololu Zumo robot for Arduino?
Based on the user guide from Pololu, you can connect them through Arduino digital I/O on pins 4, 11, 5, 2. The easier way is to connect HC-SR04 module via the front expansion pins. You can see this in the following figure:
For our demo wiring, connect Trigger and Echo pins to Arduino digital I/O on pins 2 and 4. The VCC and GND...