How do you build a lane-keeping model car with a Pi camera?
A Raspberry Pi camera on a model car finds lane lines with OpenCV and steers to keep in the lane on a paper track. You need Raspberry Pi 4 Model B (4 GB), Raspberry Pi 15 W USB-C power supply, SanDisk microSD card 32 GB (A1, Class 10), Raspberry Pi Camera Module 3, Robot car chassis kit 4WD, L298N Dual H-Bridge Module, MG996R metal gear servo, Li-Po 2S 7.4 V 2200 mAh 25C (RC) and XL4015 5 A buck converter module.
- Level
- Advanced
- Time
- About 480 min
- Parts
- 9
Detect lines in images and turn their position into a steering angle.
Parts list
- Single Board Computers
- SBC Accessories
- SBC Accessories
- SBC Accessories
- Mechanical & Hardware
- Motor Drivers
- Motors & Actuators
- Batteries
- Power
How to build it
- Make a track with black tape on white sheets
- Capture frames, convert to grey and find edges
- Find the lane centre in the lower part of the image
- Steer proportionally to the offset
- Drive slowly and record a video of each run
Common questions
What parts do I need for the lane-keeping model car with a Pi camera?
Raspberry Pi 4 Model B (4 GB), Raspberry Pi 15 W USB-C power supply, SanDisk microSD card 32 GB (A1, Class 10), Raspberry Pi Camera Module 3, Robot car chassis kit 4WD, L298N Dual H-Bridge Module, MG996R metal gear servo, Li-Po 2S 7.4 V 2200 mAh 25C (RC) and XL4015 5 A buck converter module.
How long does the lane-keeping model car with a Pi camera take to build?
About 480 minutes for a advanced maker.
