HC-06 BLUETOOTH MODULE

Description

  • Bluetooth module for use with any microcontroller
  • Compatible with Android devices only
  • Uses serial communication to make it easy to send and receive data wirelessly
  • Designed for 3.3V levels ttl but will accept 5V levels as well
  • Built in antenna with a range of up to 10m
  • Supports baud rates from 1200 to 1382400 bps (default is 9600 bps)
  • VCC input voltage 5V
  • Easy to use and set up

This Bluetooth module is easy to use and to set up. You can power it directly from the Arduino 5V power pin and connect the serial transmit and receive pins directly to the Arduino serial pins or any pin using the software serial library. Use any available App online or use the one recommended by us with already available libraries and sample code. Getting it working is a breeze. Its operating frequency is among the most popular 2.4GHz ISM frequency band (i.e. Industrial, scientific and medical) and adopts Bluetooth 2.0+EDR standard. In Bluetooth 2.0, signal transmit time of different devices stands at a 0.5 seconds interval so that the workload of the Bluetooth chip can be reduced substantially and more sleeping time can be saved for Bluetooth.

Supply Voltage +5 VDC 50mA
Deafault settings Baud rate:9600 N81, ID: HC-06, Password:1234
Serial Voltage 3.3 V (5V compatible)
Bluetooth protocol Bluetooth 2.0+ EDR standard
Operating frequency 2.4GHz ISM frequency band
Transmit power ≤ 4dBm, second stage
Sensitivity ≤ -84dBm at 0.1% Bit Error Rate
Transmission speed 2.1Mbps(Max)/160 kbps(Asynchronous); 1Mbps/1Mbps(Synchronous)
Safety feature Authentication and encryption
Supported serial frequencies 1200, 2400, 4800, 9600 (Default), 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1382400
Operating temperature -20 to 55℃
Size 37*17mm
Weight 4g

Easy to connect with only four cables. You can pin the module on the breadboard and use the male to male dupont cables or use the male to female dupont cables and connect the module directly to the Arduino compatible board.

Supply voltage to the board connecting the +5v pin to the 5v power pin and the GND pin to the GND pin. If you want to use an external power supply be sure to connect the grounds together with the serial transmitting/receiving device. Connect TX to RX and RX to TX. On the Arduino compatible board this would be RX to pin 1(TX) and TX to pin 0(RX). If you are using software serial be sure to check your pin definitions for RX/TX, mostly pin 2 for RX and pin 3 for TX.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
*** Reviewed by Dr. Mangus from Mango Labs ***
–HELLO WORLD – Led tst —
To compile this code using RemoteXY library 2.3.3 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
– for ANDROID 4.1.1 or later version;
– for iOS 1.2.1 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL_RX 2 //connect TX to Arduino digital 2
#define REMOTEXY_SERIAL_TX 3 //connect RX to Arduino digital 3
#define REMOTEXY_SERIAL_SPEED 9600
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =  // configuration of control surface
{ 255,1,0,0,0,20,0,8,25,0,  // send to device
2,0,39,26,22,11,2,26,31,31,
79,78,0,79,70,70,0 };
// this structure defines all the variables of your control interface
struct {
// input variable
uint8_t switch_1; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#define PIN_SWITCH_1 13 // Arduino digital 13 build in LED
void setup()
{
RemoteXY_Init ();
pinMode (PIN_SWITCH_1, OUTPUT);
// Your additional setup code here
}
void loop()
{
RemoteXY_Handler ();
digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
// Your additional loop code here
// use the RemoteXY structure for data transfer
}
  1. In this example we are connecting:
    Arduino    BT
    D2     —– Tx
    D3     —– Rx
    GND —– GND
    5V     —– Vcc
  2. Download and install the Arduino environment from here or use the web editor.
  3. Download the Arduino libraries here.
  4. Unzip and paste the folder in the Arduino libraries folder. It’s in the same location as your default sketches. You can look it up under File/Preferences Sketchbook location.
  5. Download this sketch and open or open the Arduino environment and copy the code into a blank sketch.
  6. Connect your board to your computer with the included usb cable.
  7. Select your board in Tools/Board/Arduino Uno.
  8. Select your port in Tools/Port/COM#(Arduino Uno), this will change slightly depending on your operating system.
  9. Upload pressing the arrow in the circle on the upper left.
  10. Download the app here.
  11. Activate bluetooth on your device and connect to HC-06, use the pin 1234.
  12. Launch the RemoteXY app and connect to HC-06. You should be able to turn the led on pin13 on and off with your cell phone.