This project is an Android app and ESP32 microcontroller system designed to launch fireworks using a Bluetooth Low Energy (BLE) connection.
The system consists of two main components:
-
Android App: The app provides a user interface with three buttons: one to connect to the ESP32 device via BLE, and two to launch fireworks. It handles user input and communicates with the ESP32 microcontroller using the
BluetoothManager
class. TheBluetoothManager
class manages the BLE connection, services, and characteristics for the Android app. -
ESP32 Microcontroller: The ESP32 runs an Arduino sketch that sets it up as a BLE server. It listens for incoming firework launch commands sent from the Android app and triggers the appropriate GPIO pins to launch the corresponding fireworks using connected relays.
- The user opens the Android app and presses the "Connect" button.
- The app scans for nearby ESP32 devices and connects to the target device via BLE.
- The user presses one of the firework launch buttons in the app.
- The app sends a firework launch command to the ESP32 device over the BLE connection.
- The ESP32 device receives the command and triggers the appropriate GPIO pin to launch the corresponding firework using a connected relay.
- The firework is launched, and the GPIO pin is reset to its default state.
- Android Studio
- Arduino IDE with ESP32 support
- Clone this repository.
- Open the
FireworkLauncherApp
directory in Android Studio. - Connect an Android device or start an emulator.
- Update the service and characteristic UUIDs in
BluetoothManager.java
to match your ESP32 device's UUIDs. - Build and run the app on your Android device or emulator.
- Open the
ESP32_FireworkLauncher
directory in the Arduino IDE. - Connect your ESP32 device to your computer via USB.
- Update the service and characteristic UUIDs in
ESP32_FireworkLauncher.ino
to match the UUIDs used in your Android app. - Select the appropriate board and port for your ESP32 device in the Arduino IDE.
- Upload the
ESP32_FireworkLauncher.ino
sketch to your ESP32 device.
- Power the ESP32 board and make sure the relays are connected correctly.
- Open the Android app on your device.
- Click the "Connect" button to establish a BLE connection with the ESP32 device.
- Click "Launch 1" or "Launch 2" to send a command to the ESP32, which will trigger the corresponding relay and launch the firework.
This project is licensed under the MIT License - see the LICENSE.md file for details.