Blog Home

A DIY autonomous lane keeping system on a budget

Arduino TeamOctober 18th, 2023

Despite overconfident proclamations from high-profile players in the tech and automotive industries, we’re still a long way from fully autonomous self-driving cars. Current prototypes work well under ideal conditions, but are easily thwarted by everyday real world anomalies. Lane keeping, however, is a much more approachable challenge and Computerphile was able add such functionality to an older vehicle.

Many of today’s cars have lane keeping capability and that usually works by looking at the lane lines on the road. Because drive-by-wire is now the norm, the vehicle can steer itself to remain within the lines. That works well on interstates and highways, because it only needs to perform small adjustments without any turns. This DIY lane keeping system works in a slightly different way. It looks at the entire scene in front of the car and uses an AI to determine if it should adjust the steering.

Before continuing, it is worth noting that Computerphile wanted to emphasis that this is not safe for use in the real world. There are too many potential safety issues and it would require extensive testing before it would be responsible to even try it on a public road.

With that in mind, this system’s performance was only simulated. It uses a trained convolutional neural network (CNN) to indicate how the car would steer itself if it had actual control over the steering. Computerphile trained that CNN using a laptop, a webcam, and an Arduino Nano 33 IoT. The computer records video frames while also recording the orientation of the Arduino through its built-in six-axis IMU. With the board attached to the steering wheel, that orientation corresponds to the angle of the steering wheel.

Through the magic of machine learning, the CNN was able to associate types of imagery with steering angles. So it might see a bend in the road and know that that means the steering wheel needs to turn.

“Can you replicate millions of dollars of tech with a webcam and an Arduino? Not really, but you can get pretty close!”

As Computerphile shows, this works fairly well. But it is also easily confused. It would take a lot more training data in a larger variety of conditions to produce a reliable system. In theory, however, such a system would be more robust than standard lane keeping systems that look at road lines.

Categories:Arduino

Leave a Reply

You must be logged in with your Arduino account to post a comment.