James West

May include blinky lights. And cocktails.

Tag: Christmas

#inventadvent submission – Father Christmas’ naughty or nice detector

Seasonal hacking inspired by Les Pounder is now officially a thing. Invent:Advent asks you to spend no more than a tenner in pound shops and add that to crafty/makery things you’ve already got lying around to make festive Christmas hacks.

So here’s my go. I bought a wooden Father Christmas with a spinning panel in his belly to let you to show whether you’ve been naughty or nice, several strings of LEDs powered by 2 AA batteries and a sparkly reindeer. I decided to make Father Christmas a bit more high-tech in his approach to declaring your behaviour status, and to give him a less binary choice. The plan was to press a button and see just how you’ve behaved appear on a screen.

For this hack I’ve used the Father Christmas and a set of the LEDs (although a second set was sacrificed to some careless snipping). I raided my box of making bits for a USB power bank (I could easily have afforded to get one at Poundland, but I knew I already had this at home), a Raspberry Pi Zero W with Pico HAT Hacker, a PaPiRus Zero e-ink display which formerly ran a Twitter display, one small button with a red cap, hook-up wire, some left-over transparent red Perspex and lashings of hot glue.

I took the spinning panel out of Santa’s tummy and found the PaPiRus Zero was a good fit vertically, but left a gap of about a centimetre at each side. I used the left-over acrylic to fill the gap and create a mounting plate I could bolt to Raspberry Pi onto. I drilled a hole through Father Christmas’ nose (sorry) to fit the button. Signal and earth wires for the button were soldered to the Pico Hat Hacker and then to the button. The LEDs were also soldered on here, after I’d worked out which lead was positive and which was negative and shortened the train of LEDs to fit.

Everything (the transparent red acrylic holding the Pi Zero and Papirus Zero, the USB power bank, and all the LEDs) was hot glued into place. I’d already written the code and tested it while I was prototyping the hardware so all I had to do was fire up the Raspberry Pi and press the button – err, nose, to set Santa into action. I’ve made about ten statuses that Father Christmas might give you, but you can have as many as you like. They’re all delivered to the screen as black and white bitmap images which are 200 x 96 pixels.

This slideshow requires JavaScript.

Christmas Celebrations – chocolate box LEDs with music

Nothing says “Christmas” like a box of Celebrations – especially one that plays Christmassy music and is lit with LEDs.

Untitled

I’ve finished the code so that it now randomly chooses one of fifteen snippets from different Christmas songs to play while the LEDs gently pulse. With the addition of some jumper wires you can now choose from several sets of Poundland LEDs in different styles and colours.

Merry Christmas LEDs
Christmas Celebrations

If you want to look at the code, here it is:

Christmas celebration lights

At the end of my previous post I set a list of potential improvements to the Little Box of Horrors I’d made for Halloween.

This is the list..

  • At the moment it plays the same sound every time the button is pressed, but it’d be nice to play a random selection from a playlist of sounds
  • The lights could flicker and flash while the sound plays instead of being constantly on
  • If the sounds are of varying lengths the lights should only be on for as long as each sound plays
  • The lights and sounds could be swapped for Christmas or other gaudily celebrated occasions
  • Spray paint and decorate the box to be a bit less chocolate-boxy
  • Re-write it in gpiozero

Earlier this week I’d a pleasant afternoon cutting and soldering wires. I cut the connections between the Raspberry Pi and the LEDs and soldered jumper wires on so they’re now swappable.

 

Jumper wires

I also returned to Poundland and got a couple of packs of Christmas LEDs. As with the Halloween lights I cut the battery boxes off and soldered jumper wires to the ends, taking care to use red or black jumpers to indicate the polarity of the connections. Now I can choose Christmas or Halloween lights for the box.

Having had fun with hardware I thought I’d better have another go at the code, so I’ve re-written it in GPIO Zero, and discovered as a bonus that it’s really easy to control the LEDs with PWM so you can make them gently pulse on and off.

So in a couple of sessions I’ve crossed three items off my list!

  • At the moment it plays the same sound every time the button is pressed, but it’d be nice to play a random selection from a playlist of sounds
  • The lights could flicker and flash while the sound plays instead of being constantly on
  • If the sounds are of varying lengths the lights should only be on for as long as each sound plays
  • The lights and sounds could be swapped for Christmas or other gaudily celebrated occasions
  • Spray paint and decorate the box to be a bit less chocolate-boxy
  • Re-write it in gpiozero

Here’s the code:

© 2018 James West

Theme by Anders NorenUp ↑