All packs

Sensors

Line detector

An LED that lights when the sensor is over a black line. This is the eye of every line-following robot.

  • Easy
  • about 20 min
  • Arduino Uno
  • No soldering
  • 7 parts
  • 6 wires
  • 17 lines of code
Try it in the simulator

Opens this circuit, already wired, with the sketch loaded. Free, nothing to install.

Idea

The sensor shines infrared light down and measures how much comes back. Black tape reflects little, white paper a lot. Build this before a robot, to see what the sensor sees.

What you learn

Reading a digital sensor, and how a robot tells the line from the floor.

How it works

  1. input

    Infrared line sensor

  2. decides

    Arduino Uno

  3. output

    LED

Powered with 5 V from the Uno's USB cable. No battery and no soldering.

This circuit and sketch are run in the ManuStem simulator before the pack is published. Real parts vary between makers: follow the labels printed on your own module, not its position in the picture.