---
title: "Custom sunrise alarm · Notes · Mike Lvoff"
description: "How I built a sunrise alarm: 19 IKEA bulbs around the bed, Home Assistant on a Raspberry Pi 5, and a light curve that starts 30 minutes before the alarm."
url: https://mikelvoff.com/notes/sunrise-alarm
author: Mike Lvoff
published: 2026-10-12
updated: 2026-10-12
---

# Custom sunrise alarm

[Mike Lvoff](https://mikelvoff.com/)

DIY · 4 min read

Custom-built hardware and software to make every morning pleasant, even under ever-gray winter skies. This is how I built it: the hardware first, then the software that runs the sunrise.

## Problem

In December 2023, Vilnius got [2.9 hours of sunshine](https://www.lrt.lt/en/news-in-english/19/2163006/lithuania-saw-less-than-9-hours-of-sunshine-in-december-least-sunny-month-on-record) in the whole month. I wanted my mornings to start with light, so I decided to build a sun.

![Vilnius business district and the Neris under a heavy grey sky.](https://mikelvoff.com/_astro/vilnius-neris.CYwE-MwR_188wDq.webp)

![Snowy rooftops and church towers of Vilnius under a flat, hazy sky.](https://mikelvoff.com/_astro/vilnius-rooftops.CspHhh-G_Z3gD9z.webp)

![A snowy forest on the edge of Vilnius under a white sky, seen from above.](https://mikelvoff.com/_astro/vilnius-forest.DqgOABk1_ZgcMLa.webp)

Vilnius. Photos by Piergiovanni Di Blasi, Aliaksei Lepik and Aleksas Stan on Unsplash.

## Research foundation

-   Van de Werken et al.

    Journal of Sleep Research · 2010

    ### [A dawn makes waking easier](https://doi.org/10.1111/j.1365-2869.2010.00828.x "Effects of artificial dawn on sleep inertia, skin temperature, and the awakening cortisol response")

    People who find mornings hard felt less sleepy after waking to a 30-minute artificial dawn.

-   Gabel et al.

    Chronobiology International · 2013

    ### [A 250-lux dawn lifts the mood](https://doi.org/10.3109/07420528.2013.793196 "Effects of artificial dawn and morning blue light on daytime cognitive performance, well-being, cortisol and melatonin levels")

    A dawn rising from 0 to 250 lux improved mood and well-being after short nights.

-   Partonen and Lönnqvist

    Journal of Affective Disorders · 2000

    ### [Bright winter light helps healthy people too](https://doi.org/10.1016/s0165-0327\(99\)00063-4 "Bright light improves vitality and alleviates distress in healthy people")

    Office workers given bright light in winter had more vitality and fewer depressive symptoms.

-   Smolders, de Kort and Cluitmans

    Physiology & Behavior · 2012

    ### [More lux, more energy](https://doi.org/10.1016/j.physbeh.2012.04.028 "A higher illuminance induces alertness even during office hours: findings on subjective measures, task performance and heart rate measures")

    At 1000 lux instead of 200, people felt less sleepy and more energetic.

## What’s needed

![Everything for the build on a table: a coil of flat black cable, a bag of lamp holders, boxes of IKEA KAJPLATS bulbs, a plug in its bag, a Home Assistant Connect ZBT-2 box, a Raspberry Pi 5, a UNI-T UT383 lux meter and a tool kit, next to a laptop and a notebook.](https://mikelvoff.com/_astro/sunrise-alarm-parts.BpZlVJ6__Z2d1556.webp)

Raspberry Pi 5 by [SimonWaldherr](https://commons.wikimedia.org/wiki/File:Raspberry_Pi_5_SBC.jpg) ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)) and UT383 by [Mortymore](https://www.flickr.com/photos/42537987@N07/44611158302) ([CC BY 2.0](https://creativecommons.org/licenses/by/2.0/)), cut out and added to my photo.

### Parts

-   15 IKEA KAJPLATS bulb, white spectrum
-   4 IKEA KAJPLATS bulb, colour
-   1 Flat cable with E27 lamp holders
-   1 Rewireable plug
-   1 Home Assistant Connect ZBT-2
-   1 Raspberry Pi 5 with Home Assistant

### Tools

-   Lux meter, UNI-T UT383
-   Tape measure
-   Utility knife
-   Screwdriver

## Hardware

### Step 01: Lay it out and wire the plug

I laid the cable on the floor along the walls and checked every holder with plain bulbs. Then I cut it to length and wired the plug.

-   ![A tape measure along the floor between a white chest of drawers and the bed, next to the black cable.](https://mikelvoff.com/_astro/measuring-the-floor.Dk0fX5Kh_TEFtR.webp)
-   ![The string light on the floor along the bed, with plain bulbs in the holders and the plug in the wall socket.](https://mikelvoff.com/_astro/string-light-on-the-floor.BLt4Yn3L_g8Rfc.webp)
-   ![My hand holding the open plug: a blue and a brown wire in the two outer terminals, under a red cord grip.](https://mikelvoff.com/_astro/wiring-the-plug.pkbWDHog_105YEE.webp)

### Step 02: Place it and pair the bulbs

Three strips run around the bed, each starting with a colour bulb. The ZBT-2 gives Home Assistant a Thread network, and every bulb pairs over Matter.

![Plan of my bedroom, not to scale: I lie in the bed with my head against the top wall, and three strips of bulbs sit on the floor around it, 5 on my left, 9 along the foot and 5 on my right. In a 5-second loop the 4 colour bulbs fade up deep red, warm to orange, and at 1801 K the white bulbs join in the same colour, until the whole room is cool white, then it fades back to dark.](https://mikelvoff.com/_astro/room-4-2750k.Df0Hi9Ai.jpg)

Rough representation

## Software

### Step 03: Set the target

The target is the light at my eyes, staring at the ceiling: 0.1 lux of ember red 30 minutes before the alarm, 250 lux at wake, and 703 lux of cool white 20 minutes later.

Target light at the pillow

| Time | Light | Colour temperature |
| --- | --- | --- |
| 30 min before | 0.1 lux | 1000 K |
| 27.5 min before | 0.5 lux | 1050 K |
| 25 min before | 1.2 lux | 1090 K |
| 22.5 min before | 2.5 lux | 1200 K |
| 20 min before | 5 lux | 1300 K |
| 17.5 min before | 8 lux | 1400 K |
| 15 min before | 13 lux | 1500 K |
| 12.5 min before | 22 lux | 1650 K |
| 10 min before | 35 lux | 1800 K |
| 8 min before | 55 lux | 2000 K |
| 6 min before | 78 lux | 2200 K |
| 5 min before | 95 lux | 2300 K |
| 4 min before | 120 lux | 2400 K |
| 3 min before | 150 lux | 2500 K |
| 2 min before | 185 lux | 2600 K |
| 1 min before | 220 lux | 2700 K |
| At the alarm | 250 lux | 2750 K |
| 5 min after | 300 lux | 3000 K |
| 10 min after | 400 lux | 4000 K |
| 20 min after | 703 lux | 6000 K |

Light at the pillow on a log scale, in the colour of each moment.

### Step 04: Go below 1801 K

In colour-temperature mode the colour bulbs stop at 1801 K. As a raw colour point they go lower, so I send the point where a 1000 K blackbody sits on the colour chart.

## Result

![The same bedroom in three panels: lit deep red, then amber, then warm white.](https://mikelvoff.com/_astro/sunrise-alarm-result.CfGetA6O_ZWluUC.webp)

A compilation of three states. In real life, the change is gradual.

## Contact

-   [mike.lvoff@gmail.com](mailto:mike.lvoff@gmail.com)
-   [LinkedIn](https://www.linkedin.com/in/mike-lvoff/)
-   [GitHub](https://github.com/mike-lvoff)
