PART 6
Our robot project comes to a mighty end!
YOU’LL NEED THIS
• Robot build from part five
• Pi camera
• Code and more from GitHub: https://tinyurl.com/ APC522robot
GENIUS TIP!
Quick connections for motors and power can be made using a breadboard with screw terminals. But the quickest and safest solution is Wago terminals. Used in the electrical installation industry, these connectors create a common connection, so one GND becomes many, for example.
At the end of part five, our robot had been connected to the Anvil web service and was successfully controlled via a web interface. In this final part, we will unleash the robot in autonomous mode, where it can use its sensor to navigate the world around it. We’ll refine our motor.py module to add further debug features, before finally adding a special sliding mode for our mecanum wheels. We’ll also take a quick look at a video-streaming Python script from Raspberry Pi which will let us view what our robot can see as it traverses the kitchen floor.
Using the sensors
The primary sensor for this build is an HC-SR04P ultrasonic sensor. These are what typically feed your parking sensors. You’re reversing the car and you hear a “beep, beep, beep” and then as you get nearer to the garage door you hear “BEEP!” That is an ultrasonic distance sensor. It sends a ping of ultrasound at 34,300cm per second (the speed of sound), then waits for the returning echo. The time taken for the ping to