Components:

- A 20lm high CRI LED, YJ-BC-2835L-G02-56.
- An Arduino Nano compatible board.
- A DS3231 Real Time Clock.
- A rotary encoder.
- A button.
- A TM1637 controlled 4 digit 7-segment LED display.
- A 3D-printed case.
- A few pull-up resistors and two transistors working as a current limiter for the LED.

Things I learned:

- 20lm is sufficient to make me think dawn has begun and feels like the sun is starting to rise.
- 16-bit PWM is sufficient to make the difference between on and off hard to perceive.
- I like an exponential brightness curve.
- The lamp works well as an addition to a sound based wake up alarm.

The device works as a alarm clock, but instead of making a sound at a determined time, it gradually increases the brightness of a lamp.

The interface consists of a button and a rotary input. Rotating the knob adjusts the light brightness, but it can switch to to adjusting other values by pressing the button. The other settings are:

- Current time
- Alarm on time
- A time to turn off the lamp
- Day of the week
- Set if the alarm is active on all days, weekdays, or never.

When the alarm on time is reach, the lamp gradually turns on during the next 16 minutes following an exponential curve from PWM level 1 to 65535. This approximately doubles the brightness every minute.

The LED is a high CRI LED from Yujileds. It is specified with a correlated color temperature of 5600K ±300 and CRI of 95±1. I measured its spectrum and got CIE 1931 xy:

x | 0.32742524 |

y | 0.34372004 |

This is a correlated color temperature of 5762K. The CRI is 95.13. Here is a graph of the measure spectrum from 380nm to 745nm.

- YJ-BC-2835L-G02, Yujileds. https://www.yujiintl.com/upload/file/2020/20200303/20200303182322_58721.pdf
- Electrokit, a web shop selling electronic components. https://www.electrokit.com

Uncheck the ease out option if the end of the curve should not transition back to straight.

Length of red line:

Turn size: ×

Save generated SVG image (mm)

Save generated SVG image (inch)

The image is generated as three separate curves after eachother:

- An Euler spiral from zero curvature to the curve radius.
- A circle arc with the curve radius.
- A reversed Euler spiral from the curve radius to zero curvature.

The Euler spirals are scaled to match the curvature to the circle arc where they are connected.

- Divide the angle into the three separate curve parts; an Euler spiral, a circle arch and a reversed Euler spiral.
- Calculate the length of the first Euler spiral given the angle, then scale it so it ends with the correct curvature.
- Draw the Euler spiral using scaled Fresnel S and C integrals.
- Draw the circle arc.
- If ‘ease out’ is selected, draw the reversed Euler sprial, rotated and translated to the correct possition.

- Track transition curve, Wikipedia. https://en.wikipedia.org/wiki/Track_transition_curve
- Euler spiral, Wikipedia. https://en.wikipedia.org/wiki/Euler_spiral
- Fresnel integral, Wikipedia. https://en.wikipedia.org/wiki/Fresnel_integral
- Power series, Wikipedia. https://en.wikipedia.org/wiki/Power_series