It’s a cracker! A maker recipe for legal fireworks

By | 5 minute read | February 28, 2017

Maker recipe for legal firecrackers

Watching the Lunar New Year celebrations last month, I began to think about our love of loud bangs and bright flashes. However, fireworks – such as small explosive firecrackers – have proved to be so dangerous they are banned in many countries, including the UK.

So I decided to make some firecrackers for myself – but ones that are legal and safe!

The firecracker idea

Make some ‘fake’ decorative firecrackers from plastic plumbing pipe. Attach some very bright LEDs or neopixels. Control the lights with a Raspberry Pi using Node-RED. Turn up the volume on a speaker and play ‘cracking’ sounds through it. And then add smoke from an electronic cigarette into the mix.

All triggered by a switch.

This blog is intended as a rough guide to what I did – it’s not a step-by-step instruction manual.

The total build cost was about £185 (parts listed at the end) – however, I am sure some savings could be made.

The E-cigarette in particular was fiddly to hack and each one will be different. However, you are welcome to take this idea and adapt it for your own use.

I’d love to hear what you make – let me know in the comments below.


This project uses a Raspberry Pi 3 to control everything, programmed using a Node-RED flow. I used pre-installed nodes, plus the Neopixel node. The complete flow is available on GitHub.

Some soldering was required in this project. The LED lights are WS2812B neopixels controlled via a 3V3 (3.3 Volts) to 5V level shifter.

For sound I use a USB audio adapter and a portable speaker. This is because there is a conflict between the neopixels and the normal audio jack.  For the smoke, I hacked an e-cigarette and used glycerine, rather than a nicotine solution. I use an aquarium pump to force the smoke out of the e-cigarette and up the tube. These are both powered by a 30W Isolated DC-DC Converter. MOSFETs switch the e-cigarette and the pump.

A button attached to the GPIO pins triggers the firecrackers. However, I am tempted to trigger it from a motion sensor to make visitors jump.

The rest of the props are made out of things I had around – a two-litre fizzy water bottle, gold ribbon, a paper plate, plastic pipe and spray paint.

The lights

This was my first experiment with neopixels controlled directly by a Raspberry Pi. I used a MyPiFi neopixel controller to level shift the Pi GPIO pins’ 3V3 to 5V. (Pi.jpg).

Having spoken with other makers (thanks @BigLesP) I don’t think this is actually required now – especially as I only have two neopixels ‘on’ at the same time.

I installed the Node-RED Neopixel node – with the pre-requisite of installing the Pimoroni Unicorn HAT one-line installer.

I used a function node to make the neopixels flash in order, and a delay node to make the flashes random.

When the lights were looking realistic, I moved on to the sound.

The sound

The USB audio adapter plugs directly into a USB socket, the portable speaker plugs in to the adaptor. The audio settings need to be set in the Raspberry Pi’s configuration settings (raspi-config). I also used the Linux program ‘alsamixer’ to set the volume. The firecrackers sound file was made by Phil Andrew. I found that using the Node-RED ‘exec node’ calling the ‘mpg123’ program worked best.

With lights and sound looking good it was time to make some smoke…

The smoke

This was the trickiest bit.  On an electronic cigarette, if you blow down the air-intake hole (not the outlet hole you would normally ‘suck’), smoke comes out the outlet hole. I attached an aquarium pump to the air-intake hole and the firecrackers pipe to the outlet, to make smoke on demand.

The e-cigarettes are not designed to be taken apart, and so I ended up attacking it, rather gingerly, with a pipe cutter – I knew there was a LiPo battery inside. The LiPo battery had no protection circuitry, and as I was hacking the ‘intended use’ I was a little concerned about using it. Commercial 3V7 LiPo batteries with protection circuitry do not have the current-handling capability to power the e-cig (it needs about 4-5A at 3V7). I also didn’t want to rely on battery power for the whole assembly. I therefore removed the battery and replaced it with a 30W Isolated DC-DC Converter.  The isolation means the input has no electrical connection to the output – and therefore no high currents can accidentally pass through to the Pi’s circuitry. The model I used has an adjustable output voltage, so I could change the output from the nominal 3V3 to nearer 3V7 –the nominal voltage of a LiPo battery. (The information on how to do this is on the data sheet).

Using some silicon pipe, I attached the aquarium pump to the air-inlet of the e-cigarette. I taped up the remaining air inlet holes. I used MOSFETs connected to Pi’s GPIO pins to turn the pump and the e-cigarette on and off.

The Node-RED flow needed various delay nodes to get the timing of the smoke, lights and sound correct. I wanted the e-cigarette to heat up before I put the pump on. As the pump was very noisy, the sound needed to be on before the pump started.

Making it look good

I cut plastic plumbing pipe into short lengths – and used a longer piece for the smoke pipe. I spray painted the pipes. I have found that white primer made the red colour brighter and really ‘pop’ out.

Painted plastic plumbing

Painted plastic plumbing

Nothing I had would make the pipe stick to the silicon cover of the neopixels (including Sugru and hot-melt glue). So I sewed them on with gold ribbon.

I drilled holes in the main smoke pipe to let the smoke out at different heights.

The base of the firecrackers was a fizzy water bottle spray painted gold. Most of the electronics, e-cigarette and pump fitted inside, with a hole in the bottom for the wires and also to let in air. The Raspberry Pi, speakers and button were left on the outside.

A fizzy water bottle sprayed gold

A fizzy water bottle sprayed gold

Roll on the 5th November, Diwali, and Chinese New Year 2018!

What do I need to create my own firecracker?

The finished legal firecracker

The finished legal firecracker


This project was inspired by Seb Lee-Delisle’s laser gun and the outdoor firecrackers I made for Robin Hill Country Park. I’d like to express huge thanks to Seb for his help and encouragement. Also thanks to James Macfarlane of Airborne Engineering for help with the electronics and Node-RED Function nodes.