The module typically comes with a 3-pin male header interface:
The FC-51 IR Sensor is a powerful yet simple tool for proximity and object detection. While it may lack the precision of a laser or the range of an ultrasonic sensor, its low cost, ease of use, and reliable digital output make it an ideal choice for thousands of hobbyist and educational projects.
By referencing this FC-51 IR Sensor Datasheet, you now have the complete technical picture: pinouts, voltage limits, range adjustment, code examples, and troubleshooting. Whether you’re building a line-following robot, a contactless switch, or a factory counter, the FC-51 offers a straightforward “detect or not detect” solution that integrates with almost any microcontroller.
Remember the key constraints: Keep ambient IR low, adjust the potentiometer for your target reflectivity, and always confirm the pinout before powering up.
Happy sensing!
Disclaimer: Specifications may vary slightly between manufacturers. Always test your specific module with a multimeter before integrating into a final design. Fc 51 Ir Sensor Datasheet
The FC-51 module works on the principle of reflective infrared sensing.
Connecting the FC-51 to a microcontroller is straightforward:
Basic Arduino Code Example:
int sensorPin = 2; int ledPin = 13;void setup() pinMode(sensorPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600);
void loop() int sensorState = digitalRead(sensorPin); The module typically comes with a 3-pin male
// Since output is Active LOW, "LOW" means object detected if (sensorState == LOW) digitalWrite(ledPin, HIGH); Serial.println("Obstacle detected!"); else digitalWrite(ledPin, LOW); Serial.println("Path clear"); delay(100);
/* FC-51 IR Sensor - Basic Obstacle Detection Assumption: Sensor outputs LOW when object detected. Adjust logic if your sensor is ACTIVE HIGH. */const int irSensorPin = 7; // FC-51 OUT connected to pin 7 const int ledPin = 13; // Built-in LED
int sensorValue = 0; int objectDetected = false;
void setup() pinMode(irSensorPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); Serial.println("FC-51 Obstacle Detector Ready"); The FC-51 module works on the principle of
void loop() sensorValue = digitalRead(irSensorPin);
// If sensor reads LOW (object detected) if (sensorValue == LOW) objectDetected = true; digitalWrite(ledPin, HIGH); // Turn LED ON Serial.println("Obstacle Detected!"); else objectDetected = false; digitalWrite(ledPin, LOW); // Turn LED OFF // No output for "clear" to avoid spamming.
delay(50); // Small delay for debouncing