How to make a Bluetooth control lamp | Step by step instructions

 How to make a Bluetooth control lamp

                Hello, welcome back. In this tutorial, we will learn how to make a Bluetooth control lamp using Arduino. This project is mainly based on a Bluetooth module. Also, this can be easily controlled using our smartphone. We can mainly use this project for our home. How to make this is presented step by step through this tutorial. Also, we can make this lamp at a very low cost.

Bluetooth control lamp process

When this lamp is power ON, When a signal is received through a Bluetooth control app on a smartphone, it is captured by the Bluetooth module. That value will then be transmitted to the Arduino board via serial communication. If the value is related to the program then the relay module will be ON or OFF. That is, the bulb turns on or off.
So, let’s do this project step by step. To do this, use the following components.
Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Arduino UNO board

Bluetooth module

Relay module

AC bulb

AC bulb holder

Jumper wires

Cardboard

Step 2

Secondly, cut two pieces of cardboard measuring 5 * 4 inches and 5 * 2 inches. After, glue them as follows. Then, adjust the 5 * 2 piece of cardboard to fit the Arduino board as shown below and glue it to the other piece.

Step 3

Thirdly, attach the Arduino UNO board and relay module to the base cardboard.

Step 4

Next, connect the relay module and the Bluetooth module to the Arduino board. To do this, use the circuit diagram below.
 How to make a Bluetooth control lamp
 How to make a Bluetooth control lamp

Step 5

Now, connect this Arduino board port to the computer. After, let’s create the program for this project. It is as follows.
 How to make a Bluetooth control lamp
The complete program of this project – Download
/* Bluetooth-activated table lamp.
  --------230v AC power. You must carefully---------
  created by the SriTu Tech team.
  Read the code below and use it for any of your creations
  https://srituhobby.com
*/
 
char value;
void setup() {
  Serial.begin(9600);//enable serial monitor
  pinMode(2, OUTPUT);//define relay pin
}
 
void loop() {
  if (Serial.available() > 0) {
    value = Serial.read();//read serial value
  }
  if (value == '1') {
    digitalWrite(2, LOW);//lamp ON
  } else if (value == '0') {
    digitalWrite(2, HIGH);//lamp OFF
  }else{
    digitalWrite(2,HIGH);
  }
}

Code explanation

In the setup, the serial monitor is beginning. Also, the relay-connected pin is converted to an output pin.
void setup() {
  Serial.begin(9600);//enable serial monitor
  pinMode(2, OUTPUT);//define relay pin
 
}
In the loop, the values are taken from the serial communication and put into a variable named “value”. After, this value is if 1, the relay module is turned ON. Otherwise, value is if 0, the relay module is turned OFF.
void loop() {
  if (Serial.available() > 0) {
    value = Serial.read();//read serial value
  }
  if (value == ‘1’) {
    digitalWrite(2, LOW);//lamp ON
  } else if (value == ‘0’) {
    digitalWrite(2, HIGH);//lamp OFF
  }else{
    digitalWrite(2,HIGH);
  }
}


Step 6

Now, remember to remove the RX and TX jumper wires. Afterward, select board and port. Then, Upload this code.
 How to make a Bluetooth control lamp

Step 7

Then, reconnect the RX and TX jumper wires. Afterward, connect the AC power wires to the relay module and pull them out through the piece of cardboard.

Step 8

Now cut two 4 * 2-inch pieces of cardboard and a 5 * 2-inch piece of cardboard. After, glue to the main piece of cardboard.

Step 9

Afterward, cut a 5 * 4-inch piece of cardboard and drill a hole in the middle and insert the wire to connect the bulb holder. Then, glue this piece of cardboard to the top.

Step 10

Now, connect the bulb holder and the AC power connector.

Step 11

OK, now let’s set up the mobile phone application. For that, use the steps below.
  • Firstly, download and install the app below. For that, use the play store or apps store.
  • Secondly, run this application. After, click the Settings button on the right. Then, click the “Command Button Configuration” button.
  • Thirdly, click the “A” button and enter “1” for this. Then click the “B” button and enter “0”

Step 12

OK, this application setup is done. Now, connect the power to the project. For that, connect a voltage of 7v to 12v to the Arduino board and a 230v voltage to the relay module. Be careful when you deal with AC power.

Step 13

Lastly, connect the mobile app to the Bluetooth module. To do this, use the steps below.
  • First, enable Bluetooth on your mobile phone and select the name of your Bluetooth module. Afterward, enter the password. For that, use the “0000” or “1234”.

Step 14

Now, run the mobile app we prepared earlier. After, select your device and click the “Button & Slider” button. OK, now click on the A and B buttons. The full video guide is given below. So, we will meet in the next tutorial.

How to make a Bluetooth control lamp | Step by step instructions

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *