Bluetooth LED Controller With GlowDuino
by GlowDuino in Circuits > Remote Control
540 Views, 3 Favorites, 0 Comments
Bluetooth LED Controller With GlowDuino
Ever wanted to control LEDs from your phone? This project is an easy way to control six of them with just a few basic components. And in case you wish to replace the LEDs with something else, you can do that as well.
Supplies
You only need a few things:
-A GlowDuino Uno board for display:
https://www.glowduino.com/shop/p/uno
Or at:
https://www.tindie.com/products/glowduino/glowduino-uno-a-better-arduino/
-An HC-06 Bluetooth module:
-A breadboard:
-A few jumper wires:
Uploading the Code
To receive and process the commands, you need to upload the code given. Here you can change the character that controls the outputs, and you can change the pins used for outputs.
Load the program into the Arduino IDE software and upload it to your GlowDuino board.
If you wish to re-upload a modified program, make sure to disconnect the Bluetooth module, so the module does not interfere with the serial lines.
Downloads
Connecting the Bluetooth Module
The HC-06 Bluetooth module uses Uart to communicate. With this, the module has four pins: Two pins for power and two for data.
To connect the module to the microcontroller, you will need to determine the module's pinout. It is either the one in this picture or if you are using a similar module but with more pins, then you can find the pinout on the back side of your module.
In any case, you will need to provide the module with 5V, and you will need to connect the two data lines: Tx to the RX pin of the microcontroller, and Rx to the TX of the microcontroller. This way it can both receive and send data via Bluetooth.
Connecting Your Phone
With the wiring done, all that is left is to connect your phone to the Bluetooth module. For that, you will need to download a terminal app from the app store.
To have easily usable buttons, you can use this app: https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal&hl=hu&gl=US
Open the app and search for the item "HC-06" in the list of devices. Press connect and wait for the connection to be established. Once connected, the app will display "Connected".
With the connection established, everything you type on the phone will be sent over to the microcontroller.
Using the Outputs
Once connected, you can use the premade buttons at the bottom of the screen to switch the LEDs. These buttons contain a number, which corresponds to the given output pins of the microcontroller. Pressing these buttons will send over their content over Bluetooth, which can be read with the serial function of the GlowDuino. Analyzing each character with a simple row of "If" statements, the microcontroller can determine which button you pressed. One by one, the buttons will toggle the outputs, according to the trigger numbers from 1 to 6, thus controlling anything connected to them.
And with that being done, now you have a versatile wireless Bluetooth switch that can be used for a variety of things.
Expansion Option
In case you wish to control something other than LEDs, you can connect a relay module to the output of the GlowDuino. The indicator LEDs will still signal when the output is ON or OFF, but you will have a way to control higher-power appliances and lights.
If you are using a relay module, the wiring is simple and easy. These modules have their pin labeled, which you will have to match with the corresponding pins on the microcontroller. +5V and GND are needed to power the modules, and each of their control pins (usually labeled with "in1" or similar) needs to be connected to one of the controlled output pins of the microcontroller.