With the CheerLights project Reindeers are no longer stuck with red noses! This is a quick guide detailing how I brought a bit of CheerLights Christmas cheer to the office.
Laser cut head
I'm using the excellent "Mounted Deer / Reindeer Head" by phenoptix which is licensed under the Creative Commons - Attribution - Share Alike license. I've modified the design to add a couple of notches to allow cables to be threaded through from front to back and add some holes to the nose. The design files contain two noses, one with a 5mm hole for threading cables etc and another for a standard 10mm LED; my editing in AutoCAD has bloated the file size a bit.
The design was cut from 3mm (ish) birch ply on a HPC Laserscript 3060 using a power level of 97% and a speed of 12 which seems about right for the material. Once cut a little bit of gentle sanding was required to make things fit nicely.
The CheerLights "necklace" was created in Inkscape, modified so that the characters touched and then cut from 3mm green Acrylic. It is surprisingly rigid given how fine the lettering is.
I'm using a WS2812B based NeoPixel for the nose, you can pick these up from most Adafruit resellers and various other places on the web. Controlling the NeoPixel is a Particle Photon which is tucked into the "neck" of the Reindeer head, the Photon connects to the CheerLights channel on ThingSpeak using WiFi and updates the NeoPixel colour according to the latest CheerLights value. The Photon is connected to the NeoPixel according to the diagram below, I used 3-core ribbon cable taken from a wider piece but any cable will do.
Once the Photon was connected to WiFi I used the Particle Web IDE to write some code. There are lots of good examples on the web of integrating with CheerLights but the ThingSpeak library within the Particle Web IDE comes with a CheerLights example right out of the box, thanks!
Note that within the Particle Web IDE there are two ThingSpeak libraries which are, unhelpfully, both call THINGSPEAK. I used the official Mathworks library which adds "#include "ThingSpeak/ThingSpeak.h" to the top of your app (note the uppercase T and S).
I've modified the example code from both the ThingSpeak and NeoPixel libraries so that the colours fade instead of switching when CheerLights updates. The full listing can be found in /firmware/reindeer-cheer.ino.
To create and compile my code in the Particle Web IDE:
- Login to the Web IDE
- In the "Code" section choose "Create new App"
- Choose a title for your app and click Save
- Click on the Libraries section and search for NeoPixel
- Click on the NeoPixel library and choose "include in app"
- Choose the app you created above and then hit "add to this app"
- Repeat steps 4 to 6 for the ThingSpeak library
- Copy and paste the code from [/firmware/reindeer-cheer.ino] into your app making sure you delete anything that already exists.
- Save your changes
- In the Devices section choose the Photon you connected earlier
- Choose flash.
At this point your Photon should flash magenta and then your NeoPixel should spring into life. Assuming all went well you are now safe to mount your Photon into the compartment formed at the back of the Reindeer head. Some foam sticky pads work very well for this. The NeoPixel nose is attached with some hot glue.
- Adafruit NeoPixel uber guide - https://learn.adafruit.com/adafruit-NeoPixel-uberguide/overview
- Particle Web IDE beginners guide - https://docs.particle.io/guide/getting-started/build/photon/
- CheerLights build guide - http://cheerlights.com/build/