IoT with HC-05
Simple emulation of LED for Home Automation with Arduino Uno and HC-05. This can be applied to any home appliances with a relay.
You will need:
- Arduino UNO
- Resistors 1kΩ
- Jumpers Wires
- Bluetooth Module (HC-05/other);
- Android Phone;
- SPP Bluetooth App (ArduDroid/other)
- A little Embedded C programming skills
Bluetooth is a type of wireless communication used to transmit voice and data at high speeds using waves of radio. It’s widely used in mobile phones for making calls, headset and share data. This type of communication is a cheap and easy way to control something remotely using arduino.
HC-06 module has 6 pins to be connected to arduino, they are:
RXD will receive data from arduino; TXD will send data to arduino; VCC is the power supply (3.3V 6.6V) and GND is the ground. Key is used to config the bluetooth settings but we'll discuss that in another project and State is used to check the state of HC-05. For this project, we are not going to use KEY and STATE pins.
Connect the HC-05 module :
The sketch for this Project is very simple, all you have to do is check the serial port if there’s data available.
Using an android phone with a spp bluetooth app, the command is sent to bluetooth (RX/TX). What happens is the bluetooth module communicates with android's bluetooth using a profile called SPP (Serial Port Profile). It emulates a USB Port connected to arduino and android.
Connecting to HC-05 with your Android Phone is very easy. Switch ON the bluetooth on you phone, the HC-05 shows up as soon as its powered. The default Pairing Pin is "1234". You can change this with AT Commands and explain how to do that in another project, Wait for it.
Now, as your connected to HC-05, it should appear in Paired Devices. Now open the SPP Bluetooth App. I prefer ArduDroid as you have full control over all Analog and Digital pins of Arduino if you want to implement this in a large scale like complete Home Automation and even to Send and Get Data as what we are using now.
According to our code sketch, the LED glows if HC-05 recieves 1 and stops glowing if it recieves 0. So, just type 1 and press Send Data to make LED glow and Send 0 to stop LED.
You can use this simple concept to control all the lights in your home using one more component "Relay", which takes in the Line (220V in India) and Neutral and connects the Line to the Appliance if it is asked to do so.