Home Automation

This smart relay has the following features:

1. Home appliances controlled by mobile Bluetooth

2. Home appliances controlled by TV Remote (Infrared)

3. Home appliances controlled by temperature & Humidity sensor automatically

4. Home appliances controlled by Dark Sensor

5. Display the LIVE temperature & Humidity reading.

6. Home appliances controlled with manual switches

7. Inbuilt Arduino so Arduino code can be uploaded to the relay module.

Supplies:

Required Components for the Smart Home Projects:

1. ATMEGA328P microcontroller

2. HC05 Bluetooth Module

3. DHT11 Sensor

4. OLED Display (128 X 32)

5. 1738 Infrared Receiver

6. PC817 Optocoupler (5 no)

7. BC547 NPN Transistors (5 no)

8. 1N4007 Diodes (5 no)

9. 1N4001 Diode (1 no)

10. LEDs 5mm (6 no)

11. 22pF Capacitors (2 no)

12. 100nF (104) Capacitor (1 no)

13. 100uF Capacitor (1 no)

14. 220-ohm Resistors (10 no) (R6 to R10)

15. 1k Resistors (7 no) (R1 to R5)

16. 10k Resistors (8 no)

17. 2k (1no) & 4.7k (1no) Resistor

18. LDR (1 no)

19. 16MHz Crystal,

20. Push Buttons (8 no)

21. 5V relays (5 no)

22. Jumper (2no), connectors, IC base

23. FTDI 232 USB to Serial interface board or Arduino UNO

24. PCB


Step 1: Circuit Diagram

Circuit Diagram


This is the complete circuit diagram for this home automation project. I have explained the circuit in the tutorial video.

I have used the ATMEGA328P micro controller to control the 5 channel relay module. I have also connected the HC05 Bluetooth module, 1738 IR receiver to control the relays from Bluetooth and Infrared remote. And DHT11 temperature & humidity sensor and LDR to control the relay automatically.

In this circuit, we can use both 5V or 12V relay but we have to change the resistors accordingly as mentioned in the circuit.



Step 2: Make the Circuit on Breadboard for Testing

Make the Circuit on Breadboard for TestingMake the Circuit on Breadboard for TestingMake the Circuit on Breadboard for Testing

Before designing the PCB first I have made the circuit on the breadboard for testing. During testing, I have uploaded the Arduino sketch to the Atmega328P microcontroller using a USB to Serial interface board (FTDI232) then tried to control the relays with Bluetooth, TV remote, temperature sensor, LDR, etc.

I have also mapped all the microcontroller pin that used in this circuit.


Step 3: Different Mode of the Smart Relay Module

Different Mode of the Smart Relay Module


In this Smart home project we can control the relay module in different modes:

1. Bluetooth Mode

2. Infrared Mode

3. Auto Mode

4. Manual Mode

We can easily change the mode with the CMODE and SMODE button fitted on the PCB.

To change the mode:

1. Press the CMODE button.

2. Then press the SMODE button to select the mode.

3. After selecting the mode again press the CMODE button.



Step 4: Bluetooth Controlled Mode

Bluetooth Controlled ModeBluetooth Controlled ModeBluetooth Controlled Mode

Here we will use the HC05 Bluetooth module and Bluetooth Arduino app from the play store to control the relay module from the smartphone. You can use other apps but you have to modify the code accordingly.

As the logic level of the HC05 is 3.3volt but for the microcontroller the logic level is 5volt. So I have used a voltage divider with 2k and 4.7k resistor while connecting RX of the HC05 to TX of the Atmega328P.


Step 5: Infrared Controlled Mode


Infrared Controlled ModeInfrared Controlled ModeInfrared Controlled Mode

Here we will use the 1738 Infrared receiver to control the relay module from the TV remote. You can use any infrared remote but you have to get the respective Hex codes of the remote buttons and modify the code accordingly.

