Line Following Robot (2023)

In September of 2023, during my O-Levels, my friend and I made a basic line following robot to compete in a science fair held by my school.

The robot car itself was quite simple and was made using parts I had available on hand. It consisted of an Arduino Uno, two DC geared motors along with a DC motor driver, three IR sensors to detect the line and a LiPo battery from my RC plane project to power everything. A bluetooth module was also added on later which allowed us to adjust settings on-the-go through a simple mobile app. Everything was simply glued onto spare balsa wood using hot glue.

I wanted to use PID to control the car and make the line following system more robust, however it required having more IR sensors which I did not have.

Instead, I went with the more rudimentary “Bang-Bang” control method. Unlike PID which would adjust how much the car turned according to how far it had deviated from the line, this control loop is simple: if the car is swaying to the left.. BANG! Full right turn! If the centre sensor detects the line, then all is well. Uh oh, right sensor is detecting the line now? BANG! Left turn! You get the idea.

You might actually find this type of controller around your house! Electric and gas geysers, ovens, etc often use this method to turn off and on to hold a set temperature instead of adjusting the power level of the heater itself.

Anyways, back to the robot car. The “Bang-Bang” control is not as refined and can easily lose track of the line by either understeering or oversteering out of the range of the IR sensors. This was a common occurance which was why I added the bluetooth module to be able to adjust the sensitivity of the controller on the fly.

In the end the project was a success, and we were able to showcase it during the school’s science fair!