Line Follower [Principles of Engineering]

As you can tell from the title image showing the final robot and my beautiful ankles, the goal of this project was to create a line following robot. Specifically, the robot should be autonomous and complete the track in as little time as possible.

For the impatient, here’s the video of it working. Some specs for the project are below.









oh you’re still here

If you are all the way down here I suppose you want to here a bit about how we did it. I won’t go into too much detail here because I do not want to take away from the experience of other people in the class in the future, but if you are interested in more specifics, feel free to contact me.

Anyway, My partner and I used an Arduino with a motor shield connected to a 12V power supply via outlet. We connected the motor shield to a generic store bought chassis with two simple DC motors to control the robot. For line detection, we use two IR reflectance sensors mounted at the front of the robot. You can see our beautiful mounting job below.


Don’t worry it looked even worse in person. Obviously, neither of us are mechanical engineers, thank god.  Nonetheless, our mount of cardboard and duct tape successfully allowed us to experiment with the most interesting part (in my opinion)……the control.

We see an interesting problem here. We have to design semi-intelligent control of 2 wheels with only 2 (essentially binary) inputs, the left and right sensor.

Well, the problem is can be solved naively. When the left sensor detects tape, stop the left wheel and vice versa. This will work…kinda but it is incredibly slow as the robot comes to a complete stop every time there is a slight turn.

So instead during a turn,  what about increasing the speed of one wheel and decreasing the other? This sounds nice, but the robot just ends up going straight through any sharp turns.


In order to increase speed of the car around the track without blowing through the lines, we tried to code logic that would mimic the action of an actual driver when navigating a course. Namely, drivers will speed up on straightaways and slow down on turns. In order to copy this effect, we added an “acceleration” for the straightaways and turns that modifies the speed of the car. So, when the car is on a straightaway, its speed will continually increase (up to a point) and the turn will be set to minimum, and when the car is at a turn, the speed will continuously drop while the turn rate will increase. The logic for turning is that the same side wheel will continuously decrease in speed the longer it is over tape while the opposite wheel will continuously increase in speed the longer it is over tape. This creates the effect that the car will quickly go through the straight parts and increasingly turn on bends so it adjusts for the sharpness of the turn.

We found this work somewhat effectively for the course, but there are many other way to do it, many of which have gotten better times then us.

Have a better idea?

Email me! I would love to hear about it.

Finally Github!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s