How to Build a Rocket Launch Alarm Clock with ESP32

Morning alarm with countdown animation, launch lights, and liftoff sound

ESP32Smart HomeBeginner40 minutes4 components

Updated

How to Build a Rocket Launch Alarm Clock with ESP32
For illustrative purposes only
On this page

What you'll build

In this guide you will build a rocket-launch alarm clock using an ESP32, a DS3231 real-time clock module, a WS2812B LED ring, a piezo buzzer, an OLED display, and a pair of buttons for setting the time and alarm. When the alarm triggers, instead of a boring beep you get a full 10-second launch countdown -- the OLED displays large descending numbers, the LED ring fills up segment by segment like a fuel gauge, and at zero the LEDs burst into a fiery orange-and-white liftoff animation while the buzzer blasts an ascending rocket roar. A snooze button gives you five more minutes of pre-launch hold, and a dismiss button cuts the engines immediately.

The DS3231 is the gold standard for battery-backed real-time clocks in maker projects. Its temperature-compensated crystal oscillator maintains accuracy to within a couple of minutes per year, and it keeps ticking through power outages thanks to a coin-cell backup. In this project you will learn how to communicate with the DS3231 over I2C, set and read time registers, configure its built-in alarm interrupt to wake the ESP32 from deep sleep, and synchronize the displayed time on the OLED. You will also implement a simple two-button time-setting interface with long-press detection for fast-scrolling through hours and minutes -- a useful UX pattern for any embedded device with limited inputs.

The finished alarm clock is a genuinely useful bedside device that makes waking up a little more entertaining. Because the DS3231's alarm interrupt drives a hardware pin, the ESP32 can spend the night in deep sleep drawing microamps until launch time, making the project practical for battery-powered operation. From here you could add Wi-Fi time synchronization via NTP to eliminate manual time setting, integrate a light sensor to auto-dim the display at night, or swap the buzzer for a small amplifier and speaker to play actual rocket launch audio. It is a beginner-friendly project that teaches RTC interfacing, low-power design, and sequenced multimedia output in one satisfying build.

Wiring diagram

Wiring diagram

Interactive wiring diagram

Components needed

ComponentTypeQtyBuy
DS3231 RTCsensor1€3.35
WS2812B LED Ringactuator1
Piezo Buzzeractuator1€4.75
Snooze Buttonother1€8.30

Prices and availability are indicative and may have been updated by the supplier. Schematik may earn a commission from purchases made through affiliate links.

Assembly

1

Set up timekeeping

Connect DS3231 RTC to I2C pins GPIO21 and GPIO22.

2

Add launch feedback hardware

Connect LED ring on GPIO4, buzzer on GPIO26, and snooze button on GPIO27.

Pin assignments

PinConnectionType
GPIO 21rtc-1 SDAI2C
GPIO 22rtc-1 SCLI2C
GPIO 4launch-led-ring-1 DINDATA
GPIO 26launch-buzzer-1 SIGPWM
GPIO 27snooze-button-1 SIGDIGITAL

Code

#include <Wire.h>
#include <RTClib.h>
#include <FastLED.h>

#define LED_PIN 4
#define NUM_LEDS 16
#define BUZZER_PIN 26
#define BTN_SNOOZE 27

RTC_DS3231 rtc;
CRGB leds[NUM_LEDS];
int alarmHour = 7;
int alarmMinute = 30;
bool alarmFiredToday = false;

void setup() {
  Wire.begin(21, 22);
  rtc.begin();
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);
  pinMode(BTN_SNOOZE, INPUT_PULLUP);
  pinMode(BUZZER_PIN, OUTPUT);
}

void runLaunchSequence() {
  for (int t = 10; t >= 0; t--) {
    fill_solid(leds, NUM_LEDS, CHSV((10 - t) * 20, 255, 180));
    FastLED.show();
    tone(BUZZER_PIN, 700 + t * 90, 120);
    delay(220);
  }
}

void loop() {
  DateTime now = rtc.now();
  if (now.hour() == alarmHour && now.minute() == alarmMinute && !alarmFiredToday) {
    runLaunchSequence();
    alarmFiredToday = true;
  }

  if (now.hour() == 0 && now.minute() == 0) alarmFiredToday = false;
  if (!digitalRead(BTN_SNOOZE)) {
    tone(BUZZER_PIN, 550, 120);
    delay(300);
  }
}

// Run this and build other cool things at schematik.io
Libraries: RTClib, FastLED