The Party Button – New Year’s Eve 2015

In mid December we decided to throw a New Year’s Eve party for our friends and I decided to do something a bit different. This gave me just under three weeks to create an exciting way to get the New Year’s Eve party moving into 2016 – The Party Button.

I’ve seen two previous party buttons – the older one from 2008 and a more recent. These are both very good, however I wanted to use a different song and our existing Christmas lights to create a fun party starter! Here it is…

At the core of this scene is a Raspberry Pi 2 controlling an 8-channel relay and an ESP8266 wifi module hidden inside an emergency stop button. The Pi is running a simple node.js server which waits for a GET request to ‘/start’ from the ESP8266. From there the code in the Pi simply starts the song and turns relays on/off depending on the milliseconds that have passed.

The Button

The Party Button
The Party Button
2x AA batteries and the ESP8266

Soldering wires directly onto the batteries allowed them to fit inside the emergency stop casing. The ESP8266 module is running a simple script which was written in the Arduino IDE. It can be found here on my GitHub. This just waits for the button to be pressed and then sends the HTTP GET request to the Raspberry Pi’s IP address. There is a flag set so that it doesn’t post twice.

The Raspberry Pi and Relays

Testing on the bench
Testing on the bench
Testing with LED
Testing with LED

I knew I was cutting it fine on the timings of this project (there was a definite deadline and it was only two weeks away!) One idea that was explored was using LightShowPi to do Fast Fourier Transforms on the music files and set of different relays depending on the frequency of the song notes. Unfortunately this didn’t work for me because the song – Final Countdown by Europe – had very definite musical ‘layers’ and the FFT routine did not pick out these. Also I wanted to set off additional relays at specific time intervals and LightShowPi doesn’t currently allow for this, although I’m sure it will in the future.

In the end I came across this instructables which did a very similar thing to what I was doing and gave the starting points to the Python code. It did mean however that I had to do a VERY manual process of listening to the song many, many times and writing down the millisecond of each beat of the drum, keyboard and vocals in a text file! You can see my Pi code and sequencing file here. Also here you can find the node.js server code that waits for the HTTP GET request to start everything off as well as the code to turn off my Samsung TV and WeMo switch as soon as the button is pressed.

Everything in situ
Everything in situ

Once everything was tested I bought a cheap plastic box and got some wood to fit in the lid and bottom. To these the hardware was screwed and cable tied in order to keep everyone safe and to stop things moving around. The sockets were bought from a local hardware shop and supermarket and the relay from eBay. I also purchased a very cheap USB sound card as I found this gave much better sound output from the Pi.

The Outputs

  • Christmas Tree providing the ‘drum beat’
  • Blue ceiling lights for the ‘keyboard’
  • Red fireplace lights for the ‘vocals’
  • Smoke machine
  • Laser
  • Strobe
Strobe Light
Strobe Light

Each of these were mains powered and were simply turned on/off at the right point in time with the music.

The red cable-tied lead is the one I added
The red cable tied lead is the one I added

The smoke machine worked slightly differently in that it had to stay powered to heat the smoke liquid. This instead was activated by connecting a wire to its remote lead and using the relay to act as its switch at the right time.

How I would improve on this

Time was a big issue in this project. I worked on this on the run up to Christmas Day but the real programming and hardware building happened on the 27th – 30th. On these days the alarm was set for 6:30am just to work on this! Inevitably some things didn’t make it… I wanted to incorporate my LED Matrix Sign, having it say ‘Final Countdown’ every time it was sang as well as having it flash when the siren was activated. Additionally I did want some things to happen wirelessly using some other Raspberry Pi’s. For a start I wanted to suspend the inflatable guitars from the ceiling and have them release via servo on the guitar solo part of the song – that would have been really cool. Secondly I wanted to set off some lights in the other room using a small relay, but that also got the cut.

It’s been one of the most entertaining things I have made and people seem to really enjoy watching it so that’s what counts. It certainly set up our New Year’s Eve party!

RGB LED Matrix sign using Raspberry Pi Zero

In order to be a bit more technically festive this Christmas, I created this 10×10 RGB LED sign. These are 100 WS2811s running off the brand new Raspberry Pi Zero and powered from my converted PC power supply. They are unceremoniously punched through some old cardboard I had from Amazon deliveries. Watch the video to see it in action.

I have powered the Raspberry Pi Zero directly via the 5v GPIO pin. This meant that I only had to have one power cable to the sign and it would power both the Pi and the LEDs. They are quite power hungry so using the converted power supply was a good choice for this.

The Pi is running Python code originally from Andrew Oakley which was very handy as he had done exactly what I wanted to achieve only a few weeks before! This meant I had the whole sign up and running within a few days. My code and animations can be found on my GitHub repository.

To create the animations, I used the fantastic Piskel App.

Convert PC Power Supply into Bench Power Supply

A properly regulated power supply was something that had been missing from my home workbench for some time.  I needed something that would do the job but with minimal cost and was intrigued when I found it could be achieved by repurposing a PC power supply.

It turns out this is quite a common thing to do so naturally there were many instructables detailing how to do it.  The main requirement for me was to have 3V3, 5V, 12V and GND lines available and for them to be beefy enough to power anything I could throw at it.  Most of my projects so far have required ether 3V3 or 5V so to have this available and reliable at a flick of a switch means that I will spend a lot less time debugging issues that ultimately come down to the microprocessor/components being underpowered.

Having followed a few guides, I can happily report that it has been a success.  I added a USB port for it to use when not fully powered on – nicely secured with Sugru.  Looking forward to a power-glitch free future.