If you are using a Raspberry Pi, ensure that you power the FC-51 module using the instead of 5V. The Raspberry Pi GPIO pins are not 5V tolerant, and feeding 5V into a GPIO pin from the OUT line could permanently damage your Pi. Wiring Diagram Raspberry Pi Pin Pin 1 (3.3V) Pin 6 (GND) Pin 11 (GPIO 17) Python Example Code
Comprehensive Guide to the FC-51 IR Obstacle Avoidance Sensor: Datasheet, Pinout, and Arduino Integration Fc 51 Ir Sensor Datasheet
2cm to 30cm (Adjustable via onboard potentiometer) Detection Angle: 35° If you are using a Raspberry Pi, ensure
You can find the FC-51 IR Sensor at retailers like Art of Circuits or DIY Electronics . Detecting obstacle with IR Sensor and Arduino Fc 51 Ir Sensor Datasheet
def switching(): # Toggle the LED state led_onboard.toggle()