BluetoothBluetooth is a technology for wireless communication. It is designed to replace cable connections.
Usually, it connects small devices like mobile phones, PDAs and TVs using a short-range wireless connection. And it uses the 2.45Ghz frequency band. The connection can be point-to-point or multipoint where the maximum range is 10 meters. The transfer rate of the data is 1Mbps (or a maximum of 2Mbps).Figure 1: BluetoothWhat we will doWe will create an Arduino-model where we turn on a LED light using Bluetooth commands. And we will that instruction using our Android Phone.
Check if your phone has Bluetooth by navigating to 'Wireless. To use the HC05 module, simply connect the VCC to the 5V output on the. Editor's note: The RX pin is not officially 5 V tolerant; it is designed for 3.3 V signals. Code to the Arduino if you have selected Pin 0 and 1 as Serial pins.
In short, we will control our LED using a phone.And via Bluetooth we will the ON/OFF instruction.Figure 2: Bluetooth stick ( Pic Courtesy: instructable.com)So, what we need:. Arduino Uno Board. Bluetooth Module (HC-05). 1x 3.5mm LED. 1k Ohm Resistor. Jumper WiresMost of the pre-requisites we have used already in my past articles, except for the Bluetooth Module HC-05.Figure 3: Bluetooth ModuleIt is a class-2 Bluetooth module with Serial Profile that can be used as Master or Slave. In Arduino, we will use Serial Communication for various purposes.
![Bluetooth Bluetooth](/uploads/1/2/5/6/125641100/726156610.jpg)
Since it also suports Serial Communication and you can treat it as a replacement.HC-05 Specifications. 2.45Ghz Frequency. Asynchronous Speed 2.1Mbps (max).160Kbps. Security: Authentication. Profile: Bluetooth Serial Port. Power Supply: +3.3 VDc. Working Temperature: 20C.
Cost: Around INR 300HC-05 DescriptionSo, we have six (or four) leads in this module. But we will genuinely care about only four of them. Where, the two are for Vcc and GND.Vcc= Power Supply (in other words 5V or 3.3V)GND= Ground (in other words 0 volt)And the next two leads are for RX (Receiving End) and TX (Transmitting End). From the basic idea, we can say the RX of the module will go to the TX of the Arduino UNO. In the same way, we connect the TX of the module with the RX of the Arduino UNO.Figure 4: Arduino UNOIn addition, you can add a LED to determine the instruction more correctly. So, add a LED to digital PIN 12.SketchIn this sketch, we will write the basic code where we are accepting 0 or 1 (in other words true or false) from the serial port and process accordingly.
I recommend getting a version of HC-05 with a breakout board, because it’s much easier to work with when you are experimenting or testing. The most popular HC-05 modules appear to be the FC-114 and the ZS-40.HC-05 Bluetooth module specs:Bluetooth V2.0+EDR.Typical -80dBm sensitivity.Up to +4dBm RF transmit power.Integrated antenna.I/O: 1.8 to 3.6V.PIO control.UART interface with programmable baud rate.Supported baud rates: 9600,0,00,200.Auto-connect to the last device on power on as default.Permits pairing device to connect as default.Auto-reconnect in 30 min when disconnected as a result of beyond the range of connection.Full. All HC-05 modules seem to be using 3.3V logic level. Since most Arduino boards use 5V logic level, we need to use a logic level converter between the Arduino and the HC-05 module RX pin to convert 5V to 3.3V. We can use a level converter board or a simple 2 resistor voltage divider.
In this tutorial I will use a 2 resistor voltage divider. There is no need to use a converter for the HC-05 TX pin because the Arduino works OK with the HC-05 3.3V logic.PartsArduino UNO (others can be used)HC-05 Wireless Bluetooth RF Transceiver Module1x10K resistor1x 22K (or 20K) resistorBreadboard+ Jumper wires. Apply power to the Arduino board by connecting to an USB connector on your PC or by connecting a power supply to the Arduino board DC input. The HC-05 module led should blink at a fast rate, signalling it is in data mode.Step 3 – Pair the HC-05 Bluetooth moduleOnce the Bluetooth module is powered, it should be visible by other Bluetooth enabled devices like a cell phone, tablet or PC. For this tutorial we need the Bluetooth module to be detected by the PC, so your must enable or install a Bluetooth device (like a USB dongle). When Bluetooth is enabled the Bluetooth icon is shown in the O.S. System tray area.
Click on it and select Add Devices. Your bluetooth module should be listed, usually as “HC-05”, click on it and then click Next. You will be prompted to enter the pairing code/password. The default code for most Bluetooth devices is either 1234 or 0000. If the pairing is successful, you will see a confirmation message.Remember that Bluetooth class 2 devices have a maximum range of about 30 ft (10m), but often reliable communication can only be made at distances shorter than 9 ft (3 m).