Home Automation using Arduino| Bluetooth and Manual Control Relay with EEPROM
In this Blog, we will creating a Home Automation system using Arduino Nano, 4 Relays, a Bluetooth module (HC-05), push buttons, and EEPROM.By following these steps, you will be able to make your own Home Automation System.Get ready to control your devices smoothly with just a tap on your Mobile!
Features of Home Automation using Arduino
In this Home Automation system,the Load can be controlled in two modes .
⇒Manual Mode:In manual mode, control the Load manually by press push button.
⇒Bluetooth Mode:In Bluetooth Mode, control the Load just a tap on Mobile App.
Two modes also work simultaneously in this system
⇒Integrate EEPROM to store relay states. This ensures that device states are remembered even if the power is turned off and then back on.
Required Components for Home Automation Project
⇨Arduino Nano
⇨HC-05 Bluetooth Module
⇨Push Buttons-5 Pcs
⇨5V Relay-4 pcs
⇨817c Optocoupler-4 pcs
⇨IN4007 Diode-5 pcs
⇨BC547 Transistor-4 pcs
⇨Screw Terminal -1 pcs
⇨DC power socket-1 pcs
⇨Switch-1 pcs
⇨female Pin Header
LED
⇨Red LED(3mm)-4 pcs
⇨Blue LED(3mm)-1 pcs
⇨Red LED(5mm)-1 pcs
Electrolytic Capacitors
⇨100μF/25v-1 pcs
Resistors(1/4 watt)
⇨330 Ω-5 pcs
⇨1 KΩ-6 pcs
⇨2.2 KΩ-1 pcs
⇨Power Supply-5 Volt DC
Overview of Arduino Nano
Key Features of Arduino Nano
The pin configuration of the Arduino Nano.
Overview of HC-05 Bluetooth Module
The HC-05 is a Bluetooth module that supports Bluetooth 2.0 and can operate in both Master and Slave modes. It communicates with microcontrollers or other devices using a serial UART interface. It supports common baud rates like 9600 bps by default.Pin Configuration of HC-05 :
Overview Relay Module
Pin Configuration Relay :
➨Common(COM):Connected to Load terminal.
➨Normally Closed(NC):connected to the load terminal before the relay turned on.
➨Normally Open(NO): connected to the load terminal after the relay turned on.
Purpose of EEPROM in Home Automation
The Electrically Erasable Programmable Read-Only Memory or EEPROM is a non-volatile memory storage solution on the Arduino board. Unlike RAM (Random Access Memory), EEPROM retains its stored information even when the power is turned off. EEPROM plays a crucial role In home automation project, It is employed to store the the last state(on or off) of each relays when the power is turned off.so that after power turned on, the system can restore the relays to their previous states.Circuit Diagram of Home Automation using Arduino
Click on the Download buttons to download the Circuit Diagram of Home Automation using Arduino.
👉Click here-How to make a Relay module with Optocoupler
Explanation of the Circuit
Relay1,Relay2,Relay3,Relay4 are connected with D5,D4,D3,D2 pin of Arduino Nano accordingly.
3mm blue Led is connected with D13 pin of Arduino Nano this LED is used for Bluetooth indication.
Push Button 1,Push Button 2,Push Button 3,Push Button 4,Push Button 5 are connected with D7,D8,D9,D10,D11 pin of Arduino Nano accordingly. Push Buttons(1,2,3,4) are used for manually controlled relays(1,2,3,4) individually and Push Buttons 5 is used for manually controlled all relays together.
For the serial communication with HC-05 Bluetooth Module,used RX(receive) and TX(transmit) pin of Arduino Nano.TX pin of the HC-05 connect to the RX pin of the Arduino Nano and RX pin of the HC-05 connect to the TX pin of the Arduino Nano.
The RX pin of the HC-05 is designed to handle 3.3V logic levels. If directly connect it to the TX pin of the Arduino, which operates at 5V, there is a risk of damaging the HC-05 due to the higher voltage. Solution of that problem A voltage divider is employed using 2.2kΩ and 1kΩ resistors to lower the Arduino's 5V logic level to the HC-05's 3.3V logic level.
Programming Arduino Nano Using Arduino IDE
Steps 1-Arduino IDE Setup
Steps 2-Uploading the Sketch to Arduino Nano
Click on the Download buttons to download the source codes for Home Automation using Arduino project.
⇒Connect the USB cable to the Arduino Nano's USB port and Connect the other end of the USB cable to the USB port of PC.
⇒Open the Downloded sketch file in Arduino IDE and follow these steps for Uploading the Sketch to Arduino Nano.
Before uploading a program to the Arduino Nano, disconnect the TX and RX pins of the HC-05 from the Arduino. Once the upload is complete, reconnect them.
👉Click Here For Other Arduino Based Project
⇒LED on the HC-05 module will blinking.
⇒Enable Bluetooth on smartphone
⇒Search for available devices in the Bluetooth settings
⇒You should see a device named similar to "HC-05"
⇒Select the HC-05 for the pairing process.
⇒The default pairing code for the HC-05 is "1234" or "0000."
⇒After successful connection the LED on the HC-05 module change its blinking pattern to indicate a successful connection
Click on the Download buttons to download the Bluetooth app for Home Automation using Arduino project.
⇒Launch the Bluetooth app on your smartphone
⇒Tap on "Connect" button on app
⇒Select the HC-05 from the list of available devices.
⇒After successful connection, you should see a connected status in the Bluetooth app & Circuit's Blue Led turn on.this Led indicates that Mobile App connected with HC-05.
Connect loads to the Circuit
In this circuit normally closed (NC) pins are not used.Common (COM) pins of each Relay already connected together in this circuit.Here's a step-by-step guide on how to connect loads.
⇒Step1:One end of each loads join together and Connect to the negative terminal of AC power supply.
⇒Step2:The positive terminal of AC power supply connect to Common (COM) pins of Relays.
⇒Step3:Connect the other end of the each load to the normally open (NO) pin of each Relay.
Warning:Mishandling AC current can be hazardous.Please Ensure that you are familiar with proper safety procedures, and take necessary precautions when working with High-voltage AC current it can be potentially very dangerous.
Diy Tech Shop is not responsible for any injuries or damages while following this tutorial.
Complete setup of Home Automation using Arduino
Congratulations! You've successfully created your own DIY Arduino home automation system,With just a few components and some programming,Now circuit is ready to control your home devices seamlessly,you can now control devices in your home with a simple tap on your Mobile phone screen. Using this setup, you can turn any device into a smart device that can be controlled from your smartphone.
Step By Step Video Tutorial Of Home Automation using Arduino
Frequently Asked Questions
What is Voltage Divider?
A voltage divider is a simple circuit that consists of two resistors in series that dividing the input voltage into a lower output voltage. The voltage across the second resistor in the series is the output voltage.
Why Voltage Divider is used when connecting the HC-05 Bluetooth module to an Arduino?
The RX pin of the HC-05 is designed to handle 3.3V logic levels. If directly connect it to the TX pin of the Arduino, which operates at 5V, there is a risk of damaging the HC-05 due to the higher voltage.Solution of that problem A voltage divider is employed using 2.2kΩ and 1kΩ resistors to lower the Arduino's 5V logic level to the HC-05's 3.3V logic level.
Why Disconnect HC-05 During uploading a program in Arduino?
When upload a program to the Arduino through the USB connection, it uses the same serial communication pins (D0 and D1) to communicate with computer. If the HC-05 and the Arduino share the same hardware serial port for communication (pins D0 for RX and D1 for TX) at the same time, it may interfere with the programming process, leading to communication errors and potential disconnection.
How to uploading a program in Arduino without Disconnecting HC-05?
Use software serial for communication with the HC-05 instead of the hardware serial. This involves connecting the HC-05 to different digital pins (other than Tx,Rx) and using the "SoftwareSerial" library in your Arduino sketch.
Why EEPROM used in Arduino Home Automation system?
EEPROM plays a crucial role In home automation project, It is employed to store the the last state(on or off) of each relays when the power is turned off.so that after power turned on, the system can restore the relays to their previous states.
Diy Tech Shop