Maker Portal

View Original

Bluetooth Home Automation Light Bulb Switch Using An HC-05, A Relay, and Arduino

I used an HC-05 Bluetooth module, a relay switch, a light bulb switch, and an Arduino Uno to create a wireless home automation light switch. The goal was to establish a wireless protocol for switching a light bulb on and off using a simple app on a smartphone. The relay switch controls the power to the light bulb, the HC-05 handles the Bluetooth, and the Uno reads the Bluetooth module to control the relay. The tools implemented can be extrapolated to other projects such as automated blinds, temperature controlled fans, motion sensors, security cameras, smoke detectors, etc. 


PARTS LIST:

  • Light bulb socket (here)

  • Relay switch (here)

  • Bluetooth HC-05 (here)

  • Arduino Uno


See this content in the original post

See this content in the original post

See this content in the original post

I used a simple Andoid app that connects to the HC-05 and transmits strings. Using the app, on the Arduino side we can decode the signal to create a protocol that turns the light switch on or off. It can be as simple as 1s and 0s, or as complex as you want. I used a 1 for on, and a 0 for off, and this method is used in the Arduino code below. To change the protocol, just change the code section in the 'if' statement, and make sure to send the desired protocol through the Android app.

Andoid HC-05 App


See this content in the original post

CONCLUSION

This project is straightforward, so I did not feel the need to make many comments throughout. The important thing to remember about using a relay module is that it involves switching AC current, also called mains power. This is a dangerous process. So please use caution when disassembling the light bulb socket. This project is a great introduction to using relays and switching, while also utilizing wireless technology and Arduino. The Bluetooth protocol process is useful for wireless sensing and control, and I hope the educational nature of this project opens up avenues in home automation, remote sensing, wireless control, and electronics in general. 

See more in Electronics:

See this gallery in the original post

Related Products:

See this gallery in the original post