Communicating with a bluetooth module

Hello!

I recently got a bluetooth module off of eBay http://www.ebay.com/itm/330791738932?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

because of the low price it was quite an impulse buy although it was also an experiment for me. I've never done any wireless networking and so I honestly have no idea how to use this thing. Right now I have it hooked up like their diagram says and I have no idea how to control it.

Any help?

Are you using SoftSerial?

I'm not using anything. I only have it on and hooked up to my arduino.

I only have it on and hooked up to my arduino.

Did you duct tape it on? Or did you connect some wires between it and the Arduino? If you used wires, where did you connect them?

I connected it just like it shows on the ebay page. http://image.pushauction.com/ViewPicture.aspx?Key=bfdd89dc-f583-4c87-934b-fa447c410ae7_36ae5cc0-d6bd-4b2f-b5b4-e188fc9bec5e

ok, so which pins did you use?!

#include <SoftwareSerial.h>

//setup
SoftwareSerial mySerial(2, 3);


//loop
  char c;
  if (mySerial.available()) 
  {
    c = (char)mySerial.read();
    if (c=='H')
       {
         ///// if the key is a letter H do your code here
         //comprende?
       }
  }

What other bluetooth thing is it talking to?

I used the TX and RX pins on the arduino. Am I able to use anything else?

It currently isn't talking to anything. I can pair my phone and computer with it but that's it.

It currently isn't talking to anything. I can pair my phone and computer with it but that's it.

Then, the bluetooth device IS talking to either your phone or your computer. It's just that nothing gets from the bluetooth device to the Arduino, because you haven't written that code.

"That code" consists entirely of Serial.write(), Serial.print(), Serial.println(), Serial.available() and Serial.read() statements in the proper order, with the proper things being sent.

Normally, knowing what to send is easy, because the bluetooth device provider tells you exactly what to send to the device to make it do something, and tells you exactly what the return data means.

Where you saved money was on the documentation. It appears that you got exactly what you paid for.

Wait so I cannot control this thing b/c I didn't get any documentation with it?

Well, you have this:

"Description
Industrial serial port bluetooth, Drop-in replacement for wired serial connections, transparent usage. You can use it
simply for a serial port replacement to establish connection between MCU and GPS, PC to your embedded project and etc.

Computer and peripheral devices

GPS receiver
Industrial control
MCU projects
Default serail port setting : 9600 1

Pairing code : 1234

Running in slave role: Pair with BT dongle and master module

Usage

Coupled Mode: Two modules will establish communication automatically when powered.
PC hosted mode: Pair the module with bluetooth dongle directly as virtual serial.

Bluetooth protocal : Bluetooth Specification v2.0+EDR
Frequency : 2.4GHz ISM band
Modulation : GFSK(Gaussian Frequency Shift Keying)
Emission power : <=4dBm, Class 2
Sensitivity : <=-84dBm at 0.1% BER
Speed : Asynchronous: 2.1Mbps(Max) / 160 kbps, Synchronous: 1Mbps/1Mbps
Security : Authentication and encryption
Profiles : Bluetooth serial port

CSR chip : Bluetooth v2.0
Wave band : 2.4GHz-2.8GHz, ISM Band
Protocol : Bluetooth V2.0
Power Class : (+6dbm)
Reception sensitivity: -85dBm
Voltage : 3.3 (2.7V-4.2V)
Current : Paring - 35mA, Connected - 8mA
Temperature : -40~ +105 Degrees Celsius
User defined Baud rate : 4800, 9600, 19200, 38400, 57600, 115200, 230400,460800,921600 ,1382400.
Dimension : 26.9mm13mm2.2mm

Pin definition :

  • PIO8 connects with LED cathodea with 470ohm series resistor in between. LED NEGATIVE connects to ground. It is used
    to indicate the module state. After powered on, flashing intervals differ in different states.
  • PIO9 is used to control LED indicating paring. It will be steady on when paring is successful.
  • PIO11, module state switching pin. HIGH → response to AT command; LOW or floating → regular work status.
  • With build-in reset circuit, reset is completed automatically after powered on.
  • Steps to set to MASTER:
  • Set PIO11 HIGH with a 10K resistor in between.
  • Power on, module comes into AT Command Response Status
  • Open HyperTerminal or other serial tool, set the baud rate 38400, 8 data bits, 1 stop bit, no parity bit, no Flow Control
  • Via serial port, send characters “AT + ROLE = 1 r n”,if successful, return “OK r n”, where r n is carriage return.
  • Set PIO11 LOW, re-power, then in Master state, automatically search for slave module and connect.
    "

Suggest you find some moreinfo on
“CSR chip : Bluetooth v2.0”

I get all of that except this. The module only has 4 avaliable pins for me to connect to. I feel like the PIO8 and such are the connections to the actual module and not what I'm wiring to.

CrossRoads: Pin definition : * PIO8 connects with LED cathodea with 470ohm series resistor in between. LED NEGATIVE connects to ground. It is used to indicate the module state. After powered on, flashing intervals differ in different states. * PIO9 is used to control LED indicating paring. It will be steady on when paring is successful. * PIO11, module state switching pin. HIGH -> response to AT command; LOW or floating -> regular work status. * With build-in reset circuit, reset is completed automatically after powered on. * Steps to set to MASTER: * Set PIO11 HIGH with a 10K resistor in between. * Power on, module comes into AT Command Response Status * Open HyperTerminal or other serial tool, set the baud rate 38400, 8 data bits, 1 stop bit, no parity bit, no Flow Control * Via serial port, send characters "AT + ROLE = 1 r n",if successful, return "OK r n", where r n is carriage return. * Set PIO11 LOW, re-power, then in Master state, automatically search for slave module and connect. "

Suggest you find some moreinfo on "CSR chip : Bluetooth v2.0"

Exactly - they do into all this detail about IO pins you don't really have access to. But you can send it AT commands. Find the CSR chip documentation and learn more about them.

Alright, so I was able to get the documentation from the folks who sold me the bluetooth module.
I checked it over and I didn’t see anything that rendered it useless although I’m a newbie at this sort of stuff so maybe somebody could give me a little direction on how to use it? Could I not just do regular serial communication with it?

F73# hc06 Manual.pdf (225 KB)

Hi! I've not used bluetooth yet but am thinking about it. ( I am a wireless MIDI nut.) Theres a nice link here: http://www.instructables.com/id/Cheap-2-Way-Bluetooth-Connection-Between-Arduino-a/step3/Wiring-the-Arduino-Bluetooth-transceiver/

Assuming you have the same module that is....

Yea I have the same module. I just realized last night that I was over thinking it way too much. I'm just going to use the software serial library.

I'm using one of these via Analog1/2 lol... SoftwareSerial does not really care which pin you use..

stat away from pins 0/1 simple as that.

Uhhhh ok. This thread is dead so I'm going to lock it so nobody points out the obvious again