Let's Make Robots!

Cheap bluetooth module for an Arduino

Gives a robot bluetooth capability

Some time ago I ordered a cheap bluetooth module on ebay for my Arduino. I went for a no-name module, when I say cheap I mean it. (well after all it were only a few dollars cheaper than the branded ones)

Anyway, module arrived and I tried to communicate with an internal command processor, which I expected to be there. Hooked up serial lines to the TX(1) and RX(2) pins on the module, 3.3V VCC(12) and GND(13). Nothing happened, no response to AT commands. I read multiple web pages, all describing how it should be done. I think I tried all possibilities. Many people mention that I should pull high pin 34 or 26 to actually enable the command processor.All this were tried and much more too. Nothing, no response to my attempts.

On the other hand, I could see the module on the bluetooth "ether", both on my primary linux box and on an old XP box, so some sort of life were detected. From the web I have learned that the pin code most likely would one of 0000, 1234 or 12345.

Well, after some time I gave up, and cried my failed attempts on the shoutbox. Birdmun asked why I were so eager on speaking to the command processor, well I thought that changing the pin or something would be necessary. Next day aaronsuper1 gave me yet another link (http://arduino-projects.co.uk/tutorials/connect-arduino-android-phone-bluetooth/ which now redirects to http://www.therobotlab.co.uk/2011/arduinoandandroid/) to people using their androids to control an Arduino. Somehow that link were a little better which helped me!

All my struggle to get the command processor speaking where waste of time. I simply skipped that part. Used the XP to wake up the module and pair my USB-bluetooth dongle with the module. 1234 were the correct pin code in the case of this particular module. When the initial pairing were done I moved back to linux where I'm more comfortable.

Right now I have a test setup consisting of the following chain

  1. linux system
  2. terminal program (minicom, putty or something like that)
  3. usb->rs232 converter, showed up as /dev/ttyUSB2 on my system
  4. rs232->logic converter (home made, http://letsmakerobots.com/node/29207)
  5. bluetooth module
  6. air with radio waves. "the ether"
  7. bluetooth->usb dongle
  8. terminal program (connect to /dev/rfcomm4)
  9. linux (actually the same machine as in step 1)

The linux is an older ubuntu box, 10.4 I think. It should not be that important.

Since the terminal program in step 2 is using a real serial communication link, baud rate is important. I figured out that my module is operating at 38400 bits per second. This finding were made by trial and error, and when that failed, I fired up my good old oscilloscope were the bit rate were easily visible)

To get step 7 and 8 working I had to prepare the bluetooth system on the linux a little:

  1. Scan the "ether" for bluetooth devices type: hcitool scan. returned a address and a name
  2. Bind address to a linux device (I picked number 4): sudo rfcomm bind rfcomm4 00:19:5D:24:B7:63

The last one does not make an actual connection between the two bluetooth devices but only prepares them. When a program opens the device file the actual connection gets established.

Now type something and watch it show up in the other window, transmitted via bluetooth.

As seen on the picture, there is a 5'th wire (pin 31) going out from the module. It's a status line, able to drive a LED. If LED is flashing there is no connection. When it is steady on there is a bluetooth connection established.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Glad to be of help to you, mogul. So, any plans on a bluetooth controlled bot coming soon?

Not remote control, but wireless software upload and debug. Right now I have to get up from the chair, to grab the bot on the floor, plug in a cable, press "upload" button, unplug cable, get up again, back to the testing grounds, etc... too much exercise.

And if I somewhere in the program want see the value of a few variables I will be able to simply print them now. Thats a feature I miss a lot with my Wood&Glue maze solver. It overshoot some turns and I'm not sure why. Does it misinterpret a corner as a intersection or something else. With a bluetooth link on the serial output I will be able to watch the debug statements roll over my screen, without leaving my chair.

Seems like a pretty good idea... though I wouldn't reccomend it to the younger generation. I prefer doing the longer method myself. 

You look cool if someone sees you doing it...

Yeah but it can be very practical for tuning a PID loop and tweaking parameters on the fly.

Making progress I see .. that is great.

I have worked on the little cheap BT units a while back - some docs I have here ..

The paired units I have were designed to "plug and play" one is a host and the other a slave.  Unfortunately I was interested in the slave units and the distributor give me all hosts except for one :P

I was frustrated with attempting to program it with AT commands.
The have the command accepted in some strange loop - CR LF is not accepted and I have found you can not type the commands in you must copy/paste because whatever is digesting them is doing so in ~1 second loop

I believe you could/should be able to remove your modules frome their carriers and use them like mogul is using his.

Nice! link to the bluetooth module?

Thats the problem, I'm missing a real specification on the thing I bought.

I have a close up photo of the thing: (ignore the yellow wire)

I have not paid sufficient attention on the image seen on ebay. The module have a little different components than the ones i have seen specifications on. The one seen here is from the ebay seller eleseed.