A little curiosity. A whole lot of making.Robotics, CNC & connected ideas
robodatech.
Arduino sample library

Line Follow Logic 03

Combine sensor thresholds and motor decisions for line following robots.

Open in compiler →

Source code and build tools are available in the protected platform workspace.

How it works

Use two analog sensors to make basic line-following motor decisions.

  1. Wire left and right sensors to A0 and A1.
  2. Wire motor driver speed inputs to D5 and D6.
  3. Tune lineThreshold for the track and sensor height.
  4. Reduce one side speed when that sensor sees the line.

Connections

PinConnect toNote
A0, A1IR reflectance sensor outputsTune lineThreshold for your surface.
D5, D6Motor driver speed inputsUse separate motor power and common GND.

Good ideas start here.

Free robotics lessons, CNC build notes and product updates. Confirm your email to join. Unsubscribe anytime.