A Bluetooth Data Link canbe used to connect your Pixhawk (or other controller) to your Bluetooth enabled PC orAndroid Ground station at distances up to 50m.
And simply connected LM35 temp sensor to arduino + also bluetooth module. Then from my cellphone i opened bluetooth serial monitor a saw some values. Except the BAUD RATE is wrong, so i cant see the temperature in Celsius. I have tried SERIAL BAUD RATES: 9600, 57600 or 115200 but nothing works.
Connecting to the Autopilot¶
The Bluetooth data link comes with both a DF13 6 pin and 6-to-5 pinconnector which make it easy to connect to the Pixhawk Telem1 orAPM2.x’s Telem ports. Note that for the Pixhawk, although Telem1 is therecommendation, Telem2 or even Serial 4/5 will work.
Once you have connected the Bluetooth data link you can power up theboard. It is OK to use USB connected power while using the Bluetoothmodule connected to the APM or PixHawk as the USB connection can supplyenough power BUT YOU MUST USE A WALL WART with Micro or Mini USB).
Bluetooth data link’s LEDs:
- Red LED blinks at 1hz : device is working, not connected
- Red LED blinks at 0.5z : pairing
- Red LED solid : connected
Quick Start connecting with Mission Planner¶
If you are familiar with Bluetooth, search for Bluetooth Device HC-05 or6 (some may have Linvor as well) , Pair with device (code 1234 or 0000)check it’s properties and look at the services tab. Make sure SPP comport box is checked (only there if your Bluetooth device is active) Lookin Device Manager (Windows) and make sure there is a Com Port for theBluetooth and in the com port properties set the baud rate to 57600(note the Com Port number).
Note
For use with Mission Planner on the Configure/Tuning tab make sureand UNCHECK the box Reset on USB Connect:
The default Baud Rate for the Bluetooth Module is 57600 (most othermodules are 9600) Be sure when you connect it is at 57600 and for thenew Com Port you saw in Device Manager.
When you power up the PixHawk or APM with the Bluetooth the module willflash at 1hz the red LED when not connected. When Paring it will flashat .5 Hz and when connected it will be steady on.
And you’re done! You can now use your Bluetooth telemetry for up to about50m range. (your range may vary depending on back ground noise andconditions in your area)
If you have problems connecting or you don’t know Bluetooth very well oryou want to change the default Baud Rate or Device Name, read on for thestep by step process.
Detailed connecting with Mission Planner¶
Many PCs and Laptops have bluetooth adapters built in but if not thenyou can use a generic USB Bluetooth dongle (pic above) or use anadditional Bluetooth data linkconnected via an FTDI Cable.
After first making sure your Pixhawk/APM2 is powered on, and your PC’sbluetooth dongle is plugged in and installed, click on the Windows taskbar’s little up triangle (aka “show hidden icons”) which should be onthe bottom right of the screen.
The “hidden icons box” should appear. Right-mouse-button-click on theBlueTooth icon and select “show Bluetooth devices”
Windows should bring up the devices box. Any devices you may alreadyhave connected by Bluetooth will be in this box. If you have notconnected any BT devices before this box will be empty. Select “Add adevice”.
Windows will search for BT devices for you. If you have any BT devicesturned on they will show up here (like perhaps your cell phone) ignoreany other devices and select the HC-05 or HC-06 (or Linvor) .
Select Paring using device code.
Enter the device code (1234 or 0000) this is the default code.
Once paired right click the device and select “properties” The check boxfor Comm Port SPP should be checked (also note the com port number).
In device manager select Com Ports
Choose the comm port you noted in the above step.
Right click and select “properties”
Change baud rate to 57600
Once again start Mission Planner and go to the Configure/Tuning tab andmake sure you UNCHECK the box “Reset on USB connect”
Your Bluetooth device should now be ready and you can connect to theproper port at the proper baud rate of 57600 (red LED steady on and notflashing)
Connecting From your Android ground station¶
These instructions will show you how to connect to your vehicle fromAndroPilot or DroidPlanner 2 running on NExus 7 tablet using theBluetooth module.
Open the Android device’s settings application and turn Bluetoothconnectivity ON (usually by sliding a slider to the right). In the samesettings screen click on “Bluetooth” which should cause a list ofAVAILABLE DEVICES to appear
Power the vehicle and the “HC-06” device should appear. Click on it andenter “1234” or “0000” as the PIN to pair with the device, then selectOK.
The device will appear under “PAIRED DEVICES”
If using DroidPlanner:
- open the Droid Planner settings, and select Telemetry ConnectionType, Bluetooth.
- In the main DroidPlanner interface, select Connect, and select thepaired Bluetooth device.
If using AndroPilot:
- a “bluetooth” button should appear on the screen, click it
When live data appears on the screen, you’re ready to start missionplanning.
How to Change Baud Rate, Device Name and Device PIN¶
You will need a FTDI to USB cable to change any of the configurations ofthe device (not supplied) It is not necessary to change anything inorder for your BT device to function properly it will function quitewell as supplied. This is for reference and your convenience only!
To change the above you need a “Terminal” emulator program. You can notuse “Putty” (a popular serial port tool) because it will not accept“line” commands. The Bluetooth Modules read the input at a rate of onceper second therefore you must use an emulator that will allow you toinput an entire line before hitting “send”. You can use the Arduino IDEto send commands to the com port if you are familiar with that. I use“Advanced Serial Port Terminal” but any terminal emulator that allowsyou to type in a line of text before hitting send will work just a good.
Change the baud rate¶
The index after the command AT+BAUD corresponds to the following baudrate:
1—-1200bps
2—-2400bps
3—-4800bps
4—-9600bps
5—-19200bps
6—-38400bps
7—-57600bps
8—-115200bps
There are additional baud rates. Warning! do not set these baud ratesunless you have a special fast UART chip. If you don’t know do not usethese rates they are beyond the standard PC UART speed and once set youwill loose communication with the device and the only way to contact thedevice after that will be with a high speed UART. (these are forreference only)
9—-230400bps
A—-460800bps
B—-921600bps
C—-1382400bps
The change of Baud rate takes effect immediately after the command issent. So if you want to keep configuring the Bluetooth module, you needto set the Baud rate of your terminal program to the new Baud rate theBluetooth is using. To test it, send AT again, you should receive ‘OK’
Change the Device Name¶
This example show you how to change the name of the Bluetooth module toArduPilot: In the terminal program, send the command (case sensitive):
The Bluetooth should reply:
Change the Device PIN¶
The following example shows how to change the pairing code to 5566 Inthe terminal program, send the command (case sensitive):
The Bluetooth should reply:
Troubleshooting¶
You can test the device by making a loopback from TX to RX.
Open your terminal program select the correct comm port and in terminaltype anything you like. If you see the test displayed then your deviceis working properly. If you do not see the text you typed and you haveselected the correct comm port and your device is paired and connected(red LED solid on not flashing) then you may have a problem with yourdevice.
Specs¶
Dimensions : 1.4” x 0.6” x 0.17”
Weight 9.6 g (0.3 oz)
Operation voltage: 3.6 to 6 V
I/O level: 3.3 V
Typical -80dBm sensitivity
Up to +4dBm RF transmit power
UART interface with programmable baud rate
Default baud rate: 57600
Supported baud rates: 1200, 2400, 4800, 9600, 19200,38400, 57600,115200, 230400, 460800
Pairing code: 1234 or 0000
Auto-connect to the last device on power as default
Permit pairing device to connect as default
Integrated antenna
Range: 50 m