Every year I see all the incredible Halloween projects that people make. I've never had much opportunity to play around with hardware so it always feels like too big of a task to try. This year however I had a Raspberry Pi Zero W on the side and a small bit of time to make something. As with all my side projects I wanted to use the time to learn something new.
We decided to have a little Halloween party so I knew I had to make something that could be used for that. I spent a while browsing Hack A Day and saw a video of pumpkins being used as a synth. It seemed really cool but would have cost a fair bit so I wanted to keep the costs low and not have to buy much. So I just bought an Adafruit 8-Key Capacitive Touch Sensor Breakout board, for £10 including postage, to make buzzers for a quiz where each team's buzzer would be a real pumpkin that would have individual buzzer sounds.
Once it arrived I quickly connected it all up... and low and behold... nothing. I reached out to my friend Dave who informed me at once that every single connection I had soldered on the headers of the Raspberry Pi was a cold joint. I had no idea what that meant! Thankfully Dave was extremely kind and let me use his tools and guided me on how to solder well. After 10 minutes it felt like I got the hang of it and everything went well.
You can see the finished "product" in this video, four pumpkins hooked up so they had a unique buzzer per team. We managed the hide the wires quite nicely, thanks to the table being wood slats so plenty of gaps. The Raspberry Pi Zero W and the breakout board were taped to the underneath of the table with black bin bags hiding it all.
Okay so this may feel like a bit of a tangent, but it was the majority of my time for this project. For a few weeks I had been learning React from Wes Bos' course and Tyler McGinnis' course. I learned a lot from these but I do find I have to have a project of my own to really put it into action. So I decided to make the project with a web portion that would run on my laptop or tablet (more on that later) and a device portion that would run on the Raspberry Pi.
I began working on the web app before the device code, while I was waiting to get the hardware up and running. So I made a list of what I intended to do:
Believe it or not I got most of this working!
I really did overthink it though didn't I. The project was to have a single quiz with buzzers and there I am making a system that can work with multiple phones connected and have multiple quizzes with a complete admin panel and team names and even theming! I never learn do I. It could have been the buzzers with just a piece of paper for the quiz itself. But this did give me ample opportunity to learn some of the more tricky bits of React, so that came in handy.
The idea was I would have the quiz open in Safari on my iPhone or iPad. This quickly became an issue at the last minute. I had forgotten autoplay is disabled on some browsers and without rewriting how the audio elements were displayed in the React code, I would have had to click play each time the buzzer was activated. This was a nightmare. So I rushed upstairs and grabbed my laptop, that worked perfectly fine in Firefox and had it hooked up via bluetooth to the lounge speakers so it gave the affect I was hoping for (see the video).
Feel free to take a look at the code (my first react app though, so don't expect it to be good!): pumpkin-buzzers repo on Github