if (sensorState == LOW) // Object detected digitalWrite(ledPin, HIGH); Serial.println("Object Detected!"); else // No object digitalWrite(ledPin, LOW);
Illuminates when an object enters the detection range and triggers the output. Working Principle The FC-51 operates on the principle of infrared reflection. Fc 51 Ir Sensor Datasheet
| Pin Number | Name | Function | | :--- | :--- | :--- | | 1 | | Ground | | 2 | OUT | Digital output | | 3 | VCC | Power | else // No object digitalWrite(ledPin
The FC-51 module works on the principle of . Here is a step-by-step explanation of its operation: Fc 51 Ir Sensor Datasheet