กลับไปหน้ารวมไฟล์
controlling-leds-using-ultrasonic-distance-sensor-82844f-en.md

ThisisaBeginnerproject. The green led glows and red led switches off when the object is a particular distance far from the UltrasonicDistanceSensor.

The red led glows and green led switches off when the object is a particular distance near to the UltrasonicDistance Sensor.

YouTubeChannel:J4Jevins

Link :- https://youtube.com/J4Jevins

EXPANDED TECHNICAL DETAILS

Non-Contact Interactive Lighting

This project creates a unique "Air-Dimmer" system where the brightness and pattern of an LED array are controlled by the user's hand position.

  • Time-of-Flight Ranging: The Arduino captures distance data from an HC-SR04 ultrasonic sensor. The hand position (0cm to 50cm) is mapped in the firmware to an 8-bit PWM value (0-255).
  • Smooth Interpolation Logic: Instead of abrupt changes, the Arduino uses a "Smoothing" algorithm (averaging the last 10 readings) to ensure the light transitions are fluid and cinematic.

Feedback

  • Acoustic Interaction: (Advanced version) Simultaneously with the light change, the Arduino generates a "Theremin-style" tone on a piezo buzzer that changes pitch as the hand moves closer or further away.

ข้อมูล Frontmatter ดั้งเดิม

title: "Controlling LED's Using Ultrasonic Distance Sensor"
description: "Turns the 2 LED's on and off by calculating the distance of the object from the Ultrasonic Sensor."
author: "blackpanda856"
category: ""
tags:
  - "project"
  - "ultrasonic sensor"
  - "lights"
  - "ultrasonic sensor"
  - "arduino"
  - "tracking"
  - "kids"
  - "communication"
  - "data collection"
  - "monitoring"
views: 14707
likes: 1
price: 435
difficulty: "Intermediate"
components:
  - "1x Breadboard (generic)"
  - "1x 5 mm LED: Red"
  - "1x Ultrasonic Sensor - HC-SR04 (Generic)"
  - "1x Male/Female Jumper Wires"
  - "2x Resistor 1k ohm"
  - "1x Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires"
  - "1x 5 mm LED: Green"
  - "1x Arduino UNO"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://projects.arduinocontent.cc/b3c48669-2601-48ad-a75a-62d2bf2cb5a7.ino"
documentationLinks: []
passwordHash: "8b5cddbc27aa1740acb414e0c7cdf3104c73ee074cb265086863368af5fb7141"
encryptedPayload: "U2FsdGVkX1/zHAx6ZVbVNAQxNeyOTmm6tAVIh5+qEl2ZTbwW/WKiWMyABKalEwqoI57B2Ejs0CNNy56pRRtOZXVMmExmCKEgCTwBr3x9On0="
seoDescription: "Control LED based on distance using an Ultrasonic Distance Sensor in this easy Arduino project guide."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/controlling-leds-using-ultrasonic-distance-sensor-82844f_cover.jpg"
lang: "en"