Community project

Proximity Distance Indicator

Arduino
Photo of Proximity Distance Indicator
Generated with AI

Anbu Mala

Published October 31, 2026

This proximity distance indicator uses an infrared obstacle detection module to sense nearby objects and provide visual feedback through an LED. When the FC-51 sensor detects an object within its adjustable range, the red LED illuminates to alert the user.

The guide includes a complete parts list, wiring diagram showing connections between the Arduino Uno, sensor module, and LED circuit, step-by-step assembly instructions, and the firmware needed to run the project. Builders will learn how to wire an LED with current-limiting resistor, interface with an IR sensor module, and program basic digital input/output on an Arduino.

Wiring diagram

Loading diagram…

Gather all the parts

QtyComponent
1

FC-51 IR obstacle detection module

Common three-pin infrared obstacle module; 3.3–5 V supply, OUT is LOW when an object is detected.

1

LED

red

Standard 3mm/5mm through-hole LED. A current-limiting series resistor is added automatically.

1

330 ohm resistor

330 ohm

Limits LED current

Assemble it in 4 steps

1. Prepare the single red LED circuit

Unplug USB before changing wires. The diagram contains only the Uno, the FC-51 IR obstacle sensor, one red LED, and one 330 ohm resistor. Disconnect any parts from the previous build that are not shown. The sensor has two front bulbs and three labelled pins.

2. Connect the obstacle sensor

Connect VCC to Uno 5V (power), GND to Uno GND (shared return), and OUT to D2 (object detection signal). Follow the printed pin labels, not the left-to-right position.

  • Reversing VCC and GND can damage the sensor.

3. Connect the red light

Connect Uno D4 to one end of the 330 ohm resistor. Connect its other end to the red LED's long leg (anode). Connect the short leg (flat side) to GND.

  • The resistor is required to protect the LED and the Uno output.

4. Adjust detection range

Place an object in front of the two sensor bulbs and gently adjust the small screw until the detection indicator changes. The external red LED lights while an object is detected and turns off when it is removed.

  • Detection depends on object colour and room lighting; avoid direct sunlight. This module detects presence rather than measuring distance.

Review all connections

1. Connections between "ir" and "Arduino"

FunctionirArduino
powerVCC5V
groundGNDGND
digitalOUTGPIO 2

2. Connections between "r_red" and "Arduino"

Functionr_redArduino
data1GPIO 4
data2 → LED ANODEEXT

3. Connections between "red" and "Arduino"

FunctionredArduino
groundGNDGND

Deploy the firmware

#include <Arduino.h>
const uint8_t SENSOR_PIN = 2;
const uint8_t RED_LED_PIN = 4;

void setup() {
  digitalWrite(RED_LED_PIN, LOW);
  pinMode(RED_LED_PIN, OUTPUT);
  pinMode(SENSOR_PIN, INPUT_PULLUP);
}

void loop() {
  const bool detected = digitalRead(SENSOR_PIN) == LOW;
  digitalWrite(RED_LED_PIN, detected ? HIGH : LOW);
  delay(10);
}

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik