Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Bluetooth Controlled Home Automation System

By Praveen Kumar, Chennai, India July 1, 2017

Smartphones are the new craze and they have made life easier than ever. They are portable and always in the pockets. This portability of smartphones have led the marketers and the designers to develop services and solutions around the mobile domain. There are apps to shop online, do banking, trade stocks and uncountable day to day tasks. Then how can home automation systems remain isolated from the mobile technology!
 
In this project, a home automation system is designed which can be controlled by any smartphone. The automation system connects with the smartphone through Bluetooth. The smart phone sends control signals to switch home appliances ON or OFF by an android app through Bluetooth interface. 
 
The project is built on Arduino UNO and is used to control LEDs and four home appliances connected to the Arduino through relays. The Arduino board is interfaced to an HC-05 Bluetooth module to pair with the smart phone. 
 
An app named “Bluetooth Terminal” is used on the smart phone which is capable of sending text strings to a paired device. Another app named “BT Voice Control for Android” can also be used on the smart phone. The BT Voice app takes voice commands in US English and transfers them as text strings to a paired device. Either of the app will pair with the home automation system through HC-05 Bluetooth Module. Every module has a unique MAC address and a password for pairing with other devices. Like the Bluetooth module used in this project had a MAC address – 98:D3:31:F4:18:22 and had a password “1234” for pairing with other Bluetooth devices. 
 
The Arduino board receives the user commands in the form of numbers from the smart phone through Bluetooth interface. These numbers are assigned to the home appliances and the appliances are toggled either ON or OFF on receiving the numeric command. The Arduino sketch looks for the numeric commands from the Bluetooth module and operates relays to switch appliances. 

Components Required – 

Home Automation System:

1. Arduino UNO
2. Bluetooth module(HC-05)
3. 16X2 LCD
4. 12V Relay
5. BC547 transistor
6. 1K ohm resistor
7. 5 mm LED 
8. 10K ohm PRESET
9. Two pin plug
10. Three pin holder

Mobile Command:

1. Any Android phone 
2. Android app (Bluetooth terminal)
3. Android app (BT voice Control for Android for voice commands)

Block Diagram – 

Block Diagram of Arduino based Home Automation System
 
Fig. 1: Block Diagram of Arduino based Home Automation System 
 
Circuit Connections – 
 
Prototype of Arduino based Home Automation System
 
Fig. 2: Prototype of Arduino based Home Automation System 
 
 
The Arduino UNO is the master component of entire circuit and different components and modules are interfaced to it. The circuit has the following modules and components connected to the Arduino board – 

Power Supply:

In the circuit, Arduino board, LCD module and LEDs need a 5V regulated DC while relays need 12V regulated DC for their operation. A 18V battery is used as the primary source of power. The supply from the battery will be regulated to 5V and 12V using 7805 and 7812 ICs. The pin 1 of both the voltage regulator ICs will be connected to the anode of the battery and pin 2 of both ICs will be connected to ground. The respective voltage outputs will be drawn from pin 3 of the respective voltage regulator ICs. An LED along with a 10K Ω pull-up resistor can also be connected between common ground and output pin to get a visual hint of supply continuity. 

16X2 LCD:

The 16X2 LCD display will be used to display the status of devices. It is connected to the Arduino board by connecting its data pins to pins 2 to 5 of the Arduino board. The RS and E pins of the LCD are connected to pins 13 and 12 of the Arduino UNO respectively. The RW pin of the LCD is grounded.
 
Table Listing Circuit Connections between Arduino Uno and Character LCD
 
Fig. 3: Table listing circuit connections between Arduino Uno and Character LCD
 
The standard open-source library for interfacing LCD with Arduino UNO is used in the project. The library works as expected and needs no changes or modifications. 

Relays:

The 12V 2A relays are used to switch the AC appliances ON or OFF in the project. The  relays are connected to the pins 9, 8, 7 and 6 of Arduino board via BC547 transistor circuits connected in a common emitter configuration. The phase wire from the AC supply is provided at the COM terminal of the relays. When a HIGH logic is received at the interfaced microcontroller pins, the  COM point switches from NC to NO point where a relay short-circuits the phase with the neutral wire switching the supply to the appliance ON. The LEDs are connected parallel to the relay circuit with pull-up resistors in series. These LEDs give visual hint of the ON/OFF status of appliances. 

HC-05 Bluetooth Module:

The Bluetooth module has six pins – Enable, VCC, Ground, Transmit Data (TxD), Receive Data (RxD) and State. The Enable and State pin are unused and so not connected in the circuit. The VCC and Ground pins are connected to the common VCC and Ground. The TxD and RxD pins of the module are connected to the pins 10 and 11 of the Arduino. 

How the project works –

 
Image of Arduino based Home Automation System
 
Fig. 4: Image of Arduino based Home Automation System 
 
When the circuit is powered on, the Arduino loads the required libraries and switches relays to OFF position. Some initial messages are flashed on the LCD display and the status of all the four devices is shown OFF on the LCD. The Arduino waits for the numeric command to be received from the Bluetooth module. The four appliances are assigned numbers from 1 to 4. If either number is obtained as a string from the Bluetooth module, the status of the respective appliance is toggled. By default, the pins connecting to the relays have a LOW logic driving the relays to switch the appliances OFF. 
 
If an appliance is in OFF condition and number representing it is passed through the Bluetooth app, the Arduino switches the logic at the respective pin to HIGH triggering the relay to switch the appliance ON. The change in the status of the appliance is updated on the LCD display and the LED indicating supply to the appliance starts glowing due to forward biasing. 
 
If an appliance is in ON condition and number representing it is passed through the Bluetooth app, the Arduino switches the logic at the respective pin to LOW driving the relay to switch the appliance OFF. The change in the status of the appliance is updated on the LCD display and the LED indicating supply to the appliance stops glowing due to lack of forward voltage.
 
The numbers are transferred to the interfaced Bluetooth module from the paired smart phone. The smart phone must be paired with the Bluetooth module. Either Bluetooth Terminal or BT Voice app can be used to pass the numeric commands. 

Programming Guide – 

First of all the Software Serial library for serial communication with the Bluetooth Module and Liquid Crystal library for LCD interfacing are imported. An object of the virtual serial type is declared and mapped to the pins where Bluetooth module is interfaced. An object of Liquid Crystal type is instantiated and mapped with the pins connected to the LCD module. A variable to hold Bluetooth command is declared and variables tracking status of the appliances are declared. The pins connected to relays are assigned to variables ONE, TWO, THREE and FOUR.
 
Screenshot of Initialization in Arduino Code for Home Automation System
 
Fig. 5: Screenshot of Initialization in Arduino Code for Home Automation System
 
A setup() function is called in which the baud rate for serial communication with the Bluetooth module and the LCD module is set to 9600 bits per second using begin() method on the respective objects. The pins connecting relays are set digital output and initial messages are printed on the LCD.  
 
Screenshot of Setup Function in Arduino Code for Home Automation System
 
Fig. 6: Screenshot of Setup Function in Arduino Code for Home Automation System
 
The loop() function is called in which first it is tested if any serial data from the Bluetooth module is available. If it is available, it is read and stored in BTData variable. The value is BTData is compared to the numbers assigned to each appliance along with the status tracking variables and the status of the respective appliance is toggled accordingly in If-else decision making statements. The status of each device is updated on the LCD display by replacing the strings on the screen.   
 
Screenshot of Loop Function in Arduino Code for Home Automation System
 
Fig. 7: Screenshot of Loop Function in Arduino Code for Home Automation System
 
Note: The complete Arduino sketch for Bluetooth based Home Automation System can be found under the source code tab.

Project Source Code

###

//Program to 


#include <SoftwareSerial.h>// import the serial library

#include <LiquidCrystal.h>//import the LCD library


SoftwareSerial testserial(10, 11); // RX, TX

LiquidCrystal lcd(13, 12, 5, 4, 3, 2);// Pins used for RS,E,D4,D5,D6,D7

int BTData; // the data received from the app store here

int a=0,b=0,c=0,d=0,e=0; //used for key press or not 

int ONE=6;    //Digital pin 6 is used to ON relay 1

int TWO=7;    //Digital pin 7 is used to ON relay 2

int THREE=8;   //Digital pin 8 is used to ON relay 3

int FOUR=9;  //Digital pin 9 is used to ON relay 4

