Circular LED Clock with Proximity Sensor Display using Arduino & NeoPixels

 

If you love creative electronics projects, this Circular LED Clock with Proximity Sensor Display is a perfect DIY project. Using 60 NeoPixel LEDs arranged in a ring, this smart clock visually represents hours, minutes, and seconds using different colors. The project also integrates an HC-SR04 ultrasonic sensor, allowing users to change the clock display mode simply by waving their hand near the sensor.

This project is ideal for Arduino enthusiasts, robotics students, and IoT beginners who want to build a visually appealing and interactive digital clock.


Why Build a Circular LED Clock?

Traditional clocks use mechanical hands, but modern electronics allow us to create dynamic LED clocks with interactive features. This project demonstrates how addressable LEDs and sensors can be combined to build a futuristic display.


Key Benefits

  • Interactive gesture control

  • Attractive LED visualization

  • Hands-free display mode switching

  • Great learning project for Arduino programming


Components Required

To build the Circular LED Clock with Proximity Sensor, you will need the following components:

  • Arduino Uno / Nano

  • 60 LED NeoPixel Ring (WS2812B)

  • HC-SR04 Ultrasonic Sensor

  • Real Time Clock (RTC) Module (DS3231 recommended)

  • Breadboard

  • Jumper wires

  • 5V Power Supply

  • 330Ω resistor

  • 1000µF capacitor (recommended for NeoPixels)

Diagram.json:
{
  "version": 1,
  "author": "NeoPixel Clock",
  "editor": "wokwi",
  "parts": [
    {
      "type": "wokwi-arduino-mega",
      "id": "mega",
      "top": 200,
      "left": 100,
      "attrs": {}
    },
    {
      "type": "wokwi-led-ring",
      "id": "ring1",
      "top": -180,
      "left": -180,
      "attrs": { "pixels": "60" }
    },
    {
      "type": "wokwi-hc-sr04",
      "id": "sonar1",
      "top": 450,
      "left": 250,
      "attrs": { "distance": "25" }
    },
    {
      "type": "wokwi-pushbutton",
      "id": "btnA",
      "top": 450,
      "left": 50,
      "attrs": { "color": "blue" }
    },
    {
      "type": "wokwi-pushbutton",
      "id": "btnB",
      "top": 450,
      "left": 130,
      "attrs": { "color": "green" }
    }
  ],
  "connections": [
    ["ring1:GND",    "mega:GND.1",   "black",  []],
    ["ring1:VCC",    "mega:5V",      "red",    []],
    ["ring1:DIN",    "mega:6",       "green",  []],

    ["sonar1:GND",   "mega:GND.2",   "black",  []],
    ["sonar1:VCC",   "mega:5V",      "red",    []],
    ["sonar1:TRIG",  "mega:10",      "orange", []],
    ["sonar1:ECHO",  "mega:11",      "yellow", []],

    ["btnA:1.l",     "mega:2",       "blue",   []],
    ["btnA:2.l",     "mega:GND.3",   "black",  []],

    ["btnB:1.l",     "mega:3",       "green",  []],
    ["btnB:2.l",     "mega:GND.4",   "black",  []]
  ]
}


How the Circular LED Clock Works

The clock uses 60 NeoPixels arranged in a circular ring, representing the 60 seconds or minutes in a clock face.

Each LED represents a position on the clock:

  • 🔴 Red LED → Hour indicator

  • 🔵 Blue LED → Minute indicator

  • 🟢 Green LED → Second indicator

The RTC module keeps accurate time, while the Arduino reads the current time and lights up the LEDs accordingly.

Code:

// =====================================================
//  NEOPIXEL RING CLOCK — Wokwi Arduino MEGA
//  Part:    wokwi-led-ring  (pixels=60)
//  Library: Adafruit NeoPixel
//  Pins:    DIN→6, TRIG→10, ECHO→11, BTN_A→2, BTN_B→3
// =====================================================
#include <Adafruit_NeoPixel.h>

#define LED_PIN    6
#define NUM_LEDS   60
#define TRIG_PIN   10
#define ECHO_PIN   11
#define BTN_A      2
#define BTN_B      3

Adafruit_NeoPixel ring(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

int hh = 10, mm = 9, sc = 0;   // sc instead of SS (SS is reserved by SPI)
unsigned long prevMs = 0;
uint8_t dispMode = 0;
bool prevA = HIGH, prevB = HIGH;
unsigned long dbA = 0, dbB = 0;

// --- ultrasonic ---
long ping() {
  digitalWrite(TRIG_PIN, LOW);  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH); delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);
  long t = pulseIn(ECHO_PIN, HIGH, 23000);
  return t ? t * 17L / 1000 : 60;
}

