This module is capable of both sending and receiving data up to 100 meters and you don’t need to mess up with bluetooth protocols, you just need send data over a serial interface.
What you will need
- An Arduino Uno
- Bluetooth Mate Gold/Silver. The Silvers and the gold models differ in range and transmission power. The Mate Gold can communicate at up to 100 meters, the Silver limits the transmit range to about 10 meters.
- An Android device
These Bluetooth devices are designed to work in both 3.3V and 5V systems. In order to interface to the Bluetooth modem, you’ll need to solder headers or wires to it. Each of the Bluetooth boards breaks out six pins. The pinout allows the Mate to be plugged directly into the serial header of Arduino Pro’s and Pro Minis.
If you have an Arduino Uno, connect the following pins
- Mate – Arduino
- VCC -> 5V
- TX-O -> Digital pin 0 (RX)
- RX-I -> Digital pin 1 (TX)
- GND -> GND
Your breadboard should look like this:
When you connect the module to 5V the red led, labeled “Stat”, should start blinking at 1 Hz. Please refere to this table for further informations.
We are now ready to run the sample sketch.
The SerialRoutine() will handle the communication. For example if you send via bluetooth ‘a’ the module will answer with ‘TakeOff’.
Please note that we are using the serial pins of the Arduino to communicate with the module. I’ve tried with SoftwareSerial setting other ports and baudrates but it didn’t work. Please leave a comment if you are using a different configuration port and me know how to do it XD.
Before uploading the code, disconnect pin Tx and Rx of the Arduino otherwise the software won’t be able to establish a serial communication between the boad and the PC. Just follow these steps:
- Disconnect Digital pin 0 and 1
- Upload the sketch
- Connect Digital Pins
Download the Android app
Go to the Play Store and download BlueTerm. Once opened, enable the bluetooth.
- Press the option button and then Connect Device. A pop up window will appear with a list of available devices nearby.
- Select RNBT, the green led on the Bluetooth Mate will light up.
- Open the Serial Monitor and send a message. The message should appear on the terminal of the android app
- Try sending ‘a’ from the Android device to the Arduino. If everything has been set up correctly of should be able to read ‘TakeOff’ from the Serial monitor
This Android application is really useful but if we want to use the module in our project involving arduino we need a higher degree of freedom. We will create out own Android App to handle Bluetooth messages. Stay Tuned!