Monday 24 December 2018

Christmas lights

Christmas lights are perfect partners for a Raspberry Pi at this time of year.  For those who are interested lightshowpi.org have developed an exceptional application to synchronise lights with (festive) music from a Raspberry Pi.  Software analyses music and depending on predominant frequencies (eg low, mid and high frequencies) and sends associated signals to GPIO pins so that lights can be turned on and off in time with the music.
Many people use Lightshowpi for outside lights, I don't have the facilities for outdoor music so I prefer to synchronise lights to music in my home.  Previously I haven't had much luck in getting a result I am happy with, but this year everything has fitted together nicely.

To start with I play music using MPD (Music Player Daemon) on my RPI 3B.  It deals with playlists, internet radio streams and music from NAS so that I can listen to what I want.  I use bluetooth speakers  so I dont need RPI next to the speakers and I don't need a cable from the RPI jack plug.

I configure MPD so that it creates a stream output on port 8000 and listen to that port in lightshowpi.  The software then does its magic and analyses the music.

For indoor use 5050 LED strips are perfect as a lighting display.  They have 3 wires controlling red, green and blue LEDs and work off 12V.
I tell lightshowpi that I am using 3 GPIO pins for output and connect the 3 pins to MOSFETs which raise the voltage to 12V output to drive RGB wires.
My bluetooth speakers have about a 2.7 second delay which I can program in to lightshowpi and I find that when I play music it is beautifully synchronised.