// --- colour wheel 0-255 ---
uint32_t wheel(uint8_t p) {
  p = 255 - p;
  if (p < 85)  return ring.Color(255-p*3, 0,       p*3);
  if (p < 170) { p -= 85;  return ring.Color(0,     p*3, 255-p*3); }
                 p -= 170; return ring.Color(p*3, 255-p*3, 0);
}

uint32_t scalec(uint32_t c, uint8_t f) {
  return ring.Color(
    ((c>>16)&0xFF)*f/255,
    ((c>> 8)&0xFF)*f/255,
    ( c     &0xFF)*f/255);
}

// ---- MODE 0 : Clock ----
void modeClock() {
  ring.clear();
  for (int i = 0; i < 60; i += 5)
    ring.setPixelColor(i, ring.Color(14, 14, 14));

  // hour (red)
  int hc = (int)round(((hh%12)*60.0f + mm) / 720.0f * 60.0f) % 60;
  for (int d = -2; d <= 2; d++) {
    int px = (hc+d+60)%60;
    uint8_t b = (d==0)?230:(abs(d)==1?100:35);
    uint32_t old = ring.getPixelColor(px);
    ring.setPixelColor(px, ring.Color(min(255,(int)((old>>16)&0xFF)+b),(old>>8)&0xFF,old&0xFF));
  }
  // minute (green)
  int mc = (int)round((mm*60.0f+sc)/3600.0f*60.0f) % 60;
  ring.setPixelColor((mc-1+60)%60, scalec(ring.Color(0,255,80),70));
  ring.setPixelColor(mc,            ring.Color(0,255,80));
  ring.setPixelColor((mc+1)%60,    scalec(ring.Color(0,255,80),70));
  // second (cyan)
  ring.setPixelColor(sc%60, ring.Color(0,210,255));
  ring.show();
}

// ---- MODE 1 : Equalizer ----
uint8_t eqH[8] = {20,42,16,52,34,28,46,22};
int8_t  eqV[8] = { 1,-1, 1,-1, 1,-1, 1,-1};
unsigned long eqMs = 0;

void modeEQ() {
  if (millis()-eqMs > 65) {
    for (int i=0;i<8;i++) {
      eqH[i] += eqV[i]*(int8_t)random(2,7);
      if (eqH[i]>=58||eqH[i]<=4){eqV[i]=-eqV[i];eqH[i]=constrain(eqH[i],4,58);}
    }
    eqMs = millis();
  }
  ring.clear();
  for (int b=0;b<8;b++) {
    int ctr = b*7+3;
    uint8_t br = map(eqH[b],4,58,40,255);
    uint32_t c = wheel(map(eqH[b],4,58,0,185));
    for (int d=-2;d<=2;d++) {
      int px = (ctr+d+60)%60;
      uint8_t f = (d==0)?255:(abs(d)==1?130:45);
      ring.setPixelColor(px, scalec(c,(uint16_t)br*f/255));
    }
  }
  ring.show();
}

// ---- MODE 2 : Radar ----
int radarHead = 0;
unsigned long radarMs = 0;

void modeRadar() {
  if (millis()-radarMs > 22){radarHead=(radarHead+1)%60; radarMs=millis();}
  ring.clear();
  for (int i=0;i<18;i++){
    int px=(radarHead-i+60)%60;
    ring.setPixelColor(px, ring.Color(0, map(i,0,17,210,4), 0));
  }
  long cm = ping();
  if (cm < 40){
    int obj = map(cm,2,40,0,59);
    ring.setPixelColor(obj,            ring.Color(255,80,0));
    ring.setPixelColor((obj+1)%60,     ring.Color(80,20,0));
    ring.setPixelColor((obj-1+60)%60,  ring.Color(80,20,0));
  }
  ring.show();
}

// ---- MODE 3 : Rainbow ----
uint16_t rbPos = 0;
unsigned long rbMs = 0;

void modeRainbow() {
  long cm = constrain(ping(),2,40);
  uint8_t spd = map(cm,2,40,14,1);
  if (millis()-rbMs > spd){rbPos=(rbPos+1)%256; rbMs=millis();}
  for (int i=0;i<NUM_LEDS;i++) ring.setPixelColor(i, wheel((i*4+rbPos)&0xFF));
  ring.show();
}

