danionescu
Published © GPL3+

Simple and Cheap Phone Controlled Fireworks Igniter

This is a beginner project in which we'll be lighting fireworks using a Bluetooth enabled phone.

BeginnerFull instructions provided9,662
Simple and Cheap Phone Controlled Fireworks Igniter

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Breadboard (generic)
Breadboard (generic)
×1
Male/Male Jumper Wires
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
RobotGeek Relay
RobotGeek Relay
×1
3 AAA enclosed battery case
×1
2S LiPo battery 300-1000 mah (XT-60 connector)
×1
0.25 mm Nichrome wire
×1
XT-60 LiPo connector
×1
Heat Shrink Tubing
×1
A plastic box with detachable lid
×1
Wire Cable - By the Foot
OpenBuilds Wire Cable - By the Foot
×1
Terminal strip block
×1

Hand tools and fabrication machines

Screwdriver
Wire stripper
Wire cutter
Lighter
Soldering flux
Soldering iron (generic)
Soldering iron (generic)
Cutter
Usb to TTL adapter

Story

Read more

Schematics

The circuit schematic

Code

The code that should be uploaded th the pro mini

Arduino
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.
#include <SoftwareSerial.h>

SoftwareSerial bluetooth(12, 13); // RX, TX
const int igniteTime = 2500;

void setup()
{
    Serial.begin(9600);	
    bluetooth.begin(9600);    
}

void loop()
{
    if (bluetooth.available() > 0) {
        char received = bluetooth.read();
        Serial.println(received);    
        if (isPinNrValid(received)) {
            togglePin(received);
        }  
    }
}

bool isPinNrValid(char pin)
{
    return pin >= '3' and pin <= '9';
}

void togglePin(char pinNr)
{
   Serial.print("Toggle pin:");Serial.println(pinNr);
   String pin;
   pin += (char) pinNr;
   int number = pin.toInt();
   pinMode(number, OUTPUT);
   digitalWrite(number, HIGH); 
   delay(igniteTime);
   digitalWrite(number, LOW); 
}

Credits

danionescu

danionescu

11 projects • 72 followers
I'm an electronics enthusiast, passionate about science, and programming.I like the challenges involved with building things from scratch.

Comments