January 27, 2020By Jason Cronquist← Back to Blog

Circadian Lights: Design Principles


Design Principles: Circadian Color Temperature Automation

Before creating an automation, it’s useful to list out exactly what you want to get out of it, identify exceptions, and think through any potential risks. In other words, we need a design.

Target User

This design will target someone whose sleep cycle roughly matches the sun. The over all principle will remain the same if you work nights, but you will need to modify the application to match your schedule.

Goals

At the highest level, we want to create a light schedule that helps promote wakefulness and induce a healthy sleep pattern. We will accomplish this goal by controlling the color temperature and intensity of lights to match the Sun, and improve on night-time lights.

We can achieve these goals by applying the following logic:

  • Match the Color Temperature and intensity of the Sun while the sun is up.
  • Match the Color Temperature and intensity of Sunrise/Sunset.
  • Match the Color Temperature and intensity of a fire at night
  • If the Sun sets before you’re ready for night (winter in the higher latitudes)
  • Maintain a comfortable Color Temperature and intensity during the evening
  • If the Sun sets after you’re ready for night (summer in the higher latitudes)
  • Go straight to Night Color Temperature and Intensity
  • Transition smoothly between all of the above
  • This should do it, but let’s expand on each item.

Matching Daylight

During the daylight hours, we want our lights to exhibit the same qualities as natural sunlight. This means high values for color temperature, or lots of blue light.

The blue light will suppress the release of melatonin (the sleep hormone) and increase alertness allowing your days to be productive. As the sun moves through the sky, the light swings through its color temperatures from very red light dominating at Sunrise, to very blue light dominating at solar noon, and finally back to red light at sunset.

Matching this pattern will make the lighting feel natural.

Matching Sunrise/Sunset

The color temperatures of Sunrise and Sunset are a little more complicated than they first appear.

Starting around one hour prior to dawn, the ambient light’s color temperature is very blue. The only light reaching you is light that has been reflected through the atmosphere via Rayleigh scattering, so only blue light reaches your home. Since this light source is indirect, it appears very dim as well.

When the sun breaches the horizon, the dominant light source is the Sun passing a lot of atmosphere due to the sun’s low position in the sky. Here Rayleigh scattering is acting as a filter on the blue light, so a majority of red light is reaching your home. This results in an orange-ish glow known in photography as the Golden Hour. Likewise at sunset, the same happens, but in reverse.

As the sun rises higher in the sky, the light passes through less and less atmosphere increasing the amount of blue in the light reaching your home. This intense blue light acts as a signal to your body to remain alert and active. We want to replicate this blue light to ensure maximum daytime energy.

Lowest Possible Color Temperature at Night

The cells in our eyes that trigger melatonin production are blind to light starting around 2200K. This is useful as it allows us to lower keep our homes illuminated without suppressing natural melatonin production.

When the sun sets too early or too late In the higher latitudes days don’t last very long. The lower amount of time spent under low color temperature light in winter leads to depression and Seasonal Affective Disorder (SAD). If the sun sets too early, about an hour or two before bed, we should set our lights to a fairly blue light so we can continue avoid over-producing melatonin during the waking hours. Not to mention you don’t really want to be cooking by candle light.

On the other hand, during Summer the sun stays up very late into the night. We won’t want to suppress melatonin production any later than we have to, so we should cut straight to low color temperature once the sun has set.

Smooth Transitions

The last requirement is fairly straightforward. You don’t want dramatic changes in your lights happening throughout your day. You want to blend one Color Temperature into another. The sudden change from the reddish light of night, to the Rayleigh scattered blue of pre-dawn is jarring and unnatural.

Exceptions

There will be times when all the rules outlined above just don’t work for you. If you’re hosting a New Years eve party, you’ll want to maintain a relatively high Color Temperature and Brightness well into the night to keep your guests alert and active. Likewise if you have a light-sensitive migraine, you won’t want your lights to continue pumping out bright blue light even if the sun is high in the sky.

There are likely more reasons why you will want to deviate from a pre-programmed schedule, but we don’t need to identify them all to account for them.

Which rooms to apply the automation

The last consideration we should think about is which rooms we want to automate. My recommendation is to only apply the automation to living spaces as opposed to sleeping spaces.

Sleeping spaces such as bedrooms, bathrooms, and closets require more nuanced automations than living spaces such as your living room, kitchen, and study.

Engineering The Automation

Framing the Challenges and their Solutions All of the requirements above require very finely tuned control over the color temperature and brightness of your lights at different times of the day. Writing one mathematical equation that incorporates all of these considerations is a very challenging problem, and frankly unnecessary.

Instead we can make use of user defined spline curves to approximate color curves and create transitions that feel right. Spline curves are used heavily in animation and game design to animate just about everything. They are simple to use and allow very detailed control over the aesthetic qualities of motion (I really wanted to say ‘time-variant systems’ for accuracy… but it’s just too wordy so it’s now a comment!).

We will need to create different curves for the different critical times of the day. This allows us to easily account for the shifting timing of the Sun, and satisfies the requirement outlined in the section When the Sun Sets Too Early or Too Late.

These curves will be broken down as follows:

  • Sunrise
  • Daylight
  • Sunset
  • Evening
  • Night

This is what each of those curves will look like.

sunrise-ct
sunrise-ct