IR obstacle sensor sees nothing, or sees everything

  • IR sensor

Why it happens

  • The sensitivity screw isn't set.
  • Bright sunlight.
  • Most modules give LOW when they see something, so the code looks backwards.

How to fix it

  1. Turn the screw until the small LED lights only when your hand is at the distance you want.
  2. Try indoors, away from windows.
  3. If it's reversed, change HIGH to LOW in the if.
  4. For a line follower keep it 5 to 10 mm above the floor.

It worked if: The module's LED goes on and off as you move a white card.

From how the part works. Explained from how the part works; not tried on a real circuit for this page.

Didn't help? Search another error or ask us.