Line Follower Robot using Pixy2 and Arduino

This blog explains how to implement the hobby project “Line Follower Robot using Pixy2 and Arduino“. We have tried our best to keep it as much simple as possible. This hobby project is completely accomplished by Priyanka Tarar (Intern) working at Robokits. In this blog, I have shared the method that she implemented to fulfil the task.

#1 > Collecting Resources

For Charging the battery >

#2 > A Quick Test to check working of Pixy2 on Arduino

Kindly go to “Interfacing Pixy2 with Arduino” to go through a beginner’s tutorial with Pixy2 and Arduino.

#3  Making Connections

The following image explains it simply:

#4 > Code

We have edited the ‘line_zumo_demo‘ example code from Pixy2 Library a little bit. Here is our edited code.

Note: Make it sure to install the Pixy2 Library. The method to install it will be found in Step #2.

#5 > Designing the Line Track

We have implemented a simple trick to make the Line Track with shape ‘8‘. Take 8 A4 size white papers and connect them through tapes in a 2×4 pattern. Draw an ‘8‘ on it using a black marker.

#6 >  Final Procedure

  • Assemble the Robot Hardware containing Chassis, Wheels, Motors and Caster Wheel.
  • Program Arduino with given code.
  • Make the connections as per Step #3. To connect Arduino with Pixy2, refer the following image:

  • Power up the robot with battery, carry it and put its wheels on any line vector on the Line Track with pattern ‘8‘. Job Done !


Line tracking API