// ---- buttons ----
void checkButtons() {
  unsigned long now = millis();
  bool a = digitalRead(BTN_A);
  bool b = digitalRead(BTN_B);
  if (prevA==HIGH && a==LOW && now-dbA>200){
    dispMode=(dispMode+1)%4; dbA=now;
    ring.fill(ring.Color(25,25,25)); ring.show(); delay(55); ring.clear();
  }
  if (prevB==HIGH && b==LOW && now-dbB>200){
    mm=(mm+5)%60; sc=0; dbB=now;
  }
  prevA=a; prevB=b;
}

void setup() {
  ring.begin();
  ring.setBrightness(75);
  ring.show();
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(BTN_A, INPUT_PULLUP);
  pinMode(BTN_B, INPUT_PULLUP);
  // boot spiral
  for (int i=0;i<NUM_LEDS;i++){ring.setPixelColor(i,wheel(i*4));ring.show();delay(16);}
  delay(250);
  for (int i=NUM_LEDS-1;i>=0;i--){ring.setPixelColor(i,0);ring.show();delay(9);}
  prevMs = millis();
  randomSeed(42);
}

void loop() {
  checkButtons();
  if (millis()-prevMs >= 1000){
    prevMs += 1000;
    if(++sc >= 60){ sc=0; if(++mm >= 60){ mm=0; if(++hh >= 24) hh=0; }}
  }
  switch(dispMode){
    case 0: modeClock();   break;
    case 1: modeEQ();      break;
    case 2: modeRadar();   break;
    case 3: modeRainbow(); break;
  }
  delay(8);
}



Gesture Control with Ultrasonic Sensor

The HC-SR04 ultrasonic sensor detects hand movement in front of the clock.

When you wave your hand near the sensor, the display mode changes.

Display Modes

Mode 1 – Classic Clock Mode

  • Hour, minute, and second LEDs displayed simultaneously.

Mode 2 – Minimal Mode

  • Only hour and minute LEDs displayed.

Mode 3 – Seconds Animation

  • LEDs animate like a rotating second hand.

Mode 4 – Rainbow LED Mode

  • Entire ring glows with animated color patterns.

This feature makes the clock touchless and interactive, giving it a futuristic feel.


Circuit Connections

NeoPixel Ring

  • VCC → 5V

  • GND → GND

  • Data → Arduino Pin 6

Ultrasonic Sensor

  • VCC → 5V

  • GND → GND

  • TRIG → Arduino Pin 9

  • ECHO → Arduino Pin 10

RTC Module

  • VCC → 5V

  • GND → GND

  • SDA → A4

  • SCL → A5


Arduino Code Overview

The Arduino program performs three main tasks:

  1. Reads current time from the RTC module

  2. Controls the NeoPixel LEDs to represent clock hands

  3. Uses the ultrasonic sensor to detect gestures and change modes

Libraries typically used:

  • Adafruit NeoPixel Library

  • RTClib Library

These libraries simplify LED control and time reading.


Applications of LED Clock Project

This project is not just a decorative gadget but also a great educational tool.

Possible uses include:

  • Robotics and electronics learning projects

  • STEM classroom demonstrations

  • Smart home décor

  • Arduino programming practice

  • Interactive IoT prototype


Tips for Better Performance

  • Use an external 5V power supply for the NeoPixel ring.

  • Add a 1000µF capacitor across power lines to protect LEDs.

  • Use a DS3231 RTC module for accurate timekeeping.

  • Keep the ultrasonic sensor unobstructed for better gesture detection.




Final Thoughts

The Circular LED Clock with Proximity Sensor Display combines LED visualization, sensors, and Arduino programming to create an innovative interactive clock. With gesture control and colorful NeoPixel animations, this project is both educational and visually impressive.

If you enjoy Arduino, IoT, and robotics projects, this DIY LED clock is a fantastic addition to your project collection.

🔵 1. Arduino Basics & Learning

1.Basics Electronics
2.Login Steps (Tinkercad)
3.Electronic Components
4.Arduino UNO Introduction
5.Different Types of Electronic Components
6.7 Segment Display

🟢 2. Beginner Arduino Projects

7.Soil Moisture Based Watering System

8.Servo Control Using Potentiometer

9.Traffic Light Using 7 Segment Display

10.Ultrasonic Distance Measurement

11.PIR Based Theft Alert System

12.Temperature Controlled Fan

13.LDR Controlled Street Light

14.LCD Interface with Arduino UNO

15.Kids Piano Using Arduino

16.LPG Gas Leakage Detection

17.Automatic Door Locking System

18.Joystick Interface with Arduino UNO

