So I’m having a bit of a problem…I am starting development of a prototype involving remote sensing.
I decided that it would be better - for the time being - to use an Arduino due to the wide user/knowledge base. I am currently trying to read data over I2C from a temperature sensor using an Arduino Pro 3.3V board, and send this over a bluetooth link (using the BTM-182) to a terminal program.
So far, the temperature sensor is working just fine, and I can connect to the bluetooth module, but after finally getting SOMETHING to print out over the terminal monitoring the Bluetooth serial port, all I get is gibberish!
My setup is as follows:
-
Arduino Pro (3.3V) with LiPo battery pack
-
Temperature sensor connected to +V and GND, and also to ANALOG IN ports 4,5
-
Bluetooth module (BTM-182) connected to Arduino. The connections are BTM RX → Arduino TX-0 and BTM TX → Arduino RX-1. I installed a small decoupling cap just near the bluetooth module’s power supply, and attached three status LEDs to ports 5,7,8 on the bluetooth module. I also added a jumper between RTS and CTS on the BT module.
Here’s a picture of the setup and of the bluetooth module pinout:
http://www.sia-cam.com/storage/1.jpg
http://www.sia-cam.com/storage/2.jpg
The two wires connected to the Arduino on the bottom right are not connected to anything else.
Anyway, I am using this code that I found to test to connection:
/***********************
Bluetooth test program
***********************/
int counter = 0;
int incomingByte;
void setup() {
Serial.begin(115200);
}
void loop() {
// see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// if it's a capital R, reset the counter
if (incomingByte == 'R') {
Serial.println("RESET");
counter=0;
}
}
Serial.println(counter);
counter++;
delay(250);
}
The code works fine with just the Arduino - I can monitor the serial port through the USB connection and see the printout of numbers. The RESET function works as well.
The problem comes when I try to introduce the bluetooth module. I used the same program but now connected the bluetooth module to the TX and RX pins of the Arduino as stated above. Based on the BTM-182 documentation (which is pretty sparse IMHO, I am starting to regret buying this module as nobody seems to use it) the default baud rate is 19200, data bit 8, parity 1, and flow control enabled.
I tried using several different terminal programs with those settings, but I get either nothing or gibberish. There are also usually 2-3 options for hardware flow control and I am not sure which one I should use. I tried all manner of different encodings (ANSI, ASCII, HEX, etc…) for decoding the data but I still get nothing but gibberish. Here’s a screencap of the terminal program:
http://www.sia-cam.com/storage/3.jpg
So…what am I doing wrong? I feel like I’m so close but I don’t know what other settings to try…I feel like I’ve tried them all. Perhaps it is something very simple, but this is my first experience with bluetooth and the lack of documentation about the BTM-182 is really discouraging. There are a billion articles about the bluesmirf and the xbee and etc… but for this just a command set and some specifications.
So, any ideas? I really appreciate any help. Sorry about the length but I tried to be thorough and provide as much info as possible - if I left anything out please let me know! Thank you once again.