Introduction: Arduino Wireless Fireworks System


Build a wireless fireworks system using Arduino.

The system has 5 main modules.

  1. Slats - Slats have cues and fireworks are attached to cues.
  2. PC to Slat communication - Send commands to slats to fire a specific cue.

  3. Android to Slat communication - Send commands to slats to fire a specific cue.

  4. PC Gui - Qt app to fire cues or run a script to automatically fire cues.

  5. Android Gui - Qt app to fire cues using an Android tablet.

Link to source code

Step 1: Materials and Components

Step 2: Tools and Supplies

List of tools and supplies used for various components

  • Safety glasses!
  • Scissors
  • utility knife
  • Heat shrink tubing (and/or wire nuts, and/or electrical tape)
  • Various colors of wires in 22ga (20ga or 18ga)

To cut holes in shoe box

  • Dremel
  • Quick attach cutter
  • 1/2" drill bit
  • Drill
  • Marker

For 7 segment legs

  • 5/64 drill bit
  • Drill
  • Small long nose pliers
  • Flat washer #0 X 2
  • Hex nut 0-80 x6
  • Round head machine screw 0-80x3/4 x2

Speaker terminals

  • 3/32 drill bit
  • Drill
  • Long nose pliers
  • Small standard screw driver
  • Small pliers

Speaker terminals with wires already soldered

  • Flat washer #2 x6
  • Hex nut 2-56 x6
  • Round machine screw 2-56x3/4 x6
  • Two blocks of wood to prop top up

Make speaker terminals

  • Soldering iron
  • Solder
  • Speaker terminal
  • Wires one for each plus ground
    • 22ga
    • For my project box I made the wires approx 22" long

Make button

  • 4 jumpers Male to female
  • Button
  • Soldering iron
  • Solder
  • Optional: If you need extra length Attach two jumpers together to make a long jumper (or purchase 50+cm)
  • Pull female ends off
  • Soldering to button

