top of page

Line Following Robot

I programmed and built a robot that can follow a black line of electrical tape with gentle curves. My robot uses a color sensor to detect whether it's still on the black line. If it detects black, it moves forward; if it detects white, it pans to the right to see if it can find the line again. If the robot is unsuccessful in finding the line to the right, it returns to its original position and begins turning to the left. My code can be accessed here.​​​

Main Micropython Skills Used:
  1. State machine logic

  2. Motor speed control, turning motor pins on/off to control direction

  3. Encoder counting

  4. Determining color detection thresholds

  5. Debugging and error analysis

​​I used SolidWorks to make plastic holders for the DC motors and a slot for the color sensor near the ground. I also designed a top piece that secured the ESP32 with posts and had legs that extended to the ground from both sides to stabilize the robot (these ended up dragging and would have been better removed). The top and bottom pieces snap togther though a slot and post fit. My designs are pictured below.​​

​

My teammate Jevon and I both brainstormed how we would approach the project and what the robot would look like. I designed and printed the CAD for the robot while Jevon started the code. We troubleshot and tested the code together, and I ended up designing a new code the next day.

IMG_8868.HEIC
IMG_8866.HEIC
CAD:
Screenshot 2025-09-25 at 9.45.21 PM.png
Screenshot 2025-09-25 at 9.46.24 PM.png
bottom of page