You can refer to the embedded video where I have explained how you can easily get the hex code from the TV remote button.

You can use any unused button from the remote to control the relay module.


Step 6: Temperature and Light Controlled Mode

Temperature and Light Controlled ModeTemperature and Light Controlled ModeTemperature and Light Controlled Mode

In Auto mode, this smart relay module can be controlled by pre-defined room temperature and sunlight. It has a DHT11 temperature and humidity sensor sense the temperature and humidity after every 5-second interval.

When the temperature crosses the predefined max temperature value mentioned in the Arduino code the relay 1 and the relay 2 turns on.

When the temperature becomes lower than the predefined min temperature value mentioned in the Arduino code the relay 1 and the relay 2 turns off.

LDR Control

An LDR is fitted on the PCB to sense the ambient light. It acts as a dark sensor.

When the brightness level becomes below the predefined value the Relay 3 and Relay 4 turns on.

When the brightness level crosses the predefined value the Relay 3 and Relay 4 turns off.

Please refer to the Embedded video on the top for better understanding.


Step 7: Manual Mode

Manual ModeManual Mode


The Relay module also can be controlled manually from the push buttons fitted on the PCB.

There are 5 push buttons S1, S2, S3, S4, S5 to turn on and turn off the Relay1, Relay2, Relay3, Relay4, Relay5 respectively.

And there is a RESET button to turn off all the relays at a time.

I have explained the functionality of the circuit in the tutorial video.


Step 8: Designing the PCB

Designing the PCBDesigning the PCB


As I am going to use the circuit daily, so after testing all the features of the smart relay module on the breadboard, we can start designing the PCB.

You can download the PCB Gerber file of this home automation project from the following link:

https://drive.google.com/uc?export=download&id=180s0bidnq6u6ilYs4vcLQwcjJ2zMrFZP


Step 9: Order the PCB


2. Click on the QUOTE NOW button.

3 Click on the "Add your Gerber file" button. Then browse and select the Gerber file you have downloaded.



4. Set the required parameter like quantity, PCB color, etc

5. After selecting all the Parameters for PCB click on SAVE TO CART button.


Step 11: Select Shipping Address and Payment Mode

Select Shipping Address and Payment ModeSelect Shipping Address and Payment ModeSelect Shipping Address and Payment Mode

6. Type the Shipping Address.

7. Select the Shipping Method suitable for you.

8. Submit the order and proceed for the payment.

You can also track your order from the JLCPCB.com

My PCBs took 2 days to get manufactured and arrived within a week using the DHL delivery option. PCBs were well packed and the quality was really good at this affordable price.


Step 12: Solder All the Components

Solder All the ComponentsSolder All the ComponentsSolder All the Components

After that solder all the components as per the circuit diagram.

Then connect atmega328P microcontroller, HC05, and all the sensors.


Step 13: Program the Microcontroller

Program the MicrocontrollerProgram the MicrocontrollerProgram the Microcontroller

1. Connect the USB to Serial interface board (FTDI232).

2. Download the Arduino sketch. (Attached)

3. Select the Arduino UNO board and proper PORT. Then upload the code.


Step 14: Connect the Home Appliances

Connect the Home Appliances


Connect the 5 home appliances as per the circuit diagram. Please take proper safety precautions while working with high voltage.

Connect 5Volt DC supply to PCB as shown in the circuit. (I have used my old mobile charger)


Step 15: Finally

FinallyFinally


Turn on the 110V/230V supply and 5V DC supply.

Now you can control your home appliances in a smart way.

I hope you have licked this home automation project. I have shared all the required information for this project.

I will really appreciate it if you share your valuable feedback, Also if you have any query please write in the comment section.

For more such project Please follow TechStudyCell. Thank you & Happy Learning.

Thanks pcbway




Apply for sponsorship >>
1600+ Projects Sponsored
Feb 13,2020
2,141 viewsReport item
  • Comments(1)
  • Likes(4)
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000