Projects / Ideas / Lane-keeping model car with a Pi camera

Lane-keeping model car with a Pi camera

AdvancedEdge AIIdeaReviewed
In short

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
An idea, not a guided build yet. Goal, parts and steps; no wiring, code or tests. Copy it to My Garage to plan it.
Goal

Detect lines in images and turn their position into a steering angle.

How to build it

  1. Make a track with black tape on white sheets
  2. Capture frames, convert to grey and find edges
  3. Find the lane centre in the lower part of the image
  4. Steer proportionally to the offset
  5. Drive slowly and record a video of each run

Related projects

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.