With enhancement in technology, automation has become a need whether it is home, office or some other place. At home we come across many appliances be it fan, AC, TV, lights, etc. What if you could operate all of them with the Android Phone you’re holding in your hand..!!
This project aims to incorporate android phone control over electrical appliances. We use Bluetooth communication between Android phone and a Receiver (control unit) that is connected to the appliances.
Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile devices and building personal area networks (PANs). Invented by telecom vendor Ericsson in 1994, it was originally conceived as a wireless alternative to RS-232 data cables. It can connect several devices, overcoming problems of synchronization.
HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. It contains 6 pins that are labelled on the back but most modules only have 4 of those populated with pogo pins. KEY & STATE are not required, as KEY is used for flashing the device and STATE simply indicates whether the device is awake or not. So that leaves only GND, VCC, TXD, RXD.
For connecting the module with Arduino, we need to use the Serial (Tx and Rx) pins provided on the board.
Connections & WorkingMaking Connections with HC-05:
Some modules have VCC labelled for working voltages up to ~6 volts. These modules DO NOT like anything except 3.3 volts on the VCC line. We should use a level converter to 3.3V on the RXD line. Use two resistors, as a simple voltage divider to make the TTL level conversion. Wire one 2.2k ohm resistor to ground and another 1k ohm resistor to the TXD line on the MCU. Connect the RXD pin in between the two resistors for an output of approx 3.4 volts.
Connect RXD pin of module to TXD of Arduino (Digital Pin 1), through the voltage divider configuration shown below:
Now connect TXD of module to RXD of Arduino (Digital Pin 0).
To operate the appliances, we can’t connect them directly to Arduino. We need something called RELAY which is driven with the help of Transistor based driver circuit.
The ‘Input’ is from Arduino I/O pin. RB is the current limiting resistor at the base of the transistor. Its value is typically 10K Ohm. ‘VS’ is the supply voltage needed to trigger the Relay coil (It depends on the Relay rating). A diode is connected in Reverse in parallel to the relay. This is done to avoid the back e.m.f. generated by coil that can damage the transistor or the Arduino.
A simplified Block diagram of the complete system is shown below:
After making above connections, you’ll see blinking led on the module. This just ensures your device is powered properly. After that pick your Android Phone, and get the App- “Arduino Bluetooth Terminal” from the Google Play Store. This app is available for free, and is easy to use.
After installation, turn ON Bluetooth of phone. Now search for devices until you find HC-05 and then start pairing with it. Enter Password 1234, when asked.
If properly paired, the LED blinking on Bluetooth module will stop. If not check the connections again. Get back to the app you just downloaded. It’ll automatically find the device, match the key it displays, and start conversation. Make sure, the phone’s Bluetooth remains ON.
System Operation:
When we send ‘1’ to the Arduino, the Appliance 1 connected to Arduino Turns ON and when ‘2’ is sent, Appliance 2 turns ON. The serial data is read by Arduino, through Serial.read () function and is stored in the integer type variable state declared in the program. After this in the loop(), we just compare state value with 1, 2, 3 and so on till 8 to check the ON condition of 8 Appliances. Then we compare state value with a, b, c and so on till h to check the OFF condition of appliances and perform respective operation.
In addition to this we can also monitor the physical state such as temperature, pressure, etc., through the android phone. Say, we need to monitor the temperature of the room. We connect the LM35 Temperature sensor to the Arduino. Now read the sensor value and send it to the phone via serial link established over Bluetooth between the phone and Arduino.
.
Comments