In my last post I described setting up a development environment for working with the Arduino Uno micro controller.
This post describes my first project; getting an Arduino connected to a bluetooth modem to talk to my Android based cell phone. the parts I used for this project include:
- 1 x Arduino Uno,
- 1 x Sparkfun Electronics Bluetooth Mate Silver modem board,
- 1 x 40 pin connecter,
- 2 x 220 ohm resistors,
- 2 x 5mm LED’s (green, yellow),
- 1 x breadboard,
- wire connectors,
- 9 volt DC telephone wall transformer re-wired so that positive voltage is in centre of jack.
The following is an image (done with the Fritzing software package) of my breadboard layout for this project.
My first step was to solder a 6 pin connector (trimmed from the 40 pin connector) to the modem board. I used a straight pin connector, but it would make more sense to use a 90 degree connector I think.
After the connector was soldered to the modem board I laid out the circuit shown above.
My sketch (the code I used to control the Arduino is included. Click on this link (boardtest).
I tested the board layout and the code by initially leaving the Rx Tx lines to the modem board disconnected. I was then able to use the Arduino Serial Monitor to emulate sending and receiving data between the Uno and the modem. Remember to reset the Serial Monitor to communicate at the same baud rate as is set in the setup() function of the sketch (Serial.begin(115200);). Otherwise you will just see gibberish on the communication link.
The Sparkfun Electronics modem communicates at 115200 by default. Unless you change this speed you must match it (as is done in the setup() function). I struggled with this problem for a long time until I figured it out; the modems were paired and connected, but only gibberish was communicated between the two boards.
After the board was laid out and the sketch was uploaded and tested via the Arduino serial monitor I connected the Tx Rx lines to the modem and connected the Arduino to the external power supply. I then performed the following steps:
- On my cell phone I paired to the Arduino Modem board (passcode 1234),
- On my cell phone I launched the btterm application and connected to the modem board. (If this is successful the led on the modem board will go from blinking red to solid green),
- I then used the btterm application to send text to the modem and watched the LED’s change from low to high depending on what was pressed.
Eventually it all worked! The hardest part of this project was getting the modems communicating to each other.
Some references I found on the internet:
- https://www.orangezebra.eu/wordpress/?p=43
- http://wiring.org.co/learning/tutorials/bluetooth/
- https://www.orangezebra.eu/wordpress/?p=73
- http://arduino.cc/en/Tutorial/Blink
- http://www.homeroasters.org/php/forum/viewthread.php?thread_id=2154
- http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1240951777
- http://forum.sparkfun.com/viewtopic.php?f=13&t=20344&p=97668#p97668
- http://www.jhwarren.com/bluetooth-mate/
Amah says
Thanks for this post as I need to interface a bluetooth silver mate with the Uno that I had just returned. Thanks to your post I’m going to hurry and re-purchase my Uno board.
This is for a school project and the intention is to send physiological data to an android phone. This helped move my project forward a little bit thank you.
Nahum says
Hi, we have a proyect on arduino with bluetooth. We are trying to driving a control car though arduino UNO and bluetooth, we have to program the interface in android, but i would like to learn how to set up the bluetooth with arduino and getting control in my computer. Thanks