Fc 51 Ir Sensor Datasheet -

delay(50);

Introduction In the world of embedded systems and robotics, few components are as ubiquitous or as essential as the infrared proximity sensor. Among the myriad of options available, the FC-51 IR Sensor stands out as a favorite for hobbyists and professionals alike. It is cheap, reliable, easy to interface with microcontrollers like Arduino, Raspberry Pi, and ESP32, and incredibly effective for non-contact object detection. Fc 51 Ir Sensor Datasheet

import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) SENSOR_PIN = 17 GPIO.setup(SENSOR_PIN, GPIO.IN) delay(50); Introduction In the world of embedded systems

void loop() sensorState = digitalRead(sensorPin); GPIO.IN) void loop() sensorState = digitalRead(sensorPin)

The FC-51 can run on 3.3V, making it safe for Pi GPIO. Use the same pinout but connect VCC to 3.3V.