Projects / Aurora ring lamp

Aurora ring lamp

Beginner1.3 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANOUSB14.0 mA

    Join the grounds

    Adapter minus, ring GND and Nano GND together.

  2. NANOUSB14.0 mA

    Power the ring

    Adapter plus to ring 5V, with the 1000 uF capacitor across it.

  3. NANO14.0 mA

    Wire the data

    Nano D6 through the 330 ohm resistor to ring DIN.

  4. NANO

    Wire the knob

    Outer legs to 5V and GND, middle to A0.

  5. NANO14.1 mA

    Upload the sketch

    Soft green and blue colours drift round the ring.

  6. NANO

    Turn the knob

    The waves speed up and slow down.

  7. NANO14.1 mA

    Cover the ring with baking paper

    The glow becomes soft and even.

In short

How do you build an aurora ring lamp?

A ring of 16 LEDs fades slowly through greens, blues and purples like a northern light, with a knob for the speed and the brightness capped to stay gentle. A calm lamp for a desk or a shelf, and a way to learn smooth colour blending. You need Arduino Nano, WS2812B ring 16 LEDs, Potentiometer 10 kΩ, Resistor 330 Ω, Electrolytic capacitor 1000 µF, 5 V 2 A USB adapter, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 80 minutes.

Level
Beginner
Time
About 80 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 DINNano D6 through a 330 ohm resistorData line, resistor close to the ring
Ring 5V5 V adapter plus and capacitor plusPower from the adapter, not the Nano
Ring GNDAdapter minus, capacitor minus and Nano GNDAll the grounds joined
1000 uF capacitorAcross the ring's 5V and GNDLong leg to plus, steadies the supply
Pot outer legsNano 5V and GNDSets the speed
Pot middle legNano A0Speed from very slow to gentle

Code

Each LED in the ring is told its own colour 50 times a second. For every LED the sketch adds two slow sine waves, one that depends on the LED's position round the ring and one that moves at a different pace, and turns the answer into a number between 0 and 1. That number picks a colour along a path from green through blue to purple, blending smoothly in between, so soft patches of colour drift round the ring and never repeat exactly. The knob changes how fast the waves move, from almost still to a gentle drift. The brightness is capped in the sketch at 60 out of 255 so the lamp is calm, and so the supply and the LEDs stay cool; do not raise it much without a bigger supply. Power the ring from a 5 V adapter, not from the Nano, and join all the grounds, with the 1000 uF capacitor across the ring's power and a 330 ohm resistor close to the data pin. Connect the capacitor with the long leg to plus, and connect the ring to power before you plug the Nano in. Install "Adafruit NeoPixel" from the Library Manager. Put the ring behind a sheet of baking paper or a frosted jar to make a softer glow. Do not look straight into the LEDs from close up.

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).

// Library: Adafruit NeoPixel.
#include <Adafruit_NeoPixel.h>

const uint8_t DATA_PIN = 6;
const uint8_t LEDS = 16;
const uint8_t BRIGHT_MAX = 60;            // about a quarter, calm and easy on the eyes and the supply

Adafruit_NeoPixel ring(LEDS, DATA_PIN, NEO_GRB + NEO_KHZ800);

float phase = 0;
unsigned long lastFrame = 0;

// Blend between three aurora colours: green, blue, purple.
void colourAt(float s, uint8_t &r, uint8_t &g, uint8_t &b) {
  float p = s * 2.0;                      // 0..2
  float ar, ag, ab, br, bg, bb2, t;
  if (p < 1.0) { ar = 0;   ag = 220; ab = 80;  br = 0;   bg = 90; bb2 = 255; t = p; }        // green to blue
  else         { ar = 0;   ag = 90;  ab = 255; br = 150; bg = 0;  bb2 = 255; t = p - 1.0; } // blue to purple
  r = ar + (br - ar) * t;
  g = ag + (bg - ag) * t;
  b = ab + (bb2 - ab) * t;
}

void setup() {
  ring.begin();
  ring.setBrightness(BRIGHT_MAX);
  ring.show();
}

void loop() {
  unsigned long now = millis();
  if (now - lastFrame < 20) return;       // 50 frames a second
  float dt = (now - lastFrame) / 1000.0;
  lastFrame = now;

  float speed = 0.15 + analogRead(A0) / 1023.0 * 1.5;     // radians a second
  phase += speed * dt;
  if (phase > 6283.0) phase -= 6283.0;

  for (uint8_t i = 0; i < LEDS; i++) {
    // Two slow waves added together so the pattern never looks mechanical.
    float w = sin(phase + i * 0.45) + 0.5 * sin(phase * 0.6 + i * 0.9);
    float s = (w / 1.5 + 1.0) / 2.0;      // 0..1
    uint8_t r, g, b;
    colourAt(s, r, g, b);
    ring.setPixelColor(i, ring.Color(r, g, b));
  }
  ring.show();
}

Test checklist

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

CheckExpected
Power onColours fade in slowly, no flashing
Knob lowAlmost still, a very slow drift
Knob highA gentle, quicker wave
Watch for a minuteGreen, blue and purple all appear
Touch the ring after ten minutesIt stays cool

If it does not work

No light

Check the ring's 5V and GND and that DIN is the input side.

Wrong colours

Change NEO_GRB to NEO_RGB.

Flickers

Join all the grounds and fit the capacitor and resistor.

First LED wrong

Keep the 330 ohm resistor close to the ring.

Too dim or too bright

Change BRIGHT_MAX, but keep it low.

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

Ask Lark AI

Common questions

What parts do I need for the aurora ring lamp?

Arduino Nano, WS2812B ring 16 LEDs, Potentiometer 10 kΩ, Resistor 330 Ω, Electrolytic capacitor 1000 µF, 5 V 2 A USB adapter, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

How long does the aurora ring lamp take to build?

About 80 minutes for a beginner maker, in 7 steps.

How do I know the aurora ring lamp works?

Power on: Colours fade in slowly, no flashing. Knob low: Almost still, a very slow drift. Knob high: A gentle, quicker wave.

No light: what should I check?

Check the ring's 5V and GND and that DIN is the input side.

Wrong colours: what should I check?

Change NEO_GRB to NEO_RGB.

Flickers: what should I check?

Join all the grounds and fit the capacitor and resistor.

First LED wrong: what should I check?

Keep the 330 ohm resistor close to the ring.