Projects / Egg timer ring

Egg timer ring

Beginner2 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO

    Install the library

    Search for Adafruit NeoPixel in the Library Manager.

  2. NANO16.6 mA

    Wire the ring

    DIN through 330 ohm to D6, 5V and GND, capacitor across the supply.

  3. NANO

    Wire the button and buzzer

    Button D2 to GND, buzzer D8 to GND.

  4. NANO

    Upload the sketch

    Two blue dots show for medium.

  5. NANO

    Press briefly

    The dots change to one, two or three.

  6. NANO16.7 mA

    Hold for one second

    A beep, then green LEDs begin to fill.

  7. NANO16.7 mA

    Test with 6 changed to 0.2 minutes

    The ring fills in 12 seconds and alarms.

  8. NANO

    Set the times back

    Upload with 6, 8 and 11.

In short

How do you build an egg timer ring?

A 16-LED ring fills up as the minutes pass and a buzzer sounds when your egg is done. You need Arduino Nano, WS2812B ring 16 LEDs, Tactile push button 6 mm, Passive buzzer, Resistor 330 Ω, Electrolytic capacitor 470 µF, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 8 steps and about 120 minutes.

Level
Beginner
Time
About 120 min
Parts
8

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Ring DIN through 330 ohmNano D6Data line, resistor close to the ring
Ring 5V and GNDNano 5V and GNDKeep brightness low so USB can supply it
470 microfarad capacitorAcross ring 5V and GNDLong leg to 5V, smooths the supply
Start buttonNano D2 to GNDInternal pull-up, pressed reads LOW
Passive buzzer plus and minusNano D8 and GNDAlarm tone

Code

The ring is made of 16 WS2812 LEDs, each with its own tiny controller, wired in a chain so a single data pin sets the colour of every LED. The Adafruit NeoPixel library handles the precise timing. The sketch is a three-state machine: select, running and done. In select mode a short press cycles through three presets, shown as one, two or three blue dots, and holding the button for a second starts the timer. While running, one more green LED fills in each sixteenth of the total time, and the LED that is currently filling glows brighter as its time runs out, so you can see progress even between LEDs. When the time is up the ring flashes red and the buzzer beeps until you press the button. Typical times for a medium egg dropped into boiling water are about 6 minutes for soft, 8 for medium and 11 for hard, but your egg size and altitude change this, so adjust the MINUTES table. Brightness is limited to 60 out of 255 so the 16 LEDs draw well under the 500 milliamps a USB port can give. The 330 ohm data resistor and the capacitor protect the first LED from voltage spikes.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

#include <Adafruit_NeoPixel.h>

const uint8_t RING_PIN = 6, BTN = 2, BUZ = 8;
const uint8_t N = 16;
Adafruit_NeoPixel ring(N, RING_PIN, NEO_GRB + NEO_KHZ800);

// Presets in minutes: soft, medium and hard boiled, counted from when the water boils.
const uint8_t MINUTES[3] = {6, 8, 11};
uint8_t preset = 1;                          // starts on medium

enum State { SELECT, RUNNING, DONE };
State state = SELECT;
unsigned long startMs = 0, totalMs = 0;
bool lastBtn = HIGH;
unsigned long pressedAt = 0;

void showSelect() {
  ring.clear();
  for (uint8_t i = 0; i <= preset; i++) ring.setPixelColor(i, ring.Color(0, 0, 30));   // 1 to 3 blue dots
  ring.show();
}

void showProgress(unsigned long elapsed) {
  float f = (float)elapsed / totalMs * N;      // how many LEDs worth of time has passed
  uint8_t full = (uint8_t)f;
  ring.clear();
  for (uint8_t i = 0; i < full && i < N; i++) ring.setPixelColor(i, ring.Color(0, 40, 0));
  if (full < N) {                              // the current LED glows brighter as time passes
    uint8_t g = 5 + (f - full) * 35;
    ring.setPixelColor(full, ring.Color(g, g, 0));
  }
  ring.show();
}

void setup() {
  pinMode(BTN, INPUT_PULLUP);
  pinMode(BUZ, OUTPUT);
  ring.begin();
  ring.setBrightness(60);
  showSelect();
}

void loop() {
  bool b = digitalRead(BTN);
  if (lastBtn == HIGH && b == LOW) pressedAt = millis();
  bool released = (lastBtn == LOW && b == HIGH);
  bool longPress = (b == LOW && millis() - pressedAt > 1000 && pressedAt != 0);
  lastBtn = b;

  switch (state) {
    case SELECT:
      if (released && millis() - pressedAt < 1000) { preset = (preset + 1) % 3; showSelect(); }
      if (longPress) {
        totalMs = (unsigned long)MINUTES[preset] * 60000UL;
        startMs = millis();
        state = RUNNING;
        pressedAt = 0;
        tone(BUZ, 1500, 100);
      }
      break;

    case RUNNING: {
      unsigned long elapsed = millis() - startMs;
      if (elapsed >= totalMs) { state = DONE; break; }
      showProgress(elapsed);
      if (longPress) { state = SELECT; pressedAt = 0; showSelect(); }   // hold to cancel
      break;
    }

    case DONE: {
      bool on = (millis() / 400) % 2 == 0;
      for (uint8_t i = 0; i < N; i++) ring.setPixelColor(i, on ? ring.Color(60, 0, 0) : 0);
      ring.show();
      if (on) tone(BUZ, 2000); else noTone(BUZ);
      if (released) { noTone(BUZ); state = SELECT; pressedAt = 0; showSelect(); }
      break;
    }
  }
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Short pressPreset changes
Hold for one secondTimer starts with one beep
Halfway throughEight green LEDs lit
At the endRing flashes red and the buzzer beeps
Press after the alarmReturns to select

If it does not work

Ring shows random colours

Check the data pin and add the 330 ohm resistor.

First LED wrong colour

Try NEO_RGB or NEO_GRB to match your ring.

Board resets

Lower the brightness or power the ring from a separate 5 V supply.

Timer short or long

Change MINUTES to suit your eggs and kitchen.

Buzzer quiet

Use a passive buzzer with tone().

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the egg timer ring?

Arduino Nano, WS2812B ring 16 LEDs, Tactile push button 6 mm, Passive buzzer, Resistor 330 Ω, Electrolytic capacitor 470 µF, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

How long does the egg timer ring take to build?

About 120 minutes for a beginner maker, in 8 steps.

How do I know the egg timer ring works?

Short press: Preset changes. Hold for one second: Timer starts with one beep. Halfway through: Eight green LEDs lit.

Ring shows random colours: what should I check?

Check the data pin and add the 330 ohm resistor.

First LED wrong colour: what should I check?

Try NEO_RGB or NEO_GRB to match your ring.

Board resets: what should I check?

Lower the brightness or power the ring from a separate 5 V supply.

Timer short or long: what should I check?

Change MINUTES to suit your eggs and kitchen.