Made a BTM-182/Arduino Tutorial

Hey everyone, I couldn’t find a definitive tutorial for getting started with Sparkfun’s BTM-182 module. So here’s a stab at a tutorial. Feel free to add/correct:

Also posted it here: http://www.jloganolson.com/?p=490

Hardware:

It’s really not that bad – there are four connections total.

[Arduino] 3.3V pin to VCC pin [BTM-182]

[Arduino] GND pin – GND pin [BTM-182]

[Arduino] Pin 2 – TX pin [BTM-182]

[Arduino] Pin 3 – RX pin [BTM-182]

The first two are just straight up powering the module. The other two are used for serial in/out.

We could’ve use the Arduino’s TX/RX pins but I decided to leave those free and simulate them with the Arduion sketch below…

Software:

Three parts to getting the software up and running. Getting the Bluetooth recognized and paired with the computer, writing the basic Arduino sketch, and then verifying it’s actually working.

A. Getting Recognized

Go to Preferences > Bluetooth and add a new device (the + button)

You should see a Serial Adapter device – select it and select Continue.

Go to Passcode Options, select “Use a specific passcode”, and enter 1234 – my understanding is this is the default Bluetooth password (someone correct me if I’m wrong)

Hit continue and it should work – the final screen should have two bullet points – “Pairing was completed successfully” and “A computer serial port was created”

B. Arduino Sketch.

You’ll need the NewSoftSerial library for your Arduino. It makes normal pins look like serial in/out. Other than that, this is pretty straightforward:

#include <NewSoftSerial.h>

#define rxPin 2
#define txPin 3

NewSoftSerial BlueTooth(rxPin,txPin);

void setup()
{
BlueTooth.begin(19200); //open serial software

pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);

BlueTooth.print(“BLAM”); //Communication returns OK
delay(1000);
}

void loop()
{
BlueTooth.print(“yahoo”);
delay(1000);
}

C. Connecting and Testing

Download CoolTerm from freeware.the-meiers.org – it’ll allow you to see Serial communication pretty easily.

Go to Connection>Options and choose the Port that says SerialAdaptor.

Other important settings:

Baudrate: 19200

Data Bits: 8

Parity: none

Stop Bits: 1

Now hit OK and Connect. You should see “yahoo” popping out once a second.

Thanks for posting this info.

Can you clarify one thing for me? It looks like you connect the arduino 5 V output pin TX to a 3.3V input? Or are you using a 3.3V arduino?

From the datasheet of the BTM-182 it looks like you’re only allowed to feed in 3.3V+0.3V max?

  • Clemens

The Arduino I was using had a 3.3v out. The next Arduino I’m using doesn’t have that, so I’m going to try using a 3.3v voltage regulator. We’ll see how that goes…

Hello There,

Thanks so much for your tutorial! it has gotten me off to a good start on my project. I was curious if you would have any idea how I would go about pairing two of these bluetooth modules? I am trying to accomplish communication between two Arduino’s via a bluetooth link. But I am not sure how one would go about pairing the two bluetooth modules with each other.

Any ideas?

-Mike