Copiar
Bots de Trading
Eventos

Fc 51 | Ir Sensor Datasheet [new]

Every engineer must know the limitations documented in the FC-51's fine print.

void setup() pinMode(irSensorPin, INPUT);

Connecting the FC-51 to an Arduino is straightforward due to its direct digital output. Wiring Diagram Arduino Pin GND OUT Digital Pin 2 Sample Arduino Sketch Fc 51 Ir Sensor Datasheet

Note on 4-pin versions: Some FC-51 modules break out an additional pin, which provides the raw analog voltage from the phototransistor before it goes into the comparator. This can be used for measuring distance more precisely.

Absorb IR light. A pure matte black surface may not reflect enough light to trigger the sensor at all, a property frequently exploited in line-following robots where black tape represents a boundary line. Adjusting Sensitivity and Range Every engineer must know the limitations documented in

Complete Guide to the FC-51 IR Obstacle Avoidance Sensor: Datasheet, Pinout, and Arduino Interfacing

import RPi.GPIO as GPIO import time # Use Broadcom SOC Pin numbers GPIO.setmode(GPIO.BCM) # Define the GPIO pin connected to FC-51 OUT IR_PIN = 17 GPIO.setup(IR_PIN, GPIO.IN) print("FC-51 IR Sensor Monitoring... Press Ctrl+C to exit.") try: while True: # Read sensor state (LOW means obstacle detected) if GPIO.input(IR_PIN) == GPIO.LOW: print("Obstacle Detected!") else: print("Path Clear...") time.sleep(0.2) except KeyboardInterrupt: print("\nProgram stopped by user.") finally: GPIO.cleanup() # Reset GPIO settings Use code with caution. Troubleshooting Common Issues This can be used for measuring distance more precisely

Understanding the hardware physical layout helps in tuning and troubleshooting the device:

The signal pin. It outputs a logical LOW (0V) when an obstacle is detected within the set threshold. It outputs a logical HIGH (VCC) when the path is clear. Hardware Components and Adjustment

Digital signal (LOW when an obstacle is detected, HIGH when clear) Onboard IC: LM393 Dual Differential Comparator Dimensions: 3.2cm × 1.4cm Mounting Hole Size: 3mm (for easy chassis installation) Pin Configuration and Functionality