void setup() {

  // Setup code to initialize all the user and predefined functions

  testserial.begin(9600); //Software serial initialization

  lcd.begin(16,2);//LCD 16x2 initialization

  pinMode(ONE, OUTPUT);// Set pim 6 as OUTPUT

  pinMode(TWO, OUTPUT);// Set pim 7 as OUTPUT

  pinMode(THREE, OUTPUT); // Set pim 8 as OUTPUT

  pinMode(FOUR, OUTPUT); // Set pim 9 as OUTPUT

  lcd.setCursor(0,0); //Initially set the cursor position of LCD to 1st Columb 1st row.

  lcd.print("Engineers Garage");//After initialising print data

  lcd.setCursor(0,1); //Initially set the cursor position of LCD to 1st Columb 2nd row.

   lcd.print("               ");  //print blank to clear all the data on LCD

   delay(3000);

   lcd.setCursor(0,0);

   lcd.print(" BlueTooth Home ");

   lcd.setCursor(0,1);

   lcd.print("   Automation   ");  

   delay(3000);

   lcd.setCursor(0,0);

   lcd.print("D1:OFF    D2:OFF"); //Initially dispaly all are OFF 

   lcd.setCursor(0,1);

   lcd.print("D3:OFF    D4:OFF");//Initially dispaly all are OFF 

}



void loop() {

  

   if (testserial.available())  // wait for the data to be available at the receiver buffer.

       {

        BTData=testserial.read(); // Read the data and store it in the variable.

       //testserial.write(BTData); // Displaying in the serial monitor.

       if(BTData=='1' && a==0){   // Checking the received number if found with the given condition

       a=1;                       // "a" variable used to checked if button is pressed or not.

       digitalWrite(ONE,1);       //if pressed send HIGH value to the pin number 6

       lcd.setCursor(3,0);        

       lcd.print("ON ");          //Display ON in the location 1st ROW and 3rd COLOUMB

       }

      else if (BTData=='1' && a==1)

          {

          a=0;

          digitalWrite(ONE,0);

          lcd.setCursor(3,0);

          lcd.print("OFF");

          }

      else if (BTData=='2' && b==0)

            {

            b=1;

            digitalWrite(TWO,1);

            lcd.setCursor(13,0);

            lcd.print("ON ");

            }

      else if (BTData=='2' && b==1)

          {

          b=0;

          digitalWrite(TWO,0);

           lcd.setCursor(13,0);

            lcd.print("OFF ");

          }

      else if(BTData=='3' && c==0){   

       c=1;

       digitalWrite(THREE,1);

       lcd.setCursor(3,1);

       lcd.print("ON ");

       }

      else if (BTData=='3' && c==1)

          {

          c=0;

          digitalWrite(THREE,0);

           lcd.setCursor(3,1);

       lcd.print("OFF ");

          }

      else if (BTData=='4' && d==0)

            {

            d=1;

            digitalWrite(FOUR,1);

             lcd.setCursor(13,1);

            lcd.print("ON ");

            }

      else if (BTData=='4' && d==1)

          {// if number 0 pressed ....

          d=0;

          digitalWrite(FOUR,0);

           lcd.setCursor(13,1);

            lcd.print("OFF ");

          }

  

  else;

}

delay(100);

}

###

 


Circuit Diagrams

Circuit-Diagram-Arduino-HC-05-Bluetooth-Module-Home-Automation-System

Project Video


Filed Under: Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Snooping Around is All
  • mosfet driver problem in regeneration mode
  • Industrial Relay Board Design for Motorcycle Use
  • connector model question
  • ADEM III ECM — No CAN Signal & Power Supply Issue

RSS Electro-Tech-Online.com Discussions

  • Sump pit water alarm - Kicad 9
  • Pic18f25q10 osccon1 settings swordfish basic
  • Anyone jumped from Easyeda std to Easyeda pro?
  • turbo jet fan - feedback appreciated.
  • More fun with ws2812 this time XC8 and CLC

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • How IoT network topologies work
  • The top five AI startups to watch in 2025
  • STMicroelectronics unveils SoC based on secure MCU
  • Nexperia’s 48 V ESD diodes support higher data rates with ultra-low capacitance design
  • Taoglas releases Patriot antenna with 18 integrated elements covering 600 to 6000 MHz

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe