At the office I do love a good desk prank. That is, messing with someones desk when they’ve gone away for at least a couple of days.
Each one often outdoes the last, which has left me with an increasingly difficult task.
For my latest one I thought what could be better than a desk that looks normal in the morning but then suddenly the prank happens when you least expect it.
Enter the confetti cannon:
The prank would have 3 main components:
- A mechanism to fire a volley of real confetti onto the target and their desk
- A mechanism to fire a can of silly string at the target
- A program to display a message on the targets monitors, followed by virtual confetti
The most difficult part of the three would certainly be launching the confetti.
I trialed some options using fans, but it didn’t give me the immediate effect I needed, plus ended up being quite cumbersome.
I thought the best way to solve this would be using compressed air. This way all the energy could be released very quickly.
Having owned an air pistol in the past, the 12g CO2 cartridges commonly used are cheap and easy to obtain. These would be a perfect energy source.
Being able to pierce the canister and release the gas in a controlled manner would be key. Because of hobbies like paintball there are a plethora of CO2 parts available online.
I obtained a “quick change” adapter and valve from eBay.
The valve has a 1/4″ BSP output. I would need to connect this output to a solenoid valve so that I could electronically release a small amount of gas as needed.
CO2 obtains a gas pressure of 852.8 psi when confined to a vessel. This is obviously quite substantial. Your average car tire is around 30 psi.
I would therefore need a solenoid capable of handling this pressure. The aptly named solenoid valve world had a wide range of options to choose from. I went with a valve powered by a 12V DC coil and capable to handing over 1200 psi.
I needed to join the output of my control valve to the solenoid so i ordered probably one of my favoritely named items ever:
I twisted the nipple into place and used a bit of PTFE tape to ensure it was air tight.
I inserted a CO2 cartridge and pressurized the system. Tapping the 12v leads from my bench power supply against the solenoid gave a startling thunk as some of the 800psi was released.
The next challenge was to harness that energy and use it to propel some confetti into the air.
I designed a barrel using Fusion 360. The barrel would be made of 3 pieces, each getting a bit wider, and I would use another nipple (snigger) to connect it to the solenoid output.
I printed this in black PETG with plenty of infill. While the gasses had an obvious path to escape, I wanted the barrel to be as strong as possible to avoid turning this into a pipe-bomb.
Next I needed a way to remotely trigger the solenoid, and only for a fraction of a second. I turned to the trusty Particle Photon board for this. This is an internet connected IoT development board that is super easy to work with.
I used some protoboard and connected a transistor to one of the digital pins. The transistor would drive a relay, which in turn would supply the 12v needed for the solenoid. I used a spare power supply board to turn my 12v supply into the 5v needed for the Photon board.
I used the Particle IDE to create some code to control the solenoid. I exposed a function that could be executed using a REST API call from anywhere. This function would turn the output pin high for 200ms, which should be enough to release a small puff of gas.
I created a basic web interface to allow me to remotely trigger the confetti using my phone:
My first test was about as good as I could have hoped for:
To make the whole thing a little less bomb-like I modeled a simple box for it to sit in along with the control board.
The result is certainly less alarming. But i still wouldn’t leave it unattended at a train station.
In addition to the confetti I wanted to trigger some silly string in much the same way.
I needed to create a mechanism to squeeze the trigger on the silly string canister. I found a reasonably priced linear actuator that would give me the pulling force I needed.
With a bit of light dremeling I added a spring to the actuator to allow it to recoil into position when finished.
After measuring both the silly string can and actuator I designed an enclosure that would bring the two together.
I used some bolts to secure the actuator and lever in place.
The actuator would pull down on the lever which should provide plenty of force to depress the nozzle.
The actuator was also 12v which was ideal. I added another relay to the board and connected this up to another digital pin on the Photon.
My first test went well. The cat was not impressed.
I wanted the string to fire upwards at around 150 degrees apposed to the 90 degrees the nozzle currently provided.
The two options were to tilt the whole contraption or to design a new nozzle with a hole at the appropriate angle.
I thought making a nozzle would be the easier option, and after a bit of trial and error getting the sizing right I had a working nozzle.
The final piece of the puzzle was a small bit of software to display a warning message and tie it all together. I wrote something simple in .NET and launched this remotely using psexec. The software created an instance of the countdown form on each active monitor and displayed the best confetti gif I could find at short notice.
On the day, I had left the silly string to settle for too long, so I mostly ended up with just gas leaving the canister. In future I’ll remember to shake the can up before firing. Still, it was a success in my book…