19.Robo Arm & Leg Control Using Servo

20.Automatic Parking System

21.Simple Clock Using Arduino UNO

22.Automatic Voting Machine Using Arduino UNO

23.Temperature Measurement Using Arduino

24.Home Automation Using Arduino UNO

25.PIR Based Security Alarm System

26.DC Motor Speed Control


🔴 3. Arduino Robotics Projects

27.RC Car Using L293D

28.Bluetooth RC Car

29.Smart Irrigation Using Arduino

30.Arduino UNO to LCD Display

31.Arduino Radar System

32.NeoPixel Ring Lighting

33.Bi-Directional People Counter

34.Automatic Plant Watering System

35.RGB Lamp Control

36.Obstacle Avoiding Robot

37.Line Follower Robot

38.Smart Gloves for Bedridden People


🟢 4. IoT & Smart System Projects

39.IoT Weather Monitoring System

40.ESP8266 Smart Health & Environment Monitoring

41.ESP32 Wi-Fi Weight Sensor (HX711)

42.Smart RFID Access Control System

43.Smart IoT Motor Control System

44.Smart Waste Management System

45.Raspberry Pi + GSM Ultrasonic Distance Monitor

46.Arduino UNO Smart Surveillance System

47.Arduino Environmental Monitoring with OLED

48.Smart Home Automation with Flame & IR Sensors

49.Arduino Nano Landslide Detection with GSM

50.Arduino Nano Rain-Sensing Stepper Motor

51.Automatic Tire Inflator

52.Automatic Cooker Using Servo & Sensors

53.Plastic Bottle Reverse Vending Machine

🚦 5. Smart Traffic & Smart City
54.RFID Based Smart Traffic Control
https://www.makemindz.com/2026/02/rfid-based-smart-traffic-control-system.html

55.Arduino Traffic Light Control
https://www.makemindz.com/2026/02/arduino-uno-traffic-light-control.html

56.Traffic Light with Joystick Interface
https://www.makemindz.com/2026/02/arduino-uno-controlled-traffic-light.html


🤖 6. Robotics Systems
57.Smart Obstacle Avoiding Robot

https://www.makemindz.com/2026/02/arduino-uno-smart-obstacle-avoiding.html

58.Autonomous Obstacle Avoidance Robot
https://www.makemindz.com/2026/02/arduino-powered-autonomous-obstacle.html

59.Bluetooth Controlled Line Follower Robot
https://www.makemindz.com/2026/02/arduino-nano-bluetooth-controlled-line.html

60.Bluetooth Controlled 4WD Robot
https://www.makemindz.com/2026/02/arduino-uno-bluetooth-controlled-4wd.html

61.Multi-Sensor Obstacle Avoidance Robot
https://www.makemindz.com/2026/02/arduino-uno-multi-sensor-obstacle.html

62.Raspberry Pi Motor Control Robot
https://www.makemindz.com/2026/02/raspberry-pi-motor-control-system-using.html

63.RC Car with L298N & Joystick
https://www.makemindz.com/2026/02/rc-car-simulation-with-l298n-motor.html

64.Raspberry Pi Robotic Arm with Camera
https://www.makemindz.com/2026/02/raspberry-pi-robotic-arm-control-system.html

65.ESP32 4WD Robot Car
https://www.makemindz.com/2026/02/esp32-based-4wd-robot-car-using-dual.html


📡 7. LoRa & Wireless Projects
66.Arduino LoRa Communication (RFM95W)

https://www.makemindz.com/2026/02/arduino-lora-communication-project.html

67.Arduino Nano LoRa SX1276
https://www.makemindz.com/2026/02/arduino-nano-with-rfm95-lora-sx1276.html

68.Arduino Nano Digital Clock DS3231
https://www.makemindz.com/2026/02/arduino-nano-digital-clock-using-ds3231.html


💡 8. LED & Display Projects
69.NeoPixel Ring Light Show

https://www.makemindz.com/2026/02/50-arduino-esp32-iot-projects-for.html

70.Wi-Fi Controlled NeoPixel Ring (ESP8266)
https://www.makemindz.com/2026/02/wi-fi-controlled-neopixel-ring-with.html

71.Chained NeoPixel Rings
https://www.makemindz.com/2026/02/chained-neopixel-rings-with-arduino.html

72.Lighting System with Gesture & Sound
https://www.makemindz.com/2026/02/arduino-nano-controlled-lighting-system.html

73.Raspberry Pi GPIO Multi-LED Control
https://www.makemindz.com/2026/02/raspberry-pi-gpio-multi-led-control.html

