Smart transportation robot

An autonomous warehouse-style robot that follows a line, stops for obstacles and uses OpenCV to deliver cargo to the right station.
The robot follows a taped line, stops for obstacles, recognises the colour of its cargo with a Pi camera and delivers it to the matching station. An Android app gives manual control over Bluetooth.
It runs on a Raspberry Pi 3 B+ with a DRV8833 motor driver, a QTR-5RC IR array for line following and an HC-SR04 ultrasonic sensor for obstacle detection.
What I did
- Designed the mechanical structure and circuitry, and implemented the control logic.
- Designed the circular three-plate chassis in CAD, with side covers, a camera mount and a cargo holder made by laser cutting and 3D printing. Motors, sensor array, battery and charging circuit sit on the bottom plate, with the Pi above for easy pin access.
- Tuned the line-following and sensing behaviour on the prototype, and supported the Android Bluetooth control app.
What went wrong, and the fix
- Problem:
There was no Raspberry Pi library for the QTR-5RC IR sensor array.
Fix:Wrote our own timing-based reading routine.
- Problem:
Simple on/off line following was not smooth enough.
Fix:Version 2 used a weighted error with PD control, plus a special case that spins the wheels in opposite directions for 90° corners.
- Problem:
Line tracking failed when the sensors were badly calibrated.
Fix:Calibrated with the robot held at an even 3 mm clearance.
- Problem:
Stopping 10 cm from obstacles was too late, and the ultrasonic sensor's 5 V echo was unsafe for the Pi.
Fix:Raised the stop distance to 15 cm and added a voltage divider for the Pi's 3.3 V input.
From the bench
CAD render of the three-plate circular chassis
Side view with drive wheel and cargo holder
Raspberry Pi ports and power switch, accessible from the side
Top view of the cargo holder and camera ribbon