SensorsQUICK REFERENCE
IR Sensor
Reflective obstacle-module wiring and a repeatable calibration routine.
01Connections
- Module pins
- VCC, GND, OUT/DO; some boards expose AO. Read the silkscreen, not wire position.
- OUT
- Connect DO to a digital input. Many comparator modules assert LOW on detection; test yours.
- Supply
- Check the module rating and output voltage before choosing 3.3 V or 5 V.
02Calibration
- Set threshold
- Place the target at the desired distance; turn the potentiometer until the output changes.
- Test surfaces
- Check black, white, shiny and angled targets under actual room lighting.
- Filter
- Require several consistent samples before changing the robot state.
03Readout
- Digital
- digitalRead(pin) yields HIGH/LOW, not a calibrated distance.
- Analog
- AO, when available, reports reflectance; calibrate against the actual surface.