Prepare 16 relay board

  • 8 short wires
  • 6 long wires
  • Pliers
  • Wire strippers
  • Small Phillips screwdriver
  • 1 left to right side bridge wire
  • 1 bridge to 4 channel relay (don't wire yet)
  • Connect all but ends
  • After tightnening COM set screws, untighten all NO set screws

Prepare 18v battery

  • 2 9v battery connectors
  • Long wire
  • Soldering iron
  • Solder
  • Heat shrink tubing

Prepare 12v power

  • 1 8xAA battery holder
  • 2 long wires
  • Heat shrink tubing

Assemble relays and arduino to board (or whatever you will be mounting them on)

  • 1/4" Board cut to box size
    • Using a board to mount components is optional but I found it much easier to debug if the components are mounted on a removable plane
  • Prepared 16ch relay
  • 4ch relay
  • Arduino mega
  • Short wire
  • Bridge wire
  • 12v battery
  • 18v battery
  • Marker
  • Arduino pin header
  • #4x1/2" Wood screws x6
  • Drill
  • Pliers

Assemble top and bottom

  • Completed bottom board
  • Completed top
  • Screw driver philips small
  • Wiring diagram
  • Optional: NRF24 socket adapter
  • NRF24 radio
  • 7 segment
  • 40pc male to female jumper
    • mark one side with marker so you are pulling wires from the same edge each time
  • 4 long male to female 40+cm
  • 2 female to female jumper
  • Heat shrink tubing (or electrical tape)
  • Pliers

And I'm sure there are other tools/components that I did not make a note of...

Step 3: Prepare Wires for Relay to Cue

For the given number of cues in your system prepare enough wires from CAT5 cable.

The speaker terminals I used were 12 position (6POS and 6NEG).

For each terminal 7 wires were used 6POS and 1NEG (common to all).

The remaining wire (blue) I used to make the Relay power wires.

Pick a wiring diagram that works for you - be consistent!

Here is the wiring I used

Terminal position

  • 1 Green Stripe
  • 2 Green
  • 3 Orange Stripe
  • 4 Orange
  • 5 Brown Stripe
  • 6 Blue Stripe
  • 7 Negative Brown

Note: Using CAT5 is not required, but it was an abundant source of wire I had on hand. Ideally you should use 8 different colored wires to avoid confusion.

For the box I used I cut each wire about 22" long. This provided enough length such that I could remove the top of the box without causing undo stress on the relays.

Step 4: Prepare Relay Wires

The Relay COM (common) terminals are all wired to battery POS (+).

Using 8 short, 6 long, and 1 really long wires

Twist the wires together, alternating between short, long.

After completing a side (4 short, 3 long) twist the really long wire to an end (this will be the bridge to the other side of the relay).

Repeat on the other side.

Push the wires into the terminals and tighten the retaining screw leaving the ends unscrewed.

One end will be for a bridge to the 4port Relay. The other end will be to connect battery POS (+).

When finished use the small screwdriver to test each terminal and make sure it is not loose.

Step 5: Prepare 12V and 18V Battery Holders

For the container I used I wanted to extend the 12V and 9V battery connectors to make sure there was plenty of room for testing, repairs, and fitting.

For the 8 x AA battery holder

  1. First tin the extension wires on both ends
  2. Put heat shrink tube on wires
  3. Solder the extensions to the 8 x AA battery holder.

  4. Keep the colors consistent for all 12V battery holders.

For the 2 9V battery holder

The 9V batteries will be connected in series for 18V (9V + 9V = 18V).

  1. Gather two 9V battery holders. Holder A and Holder B
  2. Cut and slip heat shrink tubing over red POS (+) on A and over black NEG (-) on B.
  3. Solder (or twist) the red POS (+) of A to the black NEG (-) of B.
  4. Finish joint with heat tubing (or wire nut, or electrical tape)
  5. Tin extension wires on both ends
  6. Put heat shrink tube on wires
  7. Solder the extension to the back NEG (-) on A and red POS (+) on B.
  8. Keep the colors consistent for all 9V battery holders!

Step 6: Prepare Lower Slat

For my slats I mounted the Arduino, 16 channel relay and 4 channel relay on a piece of 1/4" plywood cut to fit inside of the box.

The lower slat base consists of

  • Arduino
  • 16 channel relay
  • 4 channel relay

The AA and 9V battery holders might also be contenders for mounting on the lower slate.

The radio is another possibility to mount on the lower slat.

My original plans call for mounting the radio on the top of the box so the antenna could extend about the box, but this was another design feature that was altered because of time constraints.

There should also be a power switch and a TEST/ARM switch.

There was a sourcing problem such that the original components were unavailable and the replacement components were garbage. So switches for power and TEST/ARM did not make it into this build.

For wiring components I used a fresh 40wire jumper set. I marked one edge such that it would always be on my right and I would pull wires from the left when the male end was pointing away from me (use whatever orientation you want - just be consistent!)

Step 1

Using whatever method works for your slat design, lay the pieces out.

Be mindful of the wiring for the components!

  • Power Connections
    • Power switch for Component and Cue power
    • Component power connects to 16Relay
      • Component power is bridged to Arduino
      • Component power is bridged to 4Relay
    • Cue power connects to 16Relay
      • Cue power is bridged to 4Relay
    • Component power is bridged from Arduino to
      • 7Segment
      • NRF24 Radio
      • button(s)
  • GPIO Connections to Arduino
    • From 16Relay
    • From 4Relay
    • From 7Segment
    • From Button(s)
    • From NRF24 radio
  • Misc
    • USB to Arduino to reflash and debug

Step 2

After deciding on a layout affix the components to the slat.

For my case I used #4 1/2" wood screws to affix the Arduino, 16Relay, and 4Relay to the wood component holder.

Step 3

Wire battery holders for Components and Cues.

  • For Components
    • Wire 8 x AA POS (+) wire to screw terminal on 16Relay
    • Wire 8 x AA NEG (-) wire to screw terminal on 16Relay
  • For Cues
    • When wiring the 16 and 4 channel relays there were two wires left dangling. These wires will become the input and bridge between the 16 and 4 channel relays.
    • Twist together 9V POS (+) to one open wire on the 16Relay
    • Place wires twisted together into relay channel and screw down the post
    • Using a bridge wire twist one end of the bridge wire to the other free wire on the 16Relay.
    • Twist the other end of the bridge wire to the free wire on the 4Relay
    • Insert the twisted ends into the 16Relay and 4Relay channels and screw down the post

Step 4

LABEL cues/channels! This will help you if you make a wiring mistake!

Step 5

Optional: For my configuration I used standoff headers for the Arduino. If you use them install them on this step.

I used standoff headers to allow for quickly disconnecting/reconnecting the Arduino to other components. This saved considerable time during debugging.

Step 7: Prepare Cue Terminals

This is also called the "soldering" step.

Each slat has 3 terminal strips for a total of 18 cues.

Each cue needs a wire. I tried to find terminals to fit the spade connections but wasn't able to locate any, so I had to solder each terminal.

Tip: If you are building multiple slats complete each step before moving on - example cut all the copper wire at the same time.

My wiring diagram

  • Green stripe
  • Green
  • Orange stripe
  • Orange
  • Brown stripe
  • Blue stripe
  • Brown NEG (-) common

Use whatever wiring scheme meets your needs but be consistent!

Step 1

Measure the length of the terminal strip and cut a piece of copper wire to match.

Solder the copper wire to NEG (-) terminals. For my design the NEG (-) was common to all.

I soldered one terminal to hold the wire in place and then began soldering from the opposite side.

Attach a wire to the common terminals. For my wiring diagram this is the Solid Brown wire.

Step 2

Solder cue wires to the terminals.

Pick an orientation for POS (+) and NEG (-). For my slats POS (+) would be orientated to the "top" of the box (top - whatever you designate top as).

Begin soldering....

Step 8: Prepare Upper Slat: Cut Holes

Prepare the upper (top) of the box being used for a slat.

Cut holes for the terminal strips, 7segment display. Drill holes for button(s) and antenna.

For the shoe box containers I used the top (lid) was designed to be removed - which makes building the top and bottom slat assemblies MUCH easier. If you have the option I recommend a box with a removable top.

Tip: Make a jig/spacer to make marking much quicker

Safety: Do not forget personal protection! All steps require some level of personal protection but with bits of plastic flying DO NOT forget protection for this step!

  1. Mark the holes to cut
    1. Terminal strip(s)
    2. 7 segment
    3. Button
  2. I used a couple of blocks of wood so I could lay the top on the flat edge to make cutting a bit easier.
  3. Using a dremel cut the holes for the terminal strips. I used this cutting pattern
    • Inside edge
    • Outside edge
    • Long edges
  4. Push out the cut pieces
  5. Drill holes for button(s)

Step 9: Prepare Upper Slat : Triming Cut Edges and Drill Mounting Holes

All the cut edges need to be smoothed. The plastic on the box I used would melt forming jagged edges.

Safety: Do not forget personal protection! All steps require some level of personal protection but with bits of plastic flying DO NOT forget protection for this step!

Step 1

  1. Using a utility knife trim any ragged edges
  2. Use caution when trimming!

Step 2

  1. Drill holes to mount terminal strips
    • Tip: I used an unsoldered terminal strip as a guide to mark holes
  2. Drill holes to mount 7 segment
    1. Tip: I used an unwired 7segment display as a guide to mark holes.

Step 10: Prepare Upper Slat : Mounting Components

I had ordered standoffs to mount the 7segment display but the screw size was MUCH larger than required for the 7segment display. To compensate I used a bolt and three nuts for an improvised standoff. Using the improvised standoff I did not have enough nuts for 4 bolts so I compromised with 2 bolts.

Tip: Order the properly sized standoffs and bolts!

For the 7 segment assembly's improvised standoff

  • 1 0-80 x 3x4" Round head screw
  • 3 #0 Flat washer
  • 3 0-80 Hex nut
  • DO NOT mount the 7segment display yet!
    • It will be mounted when coupling upper and lower assemblies

For the terminals

  • 2 2-56 x 3/4" Round head screw
  • 2 #2 Flat washer
  • 2 2-56 Hex nut

After mounting the components bring together the common NEG (-) wire from each terminal strip.

Mount the button(s) in the button hole(s).

Step 11: Wiring Lower Slat Components

Pick a wiring pattern and be consistent in its use!

For wiring components I used a fresh 40wire jumper set. I marked one edge such that it would always be on my right and I would pull wires from the left when the male end was pointing away from me (use whatever orientation you want - just be consistent!)

Open all the 16 and 4 channel relay NO screw terminals

Start wiring components!

The wiring pattern in the first two pictures is the order that I used. However there are a few items that make for unused wires - for instance one button instead of two buttons..

Here is the order that I used for wiring components

  1. 16Relay
  2. 4Relay
  3. 7Segment
  4. NRF24

Optional: Before proceeding to the next step I tested the relays to make sure the were connected in the proper order.

Step 12: Joining Upper and Lower Slat Assemblies

This is the "messy" step because this couples the upper and lower assemblies with all the cues wired to relays.

Select any wiring pattern you want but be consistent!

The pattern I used is in the first picture.

I started wiring from the terminal strip closest to the relay from the outside edge.

Wire the button(s) to the relay.

Mount the 7segment display to the top.

Step 13: Upper and Lower Assemblies Joined

After completing the wiring nightmare, it's time to put the upper assembly on the lower assembly.

I would add batteries and run a few tests to make sure everything is wired properly.

Step 14: Controller PC USB to Radio

To control the slats from a PC I built a USB to NFR24 radio box.

Parts list

Installation is very easy

  1. Drill holes for
    1. USB cable
    2. NRF24 antenna
    3. LED (optional)
  2. Mount NRF24 to box in hole drilled for antenna
  3. Mount LED in hole drilled for LED
  4. Mount Arduino
  5. Wire NRF24 radio
    1. Socket Adapter Vin to Arduino 5V
    2. Socket Adapter GND to Arduino GND
    3. Socket Adapter CE to Arduino 44
    4. Socket Adapter CSN to Arduino 45
    5. Socket Adapter SCK to Arduino 24
    6. Socket Adapter M0 to Arduino 23
    7. Socket Adapter M1 to Arduino 22
  6. Wire LED
  7. Flash with FireControlSlave with "USE_BLUETOOTH" NOT defined
  8. Use Qt FireworksGui program to communicate with slats from your PC

Step 15: Controller Android Bluetooth to Radio

To control the slats from an Android device I built a Bluetooth to NRF24 radio box.

Parts list


  1. Drill holes for
    1. USB panel mount
    2. On/Off toggle switch
    3. NRF24 Antenna
  2. I used a piece of 1/4" plywood to mount Arduino and NRF24
  3. Mount Arduino
  4. Mount BLE shield on Arduino
  5. Mount NRF24
    1. Wire NRF24 to Ardunio
    2. Socket adapter Vin to Arduino 5V
    3. Socket adapter GND to Arduino GND
    4. Socket adapter CE to Arduino 44
    5. Socket Adapter CSN to Arduino 45
    6. Socket Adapter SCK to Arduino 24
    7. Socket Adapter M0 to Arduino 23
    8. Socket Adapter M1 to Arduino 22
  6. Mount Toggle switch
    1. Battery POS (+) to switch
    2. Switch to barrel POS (+)
    3. Battery NEG(-) to Barrel NEG (-)
  7. For a battery holder I used two long wood screws...
  8. Flash with FireControlSlave and "USE_BLUETOOTH" defined
  9. Use Qt FireworksGuiAndroid to control slats from Android device

Step 16: Controller Software

The source code includes a PC and Android based controller.

The GUI is very basic. As slats are discovered they are in the list box on the left.

The cues are represented by buttons.

  • Green indicates READY
  • Flashing indicates cue is currently firing
  • Gray indicates FIRED

Cues may be fired manually OR from a script (csv).

The bottom of the screen has a BROWSE button to locate a script (csv file).

While the script is playing the current cues are printed in the log textfield at the bottom of the screen.

The source also include a simulator to "play" a script. The simulator is hardcoded for the layout slat layout for our last show.

As the script moves forward in time the firing cures blink for the duration of the pyrotechnics attached. For instance if Slate 01, Cue 01 has a 40sec cake then the circle for Slate 01, Cue 01 will blink for 40sec.

At the top of the window are four fields

  • "Time" - current elapsed time
  • "Time Dark Sky" - count down timer for no cue firing (i.e. how long until all firing cues stop)
  • "Concurrent" - number of cues currently firing
  • "Total fired" - Running count of number of cues fired

Step 17: Done

After building slats, controllers, PC and/or Android software it's finally time to test!

The attached video is a small video of the first test using Talons and Jumping jacks.

Here is a link to the source for the controllers, slats, testing, and simulator.

Source code

Step 18: End of Project Notes and Observations

Field notes from using system

This was a fun and challenging project. The last show fired had roughly 260 cues with only a few cue failures!

In post show testing there were a few relays on the relay boards that were bad.

With 20 slats active there were some minor communications problems. I think a solution would be to have the slats be radio silent after establishing communication with a controller. This would reduce the RF messaging and might help prevent them from stepping on on another.

A possible design change would be to use a fire retardant container for the slat. One slat was damaged from a cake fire.

Building notes and observations

Many original design goals (in software and hardware) did not make it into the final build.

For instance

  • Robust communications protocol
  • Message timeout, resend, etc
  • Continuity test
  • ARM/Test switch
  • UNO support
  • Arduino based Controller (to fire cues, run scripts)
  • Up/Down buttons for settings
  • Power switch
  • Mount antenna

There are remnants of the aforementioned goals and other goals that were never realized. The deadline for use of the system kept ticking down.

A last minute addition added a RESET command. I did not snap any pics of the wiring for the RST so I did not include it in the steps.

Be prepared to adapt! I ordered many components from China and 99% of those components arrived in perfect working order, there were a few snags.

For instance the missing key switches (POWER/ARM/TEST) - when I ordered they were about $2USD each. A couple of weeks after my order for 22 of them the seller contacts me and states that their supplier has increased the price and they are now $13USD each - I politely declined.

Why only one button and not two? Well the buttons I originally order did not work! I tested ~10 and they were a no go. I had to used buttons already in stock but I only had enough for one button per slat.

Tip: when ordering items with a long delivery time always order a few extra

Have fun and be safe!