Bluetooth Controlled home light (Bulb)

Hello…

Nowadays Most of the equipment which is used in our life is being controlled by our smartphones. So we can make our work easy and we can use this things in many ways. This project is all about building the most simplified home automation device using an arduino and a bluetooth module. This one is very easy to build and it can be built in a few hours. In my version which I'm explaining right here, I can control home appliances using my Android smartphone. Let's have a look at the list of materials and tools you'll need.

alt_text

alt_text

Author

Sajeev Punithakaran

Acknowledgment

  • Aravith Panch , Co-founder and Director of Innovation, DreamSpace Academy , Batticaloa , Sri Lanka.
  • Kishoh Navaretnarjah , Co-founder and Director, DreamSpace Academy.

Step 1 : Collecting components

alt_text drawing

Here we’re going to make a bluetooth control 240V Bulb by using an Arduino UNO.So let's collect the required components as I mentioned above before building the Circuit.

The components are :

  1. Arduino UNO - 1
  2. HC-06 Bluetooth module - 1
  3. LED - 1
  4. Relay Module - 1
  5. Line Board - 1
  6. Bulb (240V) - 1
  7. Bulb Holder, Wire and 2 Pin Plug
  8. Short female header as we required
  9. Short male header as we required
  10. Jumper wires as we required

After collecting the components, let's start to implement it on a breadboard.

Bluetooth Module, HC-06

alt_text

The HC-05 Bluetooth module is one of the most popular and inexpensive modules used for RF communications and it is easy to implement in your projects. The module has a range of 10 meters, and can be easily set using AT commands and can be programmed both as master and a slave. The module allows to transform a UART \ USART port more commonly known as serial into a Bluetooth port, generally with SPP (Serial Port Profile) profile, thus becoming a serial over Bluetooth. Normally this device is used when you want to communicate with a microcontroller like Arduino with the outside world, where the outside world can be a SmartPhone, a Personal Computer, or other device equipped with a Bluetooth connection.

Working principle of Arduino-Bluetooth Module

In this project, there are four main components used: Android smartphone Bluetooth application, Bluetooth transceiver, Arduino device, and 1 Channel Relay

Module.

drawing

The Android app sends the serial data to the connected Bluetooth Module HC-06 by clicking ON button. The Bluetooth device receives the data from the app and sends it through the TX pin of the Bluetooth module to the RX pin of Arduino. The Arduino device reads the input data and processes it according to the program uploaded inside it and generates the output to 1 Channel Relay Module.

When the Bluetooth application's button turns ON, it sets the home light ON, and when the Bluetooth application's button turns OFF, it sets the home light OFF.

Step 2 : Interfacing HC-05 Bluetooth Module.

alt_text alt_text

The HC-05 Bluetooth module has generally four pins:

  • TX pin - Transmitting pin is used to transmit the signal to the receiver.
  • RX pin - The pin that receives the signal from the transmitter.
  • VCC pin - The power supply pin (+)
  • GND pin - The power supply pin (-)

The connection or interfacing of the module is as follows:

  • TX pin to the digital pin 0 (RX pin of arduino)
  • RX pin to the digital pin 1 (TX pin of arduino)
  • VCC pin to the Positive railings of the breadboard
  • GND pin to the negative railings of the breadboard

Step 3 : Interfacing Relay module

alt_text

The relay is an electromechanical device consisting of a winding and one or more mechanical contacts, it is used for interrupting and switching AC circuits using very low DC voltage. Which means we can control Electrical appliances in our house using Arduino or any other Microcontroller.

Here we’re going to use a relay module which is an electrically operated switch that can be turned on or off, letting the current go through or not, and can be controlled with low voltages, like the 5V provided by the Arduino pins

Controlling a relay module with the Arduino is as simple as controlling any other output as we’ll see later on.This relay module has one channel (the blue cube). There are other models with two, four and eight channels. This module should be powered with 5V, which is appropriate to use with an Arduino.

This module should be powered with 5V, which is appropriate to use with an Arduino.and here we’re going to use this relay to control 240V bulb via bluetooth with arduino.

Relay Pinouts :

The following figure shows the relay module pinout.

alt_text

The 3 pins on the left side of the relay module(blue cubes) connect high voltage, and the pins on the right side connect the component that requires low voltage-- the Arduino pins.

The high-voltage side has two connectors, each with three sockets: common(COM), normally closed(NC). And normally open (NO).

Main voltage connections :

alt_text alt_text

The high-voltage side has two connectors, each with three sockets: common (COM), normally closed (NC), and normally open (NO).

  • COM : Common pin
  • NC (Normally closed) : the normally closed configuration is used when you want the relay to be closed by default.meaning the current is flowing unless you send a signal from the Arduino to the relay module to open the circuit and stop the current.
  • NO (Normally open) : the normally open configuration works the other way around: The relay is always open , the circuit is broken unless you send a signal from the arduino to close the circuit.

    If you just want to light up a lamp occasionally, it is better to use a normally-open circuit configuration.
    

Pin wiring :

The low-voltage side has a set of four pins and a set of three pins.

alt_text

The set at the right consists of VCC and GND to power up the module, and input 1 (IN1) and input 2 (IN2) to control the bottom and top relays, respectively.

The second set of pins consists of GND, VCC, and JD-VCC pins. The JD-VCC pin powers the electromagnet of the relay.

  • COM : Common pin
  • In : controls the first relay (it will be connected to an Arduino digital pin)
  • VCC : Goes to 5V pin of Arduino

Connection between Relay Module, Bulb, and input power:

  1. Connect common-point (com) of the Relay Module with home light.
  2. Connect normally-open (no) of the Relay Module with power.
  3. Connect the remaining one home light wire with the power source.

Write an Arduino program to control the home light using Bluetooth Module,1 Channel Relay Module with Android application

Compile and upload your code into the Arduino device using Arduino USB cable. While uploading the code try to disconnect other components from Arduino.


char Incoming_value = 0;

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

  pinMode(13, OUTPUT);

  }

    void loop() {

    if(Serial.available() > 0)

    {

      Incoming_value = Serial.read();

      Serial.print(Incoming_value);

      Serial.print("\n");

      if (Incoming_value == 'a')

        digitalWrite(13, HIGH);

      else if (Incoming_value == 'b')

         digitalWrite(13, LOW);
      }

}

Home Automation App :

You need an app (download here) to control the Home appliances using Bluetooth. After downloading follow these steps to add a Room and components.

Step 1 : Open Bluetooth settings of mobile and pair the HC-05 Module. Kindly note that only paired devices will appear in the Android App.

Step 2 : Open the app and click on the Bluetooth icon to connect with the Bluetooth device.

Step 3 : Click on + icon at the bottom right of screen to Add a Room. If Bluetooth is being Connected the Bluetooth icon will turn blue in color.

Step 4 : Here you can change Room name, picture and add new devices. Click + to add a new device and swipe right to delete.

Step 5 : After saving you can send data to the connected Bluetooth Device. Make sure to Pair your Bluetooth device before using the App

alt_text alt_text alt_text

alt_text alt_text

Connection :

alt_text

If it works on the breadboard, let's make the project on a line board with the same components.

Here we are going to use a line board instead of the breadboard.we have to solder all of the components as we require with the help of the diagram above.

alt_text alt_text alt_text alt_text alt_text

Thank you...