74.4 Channel Relay Module with Arduino UNO
https://www.makemindz.com/2026/02/4-channel-relay-module-using-arduino.html


🔍 9. Sensor & Detection Projects
75.Color Sensor + Proximity System

https://www.makemindz.com/2026/02/arduino-uno-based-color-sensor-and.html

76.Arduino Color Detection (TCS34725)
https://www.makemindz.com/2026/02/arduino-color-detection-project-using.html

77.Gas Leakage Detection (MQ-2)
https://www.makemindz.com/2026/02/arduino-gas-leakage-detection-and.html

78.MQ-135 Air Quality Monitor
https://www.makemindz.com/2026/02/mq-135-air-quality-detector-using.html

79.Pulse Sensor Monitoring System
https://www.makemindz.com/2026/02/pulse-sensor-using-arduino-complete.html

80.HX711 Load Sensor Demo
https://www.makemindz.com/2026/02/50-arduino-esp32-iot-projects-for.html

81.DS1307 RTC with 16x2 LCD
https://www.makemindz.com/2026/02/track-time-with-ds1307-rtc-and-display.html

82.Parking Sensor Simulator (HC-SR04)
https://www.makemindz.com/2026/02/parking-sensor-simulator-using-arduino.html


🎮 10. Fun & Interactive Projects
83.Pong Game with OLED Display

https://www.makemindz.com/2026/02/pong-game-with-arduino-uno-and-oled.html

84.Bluetooth Controlled Servo Motor
https://www.makemindz.com/2026/02/arduino-uno-bluetooth-controlled-servo.html

85.Touch and Distance Sensing System
https://www.makemindz.com/2026/02/arduino-uno-based-interactive-touch-and.html


🏭 11. Industrial & Automation Projects
86.Smart Waste Sorting System

https://www.makemindz.com/2026/02/arduino-uno-smart-waste-sorting-system.html

87.Smart Waste Segregation System
https://www.makemindz.com/2026/02/arduino-sketch-for-plastic-bottle-and.html

88.ESP32 Digital Weighing Scale
https://www.makemindz.com/2026/02/esp32-based-digital-weighing-scale.html


🚀 12. Advanced Projects
89.Smart Toll Gate Automation

https://www.makemindz.com/search?q=Arduino-Based+Smart+Toll+Gate+Automation+System

90.Automatic Pill Dispenser Machine
https://www.makemindz.com/search?q=Arduino-Based+Automatic+Pill+Dispenser+Machine

91.Smart Water Quality Monitoring
https://www.makemindz.com/search?q=Smart+Water+Quality+Monitoring+System

91.Ocean Cleaning Boat Robot
https://www.makemindz.com/search?q=Ocean+Cleaning+Boat+Robot

93.Accident Detection & Health Monitoring
https://www.makemindz.com/search?q=Accident+Detection+Health+Monitoring

94.Raspberry Pi RFID Smart Door Lock
https://www.makemindz.com/search?q=Raspberry+Pi+RFID+Keypad+Smart+Door+Lock

95.Smart Shopping Trolley with RFID
https://www.makemindz.com/search?q=Smart+Shopping+Trolley+Arduino+RFID

96.Automatic Hand Sanitizer Dispenser
https://www.makemindz.com/search?q=Automatic+Liquid+Hand+Sanitizer+Arduino

97.Robotic Weeding Machine
https://www.makemindz.com/search?q=Robotic+Weeding+Machine

98.Biometric Electronic Voting System
https://www.makemindz.com/search?q=Biometric+Electronic+Voting+System


99.Electronic Voting System with TFT Display
https://www.makemindz.com/search?q=Electronic+Voting+System+ILI9341+TFT

🟣 13. ESP32 Projects

100.ESP32 WiFi Scanner

https://www.makemindz.com/2026/02/esp32-wifi-scanner-using-wokwi-online.html

101.MQTT Weather Logger

102.ESP32 Gas Leak Detection System

103.OLED Display with ESP32

104.RGB LED Control with ESP32-S3 Sense


🟡 14. Arduino Wokwi Simulator Projects

105.Introduction to Wokwi Simulator

106.Kinetic Mandala Using Servo

107.Biometric Access System

108.ColorChord Musical Color Sequencer

109.32×32 LED Matrix with Arduino Mega

110.Password Based Lock System

111.Arduino RFID Access Control

112.Arduino Weather Station

113.Arduino Knight Rider LED Chaser

https://www.makemindz.com/2026/02/arduino-knight-rider-led-chaser-with.html

Comments