This is a short tutorial* to show you how to interface the Bluetooth module with the Arduino Mega Sensor Shield. Here we are going to use Serial Channel 2 of the Arduino Mega to commuicate with the Bluetooth. First of all, wire up the circuit as shown below.
*A more detail tutorial for how to use the Bluetooth module can be found here.
Arduino Mega Sensor Shield |
Bluetooth Module |
VCC |
+5V / VCC |
GND |
GND |
RX3 |
TXD |
TX3 |
RXD |
Power up the Arduino via USB, and you can see the Red LED on the Bluetooth module is blinking, which means the Bluetooth link is not established. Download this test code to the Mega. The code randomly generates numbers from 18 - 22 to simulate two temperature readings every 3 seconds. Once download complete, close the Arduino IDE, and now the Bluetooth can be tested in puTTY and our Serial Temp Monitor.
Test in PUTTY
Open puTTY and enter the COM number the Bluetooth link. As can be seen below, mine is at COM4.
Then connect the Bluetooth to puTTY with Baudrate = 9600
If the connection is established successfully, then you can see the LED on the Bluetooth module stays on. And in puTTY, you will receive strings like below.
Test in Serial Temp Monitor
Download the executable SerialTempMonitor, and open it. Please make sure that the Bluetooth link is disconnected from puTTY, and the LED on the Bluetooth module is blinking.
Click on "Connect", after one moment, the temperature reading should appear.
If all working, congratulations, you are now ready to build a wireless temperature monitor. Finally, put all the components together, and load this code to your Mega, it should all work. The Serial Temp Monitor is an opened source C# program, developed by Hobbyist.