[Link] open in browser PRO version Are you a developer?
Try out the HTML to PDF API
Category: Main page Arduino
Arduino and Bluetooth
Hart Transmitter
[Link]/HART-Modem
Reduce Power & Footprint for Hart Modem IC Design. Get
PDF Now
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
China's Bluetooth Serail modules are very cheap: 5-10$ per module. You can find them on eBay: Bluetooth RS232, Bluetooth Serial, HC-03, HC-04, HC-05, HC-06.
Most modules use a chip BC417 and Flash memory. Specification:
CSR chip: Bluetooth v2.0
Wave band: 2.4GHz-2.8GHz, ISM Band
Protocol: Bluetooth V2.0
Voltage: 3.3 (2.7V-4.2V)
Current: Paring - 35mA, Connected - 8mA
The command set of HC-03 and HC-05 are more flexible than HC-04 and HC-06 modules.
We'll be working with the module HC-06. Circuit diagram:
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
HC-04/HC-06 pins:
UART_TX (pin 1), UART_RX (pin 2), UART_CTS (pin 3), UART_RTS (pin 4) - UART.
3,3V (pin 12) - Power 3.3V.
GND (pin 13) - GND.
PIO1 (pin 24) - LED working mode indicator
HC-03/HC-05 pins:
UART_TX (pin 1), UART_RX (pin 2), UART_CTS (pin 3), UART_RTS (pin 4) - UART.
PIO8 (pin 31) - LED1 working mode indicator.
PIO9 (pin 32) - LED2. Before paired, it output low level. Once the pair is finished, it output high level.
PIO11 (pin 34) - KEY. Mode switch input. If it is input low level, the module is at paired or communication mode. If
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
its input high level, the module will enter to AT mode.
See PDF documentation.
We will connect the Bluetooth module HC-06 to the Arduino Nano V3:
3.3V Arduino pin - to 12 pin HC-06 Bluetooth module
GND Arduino pin - to 13 pin HC-06 Bluetooth module
TX Arduino pin - to 2 pin HC-06 Bluetooth module (RX)
RX Arduino pin - to 1 pin HC-06 Bluetooth module (TX)
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
Transfer data from the Arduino via Bluetooth
Program to send data from the Bluetooth module to the computer
1 int cnt = 0; // Counter
?
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
On PC, I use cheapest Bluetooth USB Adapter. After power on, you will be prompted to enter your Bluetooth devices pairing code/password. The default for most Bluetooth
devices is 1234. If the pairing is successful, you will see a message.
Now the Bluetooth device and PC are connected.
To view the received data we need a Terminal on PC. I use the Tera Term. After starting the program, select the virtual COM-port of the PC Bluetooth device.
1
2
3
4
5
6
7
8
9
10
11
12
int cnt = 0; // Counter
void setup() {
[Link](9600); // Initialization
}
void loop() {
cnt++;
[Link]("Hello BB from Arduino! Counter:"); // print message
[Link](cnt); // print counter
delay(1000); // wait 1 sec
}
?
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
You will see counter from Arduino:
Bi-directional communication between PC and Arduino via Bluetooth
To the diagram, I added the LED connecting it to the 12 pin Arduino, via current-limiting resistor. But you can use build-in LED (13 pin). Our program is very simple:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
char incomingByte; // incoming data
int LED = 12; // LED pin
void setup() {
[Link](9600); // initialization
pinMode(LED, OUTPUT);
[Link]("Press 1 to LED ON or 0 to LED OFF...");
}
void loop() {
if ([Link]() > 0) { // if the data came
incomingByte = [Link](); // read byte
if(incomingByte == '0') {
digitalWrite(LED, LOW); // if 1, switch LED Off
[Link]("LED OFF. Press 1 to LED ON!"); // print message
}
if(incomingByte == '1') {
digitalWrite(LED, HIGH); // if 0, switch LED on
[Link]("LED ON. Press 0 to LED OFF!");
}
}
}
?
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
See screenshot:
Video:
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
Android
To work with the Android you will need program: Bluetooth Terminal. Click in menu "Connect a device - Secure" and select our device "BOLUTEK". See video:
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
Download source code for Arduino
Author: Koltykov A.V.
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
-3
+1
Franco 2013-12-16 [Link]
Hello
I have implemented your project using Arduino UNO and RN41 bluetooth module. My Pc is able to see the device and to add it, but on Tera Term appears nothing.
I tryed to change the baud rate, but the result is the same. I'm able only to read "Hello BB from Arduino! Counter: 1" using the terminal monitor on the serial port of
Arduino. Can you help me? Thanks!
[Reply] [Reply with quote]
Akash 2013-11-01 [Link]
Where to upload the bluetooth Code?
[Reply] [Reply with quote]
2
vSphere Backup & Recovery
[Link]/vmware
Single physical & virtual backups Broadest Platform & Tape
Support.
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
-6
+1
0
+10
Mirwal 2013-08-03 [Link]
oh je...
on Mega work HC-06 ferfect
RX1 and RX2 and RX3 and
TX1 and TX2 and TX3 and TX
on Nano work HC-06 only TX (TXD0) vor read.
RX is connected to the ATMega and used for USB program and communicating with it.
[Reply] [Reply with quote]
kfang 2013-07-08 [Link]
Hi all,
I am having trouble with the code. Similar to some other viewers, arduino does not react to the BT signal sent from PC. Details as follow:
1) Configurated arduino as discribed, but didn't work.
2) Initial thought a problem with BT module, so modified code as follow
(if ([Link]() > 0) { // if the data came
incomingByte = [Link](); // read byte
[Link]("incomingByte");
When ANY BUTTON (not just 1 or 0), Tera Term VT screen show messages like "225" (max) or "221" or "190"...
Can anyone please advise? had been struggling on it for some time. Many thanks.
[Reply] [Reply with quote]
niq_ro 2013-04-22 [Link]
I try both examples ("Transfer data from the Arduino via Bluetooth" & "Bi-directional communication between PC and Arduino via Bluetooth") and I must use first IVT
BlueSoleil for connect my "linvor" with PC then TERA TEMP VT for control... thanks for the info
[Reply] [Reply with quote]
atikna 2013-03-31 [Link]
Hi,
We are using HC-05 low cost bluetooth module for our project but finding difficult in configuring the module at the hyperterminal. its not giving any response for the
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
+7
-2
+4
-5
+10
AT commands to change name ,password [Link] tried using the TTL to RS232 convertor also but it dint work [Link] module is getting detected and paired by its
default password and [Link] help
[Reply] [Reply with quote]
Ankita 2013-03-30 [Link]
Hi,
I am using the same module.I am able to detect the chip using bluetooth present in a laptop and also able to pair [Link] when I try to configure the chip to change
the name etc using AT commands at the [Link] doesnt give any [Link] help
[Reply] [Reply with quote]
steve 2013-03-16 [Link]
hey im having trouble with hc 05, it gets paired and accepts data but wont react to the data
thanks
[Reply] [Reply with quote]
Jim 2013-03-06 [Link]
Hi, I can't get my HC-05 to respond in AT mode. I pull pin 11 high, wait 1 sec, send [Link]('AT+STATE?');
My SerialEvent doesn't fire off.
I've tested the HC-05 with sending and receiving data and it works fine, just the AT commands in software don't seem to get response.
Any ideas?
[Reply] [Reply with quote]
PA 2013-06-14 [Link]
when connecting to "command mode", the baud rate is not 9600, change to 38400
[Reply] [Reply with quote]
slach 2013-02-04 [Link]
I want to connect HC06 to a PC with FTDI cable (usb=>serial). The FTDI power is 3.3v but TX/RX is 5v. Anything needed on TX or RX so communications would
work?
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
+6
+9
+7
+5
+6
+8
[Reply] [Reply with quote]
Mike 2013-01-31 [Link]
Works but does not maintain connection. Whenever is left idle for about 5 seconds it drops connection.
[Reply] [Reply with quote]
Max 2013-01-29 [Link]
How I "select the virtual COM-port at Bluetooth device", I see de BT in Arduino, but can't communicate.
[Reply] [Reply with quote]
Admin 2013-01-29 [Link]
Do you paring BT devices? Do you see counter data from Arduino?
[Reply] [Reply with quote]
Jacob 2013-01-14 [Link]
I was having an issue with getting data from HC-05 TX to Arduino RX and I added a 2.2K resistor from the HC-05 TX pin to GND to fix it.
[Reply] [Reply with quote]
sean 2012-10-30 [Link]
hello
can you explain if any extra resistor is required for the RXD to connect to ARDUINO TX
[Link] one-sensors-on-the-arduino-/step3/The-level-s
[Reply] [Reply with quote]
Admin 2012-10-30 [Link]
I try use resistor, but module not worked. HC-06 work ferfect without any resistors.
[Reply] [Reply with quote]
[Link] open in browser PRO version Are you a developer? Try out the HTML to PDF API
Pages: [1]
Leave a comment
Your name:
Your Email:
Size
Comment:
Type the characters: *
Refresh
Add [Ctrl+Enter]
Photo mosaic maker from a library of pictures galleries or your photo album
Copyright 1999-2014 "[Link]"
All rights reserved