Study and Control of Bluetooth module HC-05 using Arduino Uno Rajesh Shrestha1* Department of Physics, Tribhuvan University, Nepal E-mail:
[email protected]
Abstract Bluetooth is a radio frequency base technology for wireless communication. It is designed to replace cable connections. Usually, it connects small devices like mobile phones, computer, PDAs and TVs using a short-range wireless connection. It uses the 2.45 GHz frequency band. The connection has the maximum range is 10 meters. The transfer rate of the data is 1Mbps (or a maximum of 2Mbps).We used an Arduino Uno where we turn ON and OFF LED light using Bluetooth commands. And we send that instruction using our Android Phone. In short, we will control our LED using a phone via Bluetooth. Keywords: Arduino Uno, Bluetooth Module, Relay Driver, Smart Home System, light control, Automation System
Introduction Bluetooth is a wireless technology standard for exchanging data over short distances using short wavelength UHF radio waves 2.4 to 2.485 GHz from mobile device and building personal area networks. It can connect several devices, overcoming problems of synchronization. Arduino Uno is a microcontroller board based on the ATmega series. It has 14 digital input/output pins, 6 analog inputs, a 16MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC to DC adaptor or battery to get started. “Uno” means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0.5
In Arduino Uno, Rx and Tx are used for Bluetooth module HC-05.
Experimental First of all, connect the Arduino Uno to the computer or laptop with the help of Usb cable. After then set the com port in your PC for Arduino Uno and upload the sketch or program given below in code section. After uploading the program to the Arduino Uno. The next job is connecting the Bluetooth moduleHC-05 to the Arduino Uno as shown in fig below.
Fig1: Connection between the Arduino Uno and Bluetooth module HC-05
1|Page
Connection between the Arduino Uno and Bluetooth module is as follows Arduino Uno 5v Gnd Rx Tx
if(int(val)==65)// Output 1high digitalWrite(2,HIGH); else if (int(val)==97)// Output1low digitalWrite(2,LOW);
Bluetooth Vcc Gnd Tx Rx
if(int(val)==66)// Output2high digitalWrite(3,HIGH); else if(int(val)==98)// Output2low digitalWrite(3,LOW);
The Arduino Uno is being programmed by using the Arduino 1.0.5 software which is easily downloaded from the Arduino.cc webpage. The language for Arduino Uno is as follows.
if(int(val)==67)// Output3high digitalWrite(4,HIGH); else if(int(val)==99)// Output3low digitalWrite(4,LOW); if(int(val)==68)// Output4high digitalWrite(5,HIGH);
Arduino Uno Code Section //This code is written by © Rajesh Shrestha byte val; void setup() { Serial.begin(9600);//Change the baud rate value depending on the default baud rate of your bluetooth module, for Bluesmirf-115200 and for JY-MCU-9600
else if(int(val)==100)// Output4low digitalWrite(5,LOW); if(int(val)==69)// Output5high digitalWrite(6,HIGH); else if(int(val)==101)// Output 5low digitalWrite(6,LOW); if(int(val)==70)// Output6high digitalWrite(7,HIGH);
pinMode(2, OUTPUT);//Output 1 pinMode(3, OUTPUT);// Output2 pinMode(4, OUTPUT);// Output3 pinMode(5, OUTPUT);// Output4 pinMode(6, OUTPUT);// Output5 pinMode(7, OUTPUT);// Output6 pinMode(8, OUTPUT);// Output7 pinMode(9, OUTPUT);// Output8
else if(int(val)==102)// Output6low digitalWrite(7,LOW); if(int(val)==71)// Output7high digitalWrite(8,HIGH);
void loop() { int a=0; if(Serial.available()) { val=Serial.read(); Serial.println(int(val));//Display value on Serial Monitor
else if(int(val)==104 )// Output8low digitalWrite(9,LOW); } }
else if(int(val)==103)// Output7low digitalWrite(8,LOW); if(int(val)==72)// Output8high digitalWrite(9,HIGH);
}
2|Page
received
OFF up to eight LED. It means it can control up to eight devices.
Results and Discussions Download the android apps Arduino Bluetooth from the Google play store which is freely available. Install it to your phone. After then open Bluetooth in our mobile device and search for it.
By using the relay driver along with the Arduino Uno and Bluetooth module we can controlled eight home appliances at a time.
In Bluetooth list you will get HC-05, select it and press in connect menu. After connection you will get something like as shown in picture below.
Uses Arduino Bluetooth Control Device Application is to allow you to control various electrical devices up to eight devices and independently controlled. Use Android Bluetooth mobile device to remote control your device with Serial TTL Bluetooth Module and Arduino Board. It is used for Automation System, Smart Home Automation, light control etc.
When we press device 1 then the light connected in Arduino Uno pin 2 is in ON state and again presses in same device 1 the LED light is in OFF state. It will ON and
3|Page
The program features. 1. It can Control up to 8 devices. 2.It Can be set Timer to ON / OFF the device and show the countdown timer.(Timer can be set to 1 minute, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours).
3. You can Change and Edit your Device Name. 4. It is Free Version Application with AD.
References http://arduino.cc/ http://crackeconcept.blogspot.com/2014/03/ arduino-and-matlab-interfacing-via.html
Conclusion
http://play.google.com/store/apps/details?id=ardui no.control.device
From this experiment, we conclude that the
http://www.csharpcorner.com/UploadFile/167ad2/howto-use-hc-05-bluetooth-module-witharduino/
Arduino Uno with the Bluetooth module and relay driver works very well. It is easy to use in our home as a smart home automation system. It is very beneficial to the person who is physically disable and also used for aged person for controlling electrical appliance remotely with the help of Android mobile phone.
Acknowledgement I would like to thank my mom and dad for inspiring me to make such a prototype electronic gadget which is needed by today’s world.
4|Page
http://circuitdigest.com http://www.hobbyprojects.com http://circuitdigest.com/microcontrollerprojects