Simply change the condition to:
| Pin Name | Function | Connection | | :--- | :--- | :--- | | | Power Supply (3.3V to 5V DC) | Connect to +5V or +3.3V on MCU | | GND | Ground | Connect to common ground | | OUT | Digital Output (TTL) | Connect to any digital input pin on MCU | Fc 51 Ir Sensor Datasheet
void setup() pinMode(irSensorPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); Serial.println("FC-51 Obstacle Detector Ready"); Simply change the condition to: | Pin Name
A: If your module has an AOUT pin, read it using an ADC pin. If not, you can solder a wire directly to the phototransistor's collector or the comparator's non-inverting input. We will dissect every parameter, explore circuit diagrams,
delay(50); // Small delay for debouncing
This article serves as an exhaustive and application guide. We will dissect every parameter, explore circuit diagrams, provide code examples (Arduino), and answer frequently asked questions. 1. What is the FC-51 IR Sensor Module? The FC-51 is a compact, low-cost infrared (IR) sensor module designed for digital obstacle detection . It operates by emitting infrared light from an IR LED and detecting the reflected light using a phototransistor. If an object is close enough, the reflected IR intensity is high, and the module outputs a digital signal (either HIGH or LOW) indicating the presence of the object.
else objectDetected = false; digitalWrite(ledPin, LOW); // Turn LED OFF // No output for "clear" to avoid spamming.