Configure TimeZone

Run the raspi-config command as shown below to select your Time Zone if it has not already been configured. 

  • Localisation Options
  • Change Timezone
  • Geographic Area
  • Time Zone
sudo raspi-config

Download the Code

The most convenient way to get the program on your Pi will be to use the 'wget' command from a terminal and place the script directly into your home directory.

wget https://raw.githubusercontent.com/adafruit/Adafruit_Learning_System_Guides/master/Circadian_Pi_Desk_Light/Circadian_Pi_Desk_Light.py

Running the Code

The desk light program can be launched once with the following command. It will automatically change the colors based on the time values placed in the script such as:

# morning BLUE light hours
# BLUE light is stimulating
start_morning = "06:00:00"
end_morning = "10:00:00"

# evening RED light hours
# RED light is calming allows melatonin production to increase
start_night = "18:00:00"
end_night = "22:00:00"
sudo python3 ./Circadian_Pi_Desk_Light.py

This guide was first published on Feb 18, 2019. It was last updated on Feb 18, 2019.

This page (Run it!) was last updated on Nov 12, 2021.

Text editor powered by tinymce.