Skip to content

No more boring Christmas tree lights! πŸŽ„βœ¨

Notifications You must be signed in to change notification settings

corinm/fairylights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

fairylights

Tired of off-the-shelf red, green, blue, yellow Christmas lights, I designed this program to create much more pleasing Christmas tree light effects.

Requirements

  • A raspberry pi
  • Some WS2811 individually-addressable LED lights and power supply
  • Jumper wires to connect raspberry pi to lights

See this video for further details on how to get started with RPi and WS2811

Quick start

⚠️ Will only work on RaspberryPi

sudo pipenv install
sudo python3 src/main.py

sudo is required so that rpi-ws281x can use GPIO pin 18 (PWM)

Setup to run on start-up

  1. Set up a service for the lights and http api

    1. Create service

      sudo systemctl --force --full edit fairylights.service
      
    2. Paste and save the config from here

  2. Set up a service for the web page

    1. Create service

      sudo systemctl --force --full edit fairylights-page.service
      
    2. Paste and save the config from here

  3. Start the services

    sudo systemctl start fairylights.service fairylights-page.service
    

Modes

This is an FSM that controls how the lights move between patterns - whether the lights stay on one pattern or cycle throught them

Cycle

Cycles through all available patterns

Static

Stay on a specific pattern indefinitely

Off

Lights are off

Patterns

This is another FSM where each state represents a specfic pattern. This is primarily a combination of an effect (twinkling, glittering etc.) and a colour scheme (retro colours, random complimentary colours etc.). This FSM is controlled by the outer Modes FSM.

Effects

Twinkle

This is a twinkling effect where bulbs fade in and out at random. This effect ensures a nice spread across the whole chain by splitting it up into 'buckets' and not selecting multiple bulbs in a row from the same bucket.

Glitter

A glittering effect, created by reusing the Twinkle effect, speeding it up and dimming the lights.

Fireflies

This effects chooses bulbs at random to glow a yellow-green colour. Active bulbs are added in waves, but individual bulbs have a random delay so they don't all start at once, giving the effect a more organic feel.

Inspired by:

Cycle

Creates a gradient across the entire strand and cycles it along over time.

Based on jgarff/rpi_ws281x strandtest.py example

Flickering fairy lights (DISABLED)

Inspired by this Youtube video

Needs some work / doesn't look great right now

Colours

These are either: lists of hard-coded colours, a list of palettes (a list of lists of colours) or an algorithm that generates colours on the fly

Retro fairy lights

Inspired by vintage fairy lights e.g. Noma Pickwick. Made up of hand-picked colours: Pink, red, orange, green, blue

Noma Pickwick vintage lights

Source: Pinterest

Analagous colours

Creates a palette made up of 3 colours that are next to each other on the colour wheel.

Analogous colours

Source: https://decoart.com/blog/article/318/color_theory_basics_the_color_wheel

Analagous weighted colours

As above, but colours are chosen such that 5 colours are selected from 3x 1/12 arcs of the colours wheel, and saturation and luminance are varied. This is designed to replicate how colour theory is used in artwork and should create a more visually interesting selection of colours.

Complementary colours

Iterates through pairs of colours that are opposite each other on the colour wheel (e.g. green and red or violet and yellow).

Complementary colours

Source: https://decoart.com/blog/article/318/color_theory_basics_the_color_wheel

Split complementary

Rather than choosing colours opposite on the colour wheel it chooses one colour, then two colours either side of the colour opposite on the wheel (e.g. blue-violet and shades and multiple tints of yellow and orange).

Split complementary

Source: https://uxplanet.org/how-to-use-a-split-complementary-color-scheme-in-design-a6c3f1e22644

Golden angle / every 137 Degrees

This algorithm uses an approximation of the golden angle (137.5Β°) to select colours that don't repeat very often.

Golden angle

Source: https://simple.wikipedia.org/wiki/Golden_ratio

Colour wheel

This algorithm generates colours that gradually rotate around the colour wheel starting at a random starting position (e.g. red -> red-violet -> violet -> violet-purple etc.).

Coolor palettes

These palettes were chosen from some of the highest rates palettes from coolors.co

About

No more boring Christmas tree lights! πŸŽ„βœ¨

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published