Fc 51 Ir Sensor Datasheet

pinMode(2, INPUT); pinMode(13, OUTPUT); if (digitalRead(2) == LOW) digitalWrite(13, HIGH); else digitalWrite(13, LOW);

The LM393 comparator compares the voltage from the photodiode against a reference voltage set by the onboard potentiometer.

Turn the potentiometer counter-clockwise. Keep the sensor away from direct sunlight. Fc 51 Ir Sensor Datasheet

The is a low-cost, widely used infrared obstacle avoidance sensor module. It is designed primarily for robotics and automation projects to detect objects in close proximity without physical contact. Based on the LM393 voltage comparator and an IR transmitter-receiver pair , this module provides a reliable digital output to microcontrollers like Arduino, ESP32, and PIC.

/* FC-51 IR Obstacle Avoidance Sensor Testing Code The OUT pin goes LOW when an obstacle is detected. */ const int SENSOR_PIN = 2; // FC-51 OUT pin connected to Digital Pin 2 const int LED_PIN = 13; // Onboard Arduino LED void setup() pinMode(SENSOR_PIN, INPUT); // Configure sensor pin as input pinMode(LED_PIN, OUTPUT); // Configure LED pin as output Serial.begin(9600); // Initialize serial monitor Serial.println("FC-51 Sensor Initialized."); void loop() int sensorState = digitalRead(SENSOR_PIN); // Read digital state if (sensorState == LOW) // Obstacle detected digitalWrite(LED_PIN, HIGH); Serial.println("Status: OBSTACLE DETECTED"); else // Path is clear digitalWrite(LED_PIN, LOW); Serial.println("Status: Clear"); delay(100); // Small delay to avoid flooding serial monitor Use code with caution. 7. Common Applications The is a low-cost, widely used infrared obstacle

The FC-51 module is designed for ease of integration with microcontrollers like Arduino, Raspberry Pi, and ESP8266. Specification 3.0V – 6.0V DC (Typical: 3.3V or 5V) Current Consumption ~23 mA at 3.3V; ~43 mA at 5.0V Detection Range 2 cm to 30 cm (Adjustable via potentiometer) Detection Angle Output Type Digital (HIGH/LOW logic) Active Output Level LOW when an obstacle is detected PCB Dimensions 3.1 cm (L) x 1.4 cm (W) Pinout Configuration

Direct sunlight or strong incandescent lighting contains high levels of infrared radiation. This environmental IR noise can saturate the photodiode, leading to false triggers. It is best used indoors or in shaded enclosures. /* FC-51 IR Obstacle Avoidance Sensor Testing Code

Fine-tunes the reference voltage of the LM393. Turning it clockwise increases the detection range; turning it counterclockwise decreases it.

If your sensor is not behaving as expected, verify the following: