Saturday, October 15, 2016

Arduino Bluetooth Module Test Run

In this blog, we introduce how to make a test run for a Bluetooth module under Arduino. Bluetooth is a wireless standard which pairs two or multiple devices. It is usually used in indoor and short distance scenarios. The Bluetooth device used here is Virtuabotix Bluetooth to serial slave (BT2S-SLAVE). As shown below, this Bluetooth module has four pins: VCC, GND, TXD and RXD. The purposes of these pins are straightforward. VCC and GND are used for power supply. You can connect VCC pin to 5V voltage connection in Arduino board and GND pin to ground. All connectivity devices need to transmit and receive information. TXD pin is for transmitting while RXD pin is for receiving. After VCC and GND pins are properly connected, a red LED on the device starts to blink.

Even without writing any Arduino Bluetooth code, we can still make a test run. The way is to short connect the TXD and RXD pins (as shown below with the red-colored wire). Therefore, the signal received in RXD will be looped back to TXD and sent out. When communicating with this device, one should see a "mirror". Whatever you send out to the device, it will play back exactly the same content to you.

After the Bluetooth device powered up, you can now talk to this device from a computer and the computer should also have Bluetooth connection. The first step is to pair the computer with the Bluetooth device, which is common procedure if the computer wants to talk to any Blueooth device. Next, you can open Arduino SW. After setting the right board and port, serial monitor can be launched. If all settings are correct, the moment that serial monitor is launch, the LED light in the Bluetooth device should stop blinking and turn solid red. If you see that, that is a good sign. Then you can start to type the message and you can see the identical message sent back to you. In my case, I send "hello" and get back "hello". If you see that, then congratulations! Your test run is successful.