Get Captions

Fc 51 Ir Sensor Datasheet

void loop() int sensorState = digitalRead(sensorPin);

For those integrating the FC-51 into time-critical applications (e.g., high-speed object counting), the following timing parameters are important:

if (sensorValue == HIGH) { // Object detected Fc 51 Ir Sensor Datasheet

: The onboard LM393 comparator processes this signal. If the reflected light intensity exceeds the threshold set by the potentiometer, the module triggers the OUT pin to LOW and lights up the onboard "Obstacle" LED. Common Applications

// Define Pin Allocations const int irSensorPin = 2; // OUT pin connected to Digital Pin 2 const int ledPin = 13; // Onboard Arduino LED void setup() // Initialize Serial Communication Serial.begin(9600); // Configure Pin Modes pinMode(irSensorPin, INPUT); pinMode(ledPin, OUTPUT); void loop() // Read the sensor output (LOW means obstacle detected) int sensorState = digitalRead(irSensorPin); if (sensorState == LOW) digitalWrite(ledPin, HIGH); // Turn on the LED Serial.println("Obstacle Detected!"); else digitalWrite(ledPin, LOW); // Turn off the LED Serial.println("Path Clear."); delay(100); // Small delay to avoid flooding the serial monitor Use code with caution. Common Applications Common Applications This program uses the FC-51 as

This program uses the FC-51 as a touchless button, toggling the onboard LED each time an object passes in front of the sensor.

The FC-51's simplicity makes it a great entry-level sensor. please let me know:

To help expand your project or integrate this hardware efficiently, please let me know: