What is this and how does it work?
This is a project for beginners in which we'll be lighting fireworks using our bluetooth enabled phone.
The phone will trigger the firing event, the listening bluetooth module (HC-05) will communicate that to an arduino, and the arduino itself will trigger a relay. The relay will be connected to a LiPo battery and will drive current through a ribbon of nichrome wire wired around the firewok / match. The nichrome will heat quickly and become red and hot triggering the firework.
That didn't sound that complicated right ?
First of all, i need to explain why i've made this project. There are quite a few fireworks projects out there, why is this different. So i think it's advantages are:
* low cost, the total parts with the battery included are under 20$ (you can see a list below) if you don't have any parts
* simplicity: the project will be made with little soldering on a breadboard and the components might then be reused easily. I estimate only an hour on work on the project
* a high level of details on this tutorial
* can be extended to multiple ignition only if necessary (i'll explain how) but for starters it's just a single igniter
Other advantages but not so unique are:
* safety (you can operate it from a distance), the innocent firework there might not be dangerous but it can be adapted for more dangerous ones with only a match!
* fun, well there is only fun to create something with your hands, and you are free to adapt the project as you wish if it seems to simple (i'll give you some ideas at the end)
Because this is a beginners tutorial, i've selected links to some useful information below:
* How does a relay work: here
* How does bluetooth work: here
* Simple arduino bluetooth tutorial: here
That being said let's get started!
Step 1: Things Required
Tip: enlarge the pictures to view the descriptive labels on them
Warning: The prices might vary a bit, those wore the prices available when i've created this instructable
1. arduino pro mini 16Mhz 5V type (eBay) 2$
Any arduino model will do, i've choose this one because it's small and cheap. But yo may need to solder the pins.
2. HC-05 bluetooth module (eBay) 3.3$
3. small breadboard (eBay) 72 c
4. male-male and male-female jumper wires (eBay) 1.2$ x 2 for a bunch
you only need a few but i assume you have this already
5. 5V relay board (eBay) 1$
6. 3 AAA enclosed battery case (eBay) 1$ you may use any power source that has between 4 and 11 V to be safe.
7. LiPo battery (Hobbyking), or you can experiment with other batteries, i've chosen the LiPo because it's packs a lot of punch for it's size and we are not in danger of damaging it (it can handle relatively large currents). I've chosen an battery with XT-60 connector
8. 0.25 mm nichrome wire (eBay) 2.6$
9. XT-60 female LiPo connector (eBay) 1.2$
10. Heat Shrink Tubing or insulating tape
11. A plastic box with detachable lid
12. various wires
13. Terminal strip block (eBay) 15c
Assuming you don't have any of these parts the total will be 20$, but changes are that you'll have at least some of the components.
1. Soldering iron for soldering wires to the LiPo connectors
2. Wire cutters
3. Small screwdriver
5. USB to serial FTDI adapter FT232RL to programm the arduino pro mini
6. Laptop with ArduinoIDE installed to program the arduino
7. Lighter if you use Heat Shrink Tubing
8. A smartphone capable of bluetooth connection ( i use an android in the example ) with a bluetooth software installed
Basic arduino programming, this tutorial might be useful.
Step 2: Assembly
I've also attached a fritzig schematic in png and fzz format. You can check the connections below there.
Making the power connection
So if you're wondering why i have choose the LiPo battery the reason is because this type of batteries can supply large currents for short periods of time and they are found in common RC cars, drones, planes etc. So you might have one laying around in the house. I've made some measurements and my nichrome wire will use about 6 amps of power that means that you can use an even smaller LiPo battery. I've tested with a 1300 Mah but a much smaller value can work. If you are interested on more information about these batteries check it here.
We need to make the LiPo connector wiring to the relay and to to the nichrome wire.
First we'll wire the LiPo connector, we're using soldering flux to solder a 2 conductor cable (about 10 cm).
Using a cutter and a wire stripper strip about 3 mm of cable on one side and 5 mm on the other side. Cut the heat shrink tube 2 x 6 mm and insert it on the 3 mm uninsulated side. Solder the cable on the LiPo connector as shown in the pictures, Then position the heat shrink tube to cover the exposed metal and using a lighter carefully heat the tube so it locks into position.
On the other side the positive wire of the 2 conductor cable goes into the relay (middle slot).
Another longer 2 conductor cable must be prepared, this should 30 cm or longer to safely trigger the firework. Strip the wire 5 mm on both sides, and then insert in in two terminal strip blocks (see the pictures). This cable will trigger the firework /match. At one side we'll insert the nichrome wire later. At the other side we'll connect it to the relay (+ terminal) and respectively to directly to the LiPo (- terminal). You'll need to identify the relay NO (normally open) position, this is mark on the relay with an unclosed loop, by contrast the NC (normally closed position) will be marked with a closed loop, so should be easy to spot. Using a 4 cm stripped on both sides(also 5 mm) wire connect the NO (+) on the relay to one of the terminal blocks of the 30 cm cable. The (-) terminal of the LiPo wire will be connected on the other terminal block.
This is a lot of talk but actually is pretty simple, please see the pictures and it will be more clear.
Preparing the battery holder
We need to prepare the 3 AAA battery holder it will be plugged in the breadboard so i recommend soldering a two male pins (like these) so it fits neatly into the breadboard. We'll also need to cut 2 x 5 mm heat shrink tube, and after soldering the male pins we'll use the lighter to insulate the bare metal.
Now the breadboard should be prepared, first insert the microcontroller, then the bluetooth module.
Using male-male breadboard connector, connect the bluetooth and the relay (+) and (-) terminals then connect D12 (from the microcontroller) to the HC-05 Tx terminal. Also connect D6 (from the microcontroller) to the relay IN pin. The power supply (3 AAA) terminal will be connected to the raw and ground pins.
* Using a cutter make a hole in the plastic box lead. Insert all the components in the plastic box, the 30 cm wire with the nicrome at one side will slip through this hole.
* Cut 12 cm of nichrome wire. Wrap the firework or match a few times around, and then connect it to the terminal strip blocks. I've measured the current needed to drive the nichrome hot and it's about 6 amps, below the relay 10 A rating.
Step 3: The Code
The code establishes a software serial connection (for HC-05) bluetooth module.
Then in the loop it listens to the serial connection for incoming communication (from the phone or tablet).
When something is received it will be checked for validity in the isPinNrValid function ( it should a pin number from 3 to 9), and then it toggles the pin on for "igniteTime". Ignite time is a constant initially defined by me for 2500 ms, you can change that to whatever you like, i've found out that my fireworks would ignite successfully given that interval.
The code should be uploaded to the pro mini using the USB to TTL converter.
You will need to connect the GND, VCC, Rx, Tx and DTR pin to the arduino pro mini. Then open the arduino software select tools/port and whatever port you're using. Then Tools/Board/Arduino Pro or Pro Mini. Then Tools/Board/Processor/ATmega328(5V 16Mhz). Open the sketch below, and press upload.
Step 4: Using It and Final Thoughts
To use the device you'll need a serial bluetooth enabled device and that can be:
- an android / iphone smartphone or tablet
- a laptop with bluetooth module
- a raspberry pi with bluetooth built in
In my demo i've chosen an andoid app called Bluetooth Controller. This app let's you customize buttons that will send serial data. I've created two buttons called On and On2 that will send "5" and respectively "6" over the serial. But of course any serial bluetooth app will do fine.
Ok, first connect the LiPo battery, then set the On switch on the 3 x AAA battery holder, close the lid to the box, set the firework in place with the nichrome wire, set back and press the On2 button on the android app (because we connected the pin nr 6 to the relay).
Some improvement ideas that i leave for you to implement and write in the comments how you did it:
* You've noticed that i've set up an "On" switch with the "5" value assigned, i'll leave the implementation of multiple relays / fireworks for you. Basically you'll need a bigger box, and multiple connected relays, with wires.
* Another idea is to have an extra safety feature like a PIR sensor. The way it would work is when the sensor detects motion the fireworks won't light even if they receive a signal from the phone.
To drive fireworks with fuses if they don't work directly by wrapping the fuse with the nichrome wire you can try with a match. Wrap the wire across a match head, and tie the match head to the fuse or glue it. This should do the trick.
I hope you enjoyed this tutorial, and i'm waiting for feedback!