Você está na página 1de 4

Study and Control of Bluetooth module HC-05 using Arduino Uno

Rajesh Shrestha1*
Department of Physics, Tribhuvan University, Nepal
E-mail: rajeshshrestha402@icloud.com

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 In Arduino Uno, Rx and Tx are used for


Bluetooth module HC-05.
Bluetooth is a wireless technology standard
for exchanging data over short distances
using short wavelength UHF radio waves Experimental
2.4 to 2.485 GHz from mobile device and First of all, connect the Arduino Uno to the
building personal area networks. It can computer or laptop with the help of Usb
connect several devices, overcoming cable. After then set the com port in your PC
problems of synchronization. for Arduino Uno and upload the sketch or
Arduino Uno is a microcontroller board program given below in code section. After
based on the ATmega series. It has 14 uploading the program to the Arduino Uno.
digital input/output pins, 6 analog inputs, a The next job is connecting the Bluetooth
16MHz quartz crystal, a USB connection, a moduleHC-05 to the Arduino Uno as shown
power jack, an ICSP header and a reset in fig below.
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
Fig1: Connection between the Arduino Uno and Bluetooth
module HC-05

1|Page
Connection between the Arduino Uno and if(int(val)==65)// Output 1high
Bluetooth module is as follows digitalWrite(2,HIGH);

else if (int(val)==97)// Output1low


Arduino Bluetooth
digitalWrite(2,LOW);
Uno
5v Vcc if(int(val)==66)// Output2high
Gnd Gnd digitalWrite(3,HIGH);
Rx Tx
Tx Rx else if(int(val)==98)// Output2low
digitalWrite(3,LOW);

The Arduino Uno is being programmed by if(int(val)==67)// Output3high


using the Arduino 1.0.5 software which is digitalWrite(4,HIGH);
easily downloaded from the Arduino.cc
webpage. The language for Arduino Uno is else if(int(val)==99)// Output3low
as follows. digitalWrite(4,LOW);

if(int(val)==68)// Output4high
digitalWrite(5,HIGH);
Arduino Uno Code Section
else if(int(val)==100)// Output4low
//This code is written by © Rajesh Shrestha digitalWrite(5,LOW);

byte val; if(int(val)==69)// Output5high


void setup() digitalWrite(6,HIGH);
{
Serial.begin(9600);//Change the baud rate else if(int(val)==101)// Output 5low
value depending on the default baud rate of your digitalWrite(6,LOW);
bluetooth module, for Bluesmirf-115200 and for if(int(val)==70)// Output6high
JY-MCU-9600 digitalWrite(7,HIGH);

pinMode(2, OUTPUT);//Output 1 else if(int(val)==102)// Output6low


pinMode(3, OUTPUT);// Output2 digitalWrite(7,LOW);
pinMode(4, OUTPUT);// Output3 if(int(val)==71)// Output7high
pinMode(5, OUTPUT);// Output4 digitalWrite(8,HIGH);
pinMode(6, OUTPUT);// Output5
pinMode(7, OUTPUT);// Output6 else if(int(val)==103)// Output7low
pinMode(8, OUTPUT);// Output7 digitalWrite(8,LOW);
pinMode(9, OUTPUT);// Output8 if(int(val)==72)// Output8high
} digitalWrite(9,HIGH);

void loop() else if(int(val)==104 )// Output8low


{ digitalWrite(9,LOW);
int a=0; }
if(Serial.available()) }
{
val=Serial.read();
Serial.println(int(val));//Display received
value on Serial Monitor

2|Page
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.

The program features.


1. It can Control up to 8 devices.
2.It Can be set Timer to ON / OFF the
When we press device 1 then the light
connected in Arduino Uno pin 2 is in ON device and show the countdown
state and again presses in same device 1 the timer.(Timer can be set to 1 minute, 15
LED light is in OFF state. It will ON and minutes, 30 minutes, 1 hour, 2 hours, 4
hours).
3|Page
3. You can Change and Edit your Device
Name.
References
4. It is Free Version Application with AD.
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.c-
Arduino Uno with the Bluetooth module and sharpcorner.com/UploadFile/167ad2/how-
relay driver works very well. It is easy to use to-use-hc-05-bluetooth-module-with-
arduino/
in our home as a smart home automation
system. It is very beneficial to the person http://circuitdigest.com
who is physically disable and also used for
http://www.hobbyprojects.com
aged person for controlling electrical
appliance remotely with the help of Android http://circuitdigest.com/microcontroller-
mobile phone. projects

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