How to Build a Bluetooth controlled LED light Setup Using Arduino UNO board:
Let’s build an IoT project using Arduino UNO and the Bluetooth module HC-05 to control an LED. In this project, we will use an android Smartphone to send a Bluetooth signal to the Bluetooth module.
Requirements of hardware in this Project:
- Arduino UNO board
- A USB cable for connector Arduino UNO board
- Bluetooth Module HC-05
- Jumper wires male to female
- LED light
- Android Phone
Requirements of software in this Project:
- Arduino software (To program the Arduino board, we need to download the Arduino software.)
- Android Studio
The Working principle of this Project:
There are three main components used:
- Android Smartphone
- Bluetooth transceiver
- Arduino UNO board
The Android application is designed to send serial data to the Bluetooth Module HC-05 by pressing the ON button as the Bluetooth Module HC-05 works on serial communication. Receive the application data and send it through the TX pin of the Bluetooth module to the Arduino board RX pin. The code downloaded within the Arduino board verifies the data received. If the received data is 1, the LED lights turn ON, and if the received data is 0, the LED Lights turn OFF.
Write the following program in Arduino IDE:
Save the program and compile it.
Connect your Arduino UNO board to your laptop or desktop computer via Arduino UNO USB cable. Remove all other connections with the Arduino UNO board, such as the Bluetooth module and LEDs, then upload the program to the Arduino UNO board.
Before uploading the code to the Arduino UNO board, make sure that Arduino serial port is selected. Otherwise, an error message Serial port not selected is displayed on the screen.
Select your serial port in your laptop or desktop:
Open Device Manager -> Ports -> Arduino Uno, and then upload your program.
After uploading the program in the Arduino UNO board, connect all modules with the Arduino UNO board, such as the Bluetooth module and LEDs. The Digital circuit diagram image is shown below:
After connecting all the modules with the Arduino board, connect Bluetooth modules HC-05 with the smartphone. Consider the screenshots below:
When you click on the “ON” button, the Android application sends data 1 to the Bluetooth module. This data is transmitted from the Bluetooth module HC-05 to the Arduino UNO board, and the LED is on.
When you click OFF, the Android application sends the 0 data to the Bluetooth module. This data is transmitted from the Bluetooth module HC-05 to Arduino UNO board. The light turns off.by