Gesture Controlled Lamp

A contactless interaction lamp powered by ultrasonic sensing, adaptive stability locking, and fluid motion algorithms. No switches. No buttons. Just magic.

Build Your Own

Intelligent Interaction

Follow Mode

The lamp continuously adjusts brightness based on hand distance. It feels organic and responsive.

  • Median-of-three filtering
  • Exponential Moving Average (EMA)
  • Uniform LED driving

Smart Locking

Hold your hand steady for 800ms to lock the brightness. The system intelligently filters natural hand tremors.

  • Adaptive stability band
  • Noise analysis (8-sample window)
  • Visual & Audio feedback

Palm-Off Gesture

A simple, intuitive gesture to shut it down. Bring your hand very close (≤ 2.8cm) and hold.

  • 1.2s hold duration
  • Anti-accidental wake window
  • Zero-touch shutdown

Proximity Wake

The lamp sleeps with one eye open. Wave your hand to wake it up without touching anything.

  • Low-power polling
  • Distance-based arming
  • False-positive rejection
800ms Lock Time
2-20cm Active Range
40ms Sample Rate
0.18 EMA Alpha

Hardware Architecture

Components

  • Microcontroller Arduino Uno / Nano
  • Sensor HC-SR04 Ultrasonic
  • Output 3x PWM LEDs
  • Feedback Passive Buzzer

Pinout

  • TRIG Pin 8
  • ECHO Pin 7
  • LEDs Pins 5, 6, 9
  • BUZZ Pin 11
graph TD Arduino[Arduino Uno/Nano] %% Ultrasonic Sensor HCSR04[HC-SR04 Sonar] Arduino -- D8 --> HCSR04(Trig) HCSR04(Echo) -- D7 --> Arduino %% LEDs LED1((LED 1)) LED2((LED 2)) LED3((LED 3)) Arduino -- D5 PWM --> LED1 Arduino -- D6 PWM --> LED2 Arduino -- D9 PWM --> LED3 %% Buzzer Buzzer[Passive Buzzer] Arduino -- D11 --> Buzzer style Arduino fill:#1e2636,stroke:#38bdf8,stroke-width:2px style HCSR04 fill:#1e2636,stroke:#818cf8 style LED1 fill:#1e2636,stroke:#c084fc style LED2 fill:#1e2636,stroke:#c084fc style LED3 fill:#1e2636,stroke:#c084fc style Buzzer fill:#1e2636,stroke:#94a3b8

Under the Hood

1. Signal Processing

Raw sonar data is noisy. We clean it up using a 3-stage pipeline: Median Filter → Range Clamping → Exponential Moving Average. This ensures the light doesn't flicker even if your hand shakes.

2. State Machine

The system moves fluidly between states: FOLLOW (Tracking), LOCKED (Fixed Brightness), and OFF (Deep Sleep). Transitions are governed by strict timing windows to prevent accidental triggers.

3. Non-Blocking Audio

A custom event-driven buzzer engine queues beeps without using delay(), ensuring the sensor loop never pauses while a sound is playing.

Future Roadmap

Sensing & Intelligence

Enhancing accuracy and adaptability.

  • Machine-learned gesture classification
  • Auto-calibrated distance bands
  • Multi-sensor fusion for better accuracy

Expanded Capabilities

New ways to interact and connect.

  • RGB fading with gesture
  • BLE/IoT control integration
  • Capacitive fallback sensing