0% found this document useful (0 votes)
49 views2 pages

6ermonster Transfer Protocol PDF

This document explains the Bluetooth data transfer protocol between an Android application and a microcontroller for a robot project. The Android application establishes a Bluetooth connection and sends movement command data, while the robot transfers laser scanner environment data back. Data is transferred in packets with a start byte, value bytes, checksum byte, and stop byte. Movement data packets contain x and y direction/speed values, while scanner data packets contain 181 bytes of distance values at each degree from 0 to 180 degrees.

Uploaded by

Ahad Maqsood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views2 pages

6ermonster Transfer Protocol PDF

This document explains the Bluetooth data transfer protocol between an Android application and a microcontroller for a robot project. The Android application establishes a Bluetooth connection and sends movement command data, while the robot transfers laser scanner environment data back. Data is transferred in packets with a start byte, value bytes, checksum byte, and stop byte. Movement data packets contain x and y direction/speed values, while scanner data packets contain 181 bytes of distance values at each degree from 0 to 180 degrees.

Uploaded by

Ahad Maqsood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Bluetooth data transfer between android application and microcontroller

Version 1.0 July 2013

This document explains the protocol that is used in the 6erMonster project to exchange data between
android application and the microcontroller of the robot using Bluetooth module. The android
application uses RFCOMM library to establish the connection and introduce itself as an application that
use SPP profile. In the robot side a BTM182 Bluetooth module is used to equip the robot with the
bluetooth feature.

The android application transfers the movement commands data to the robot and from the robot the
laser scanner data will be transferred back. The transmission and reception takes place individually and
are not linked together which means a full duplex connection is required.

Transmission of the data

In total 5 bytes will be transferred at each packet of data transfer from Android. These bytes are
demonstrated in the following block diagram.

Start Byte (0xaa) X value Y value Checksum (x+y) Stop Byte (0x55)

Byte Description Value range Interpretation


This byte shows the beginning of
Start byte Always 0xaa
the packet
0 -> stop
The direction and strength of the
X value -127 to 127 40 -> maximum speed forward
value (Forward or backward)
-40 -> maximum speed backward
0 -> stop
The direction and strength of the
Y value -127 to 127 40 -> maximum speed right
value (Left or right)
-40 -> maximum speed left
Safety byte to make sure the data
Checksum X+Y
is correct
This byte shows the end of the
Stop byte Always 0x55
packet
Reception of the data

In The other direction, the robot transfer 186 bytes in each packet, which holds the information of the
environment scanned using the laser scanner. The sequence and description of the data is shown in the
following table:

First Start Byte (0xaa) Second Start Byte (0x0a) Environment info Stop Byte (0x55)
(181 bytes)

Byte Description Value range Interpretation


This byte shows the beginning of
First Start Byte Always 0xaa
the packet
Second Start This byte shows the beginning of
Always 0x0a
Byte the packet
The distance of the barriers from 0 -> infinity or less than 20cm
Environment
the robot at each angle from 0 0 to 255 100 -> 100cm
info
degree till 180 degree 250 -> 250cm
This byte shows the end of the
Stop byte Always 0x55
packet

It has to be noticed that the environment info is in polar system and it starts from the 0 degree. That
means the first value is the distance in 0 degree, the second byte is the value for the first degree and it
continues till 181 byte which is the amount of distance at 180degree. The scanner will not be able to
show the distance over 255cm and less than 20cm. In that case, zero will be the value.

Format of the environment info is shown in the following table:

Value of 0 Value of 1 … Value of 180


Range of the barriers is 20cm< and <255cm out of this range comes always 0.

You might also like