Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Communication Protocol

Protocol I
1.1 Structure (Baud rate: 9600; no parity check; 8 data bits; 1 stop bit ;):
Orders from the terminal to the sensor consist of following 5 parts:
Head of data: 2 bytes, fixed ASCII $! (0x24 0x21);
Order: 2 bytes, variant, e.g. DO (0x44 0x4F);
ID number: 2 bytes, ASCII refers to the serial number, e.g. 01 (0x30 0x31), and maximum
is 99;
Check: 2 bytes, add all the characters from head of the data to the ID number together,
get the last 8 bits and turn it into ASCII which is represented by hexadecimal, for example,
if add the characters from head of the data to the ID number together and it gets 0x0245,
then only the last 8 bits are kept, that is 0x45, so it will be45 (0x34 0x35) when turn it
into ASCII which is represented by hexadecimal.
End of data: 2 bytes, the line break, i.e. 0x0D 0x0A
Orders from the sensor to the terminal consist of following 6 parts:
Head of data: 1 byte, fixed *, i.e. 0x2A;
Identification: 3 bytes, which indicates the data type being reverted at the moment;
ID number: 2 bytes, ASCII refers to the serial number, e.g. 01 (0x30 0x31), and maximum
is 99;
Value: 6 bytes, which indicates the value being reverted at the moment, with the fixed
length of 6 bytes;
Check: 2 bytes, add all the characters from head of the data to the ID number together,
get the last 8 bits and turn it into ASCII which is represented by hexadecimal, for example,
if add the characters from head of the data to the ID number together and it gets 0x0245,
then only the last 8 bits are kept, that is 0x45, so it will be45 (0x34 0x35) when turn it
into ASCII which is represented by hexadecimal.
End of data: 2 bytes, the line break, i.e. 0x0D 0x0A;
1.2 Contents:
1.2.1 Liquid level reading percentage
Orders from the terminal or the computer to the sensor (no filtering):
ASCII: $! DO0139
01 stands for ID number.
Of which, 39 is the check sum, the last 8 bits by adding the bit from $ (0x24) to the bits
before check sum, and turn the 8 bits into ASCII, for example, add $!DO01, it will get
0x0139, then the check value will be 39, that is 0x33 0x39.
Hexadecimal: 24 21 44 4F 30 31 33 39 0D 0A
Sensor reverts:
ASCII: *RFV01000.0198

1.2.2

1.2.3

1.2.4

RFV is the returning sign of liquid level reading percentage.


01 is the ID number of the fuel sensor;
000.01 is the fuel level value at the moment, in percentage, with the maximum of
100.00., always being showed as XXX.XX, put 0 in front when the bytes are less than 3
before the dot, e.g. 012.21, it can be showed as 12.21%.
98 is the sum of the check.
Hexadecimal: 2A 52 46 56 30 31 30 30 30 2E 30 31 39 38 0D 0A
Read the AD value of current liquid level:
Orders from the terminal or computer to sensor (with filtering):
ASCII: $! RY0151
Hexadecimal: 24 21 52 59 30 31 35 31 0D 0A
Sensor reverts:
ASCII: *CFV0100FA32B6
00FA32 is current AD value, 0 is the prefix when there is no enough 6 bytes, and FA 32 is
the AD value of current fuel level, the hexadecimal that ASCII represents, indicating the
value of current fuel level is 0xFA32.
Note: The AD value is the corresponding values from 000000~~00FFFF when fuel level
changes from 0%~100%.
Hexadecimal: 2A 43 46 56 30 31 30 30 46 41 33 32 42 36 0D 0A.
Setting the ID for the sensor (default ID value: 01):
Orders from the terminal or computer to sensor (ID range: 0099)
ASCII: $! ID0133,
ID is the order,
01 is the ID value,
Hexadecimal: 24 21 49 44 30 31 33 33 0D 0A.
Sensor reverts:
ASCII: *SID01OKOKOK39, which indicates success;
*SID01NONONO42, which indicates failure.
01 stands for the ID value set, OKOKOK means the setting is successful, and NONONO
means the setting is failed.
Hexadecimal: 2A 53 49 44 30 31 4F 4B 4F 4B 4F 4B 33 39 0D 0A
2A 53 49 44 30 31 4E 4F 4E 4F 4E 4F 34 32 0D 0A
Setting of the filtering factor (default filtering factor: 3)
Orders from the terminal or computer to sensor
ASCIII: $! Z40134,
Z is the order,
01 is the ID value,
4 is the filtering factor, optional parameters can be: 0, 1, 2, 3, 4, 5, 6, the others will be
invalid.
Hexadecimal: 24 21 5A 34 30 31 33 34 0D 0A
Filtering range: 0 ~ 6 levels
0 5 seconds;
1 10 seconds;

1.2.5

2 20 seconds;
3 40 seconds;
4 80 seconds;
5 160 seconds;
6 320 seconds;
Sensor reverts:
ASCII: *SZN01OKOKOK54, which indicates success;
*SZN01NONONO5D, which indicates failure.
Hexadecimal: 2A 53 5A 4E 30 31 4F 4B 4F 4B 4F 4B 35 34 0D 0A
2A 53 5A 4E 30 31 4E 4F 4E 4F 4E 4F 35 44 0D 0A
Setting the uploading time automatically, optional parameters is 0065, the other is
invalid.
Hexadecimal: 24 21 53 54 30 30 34 43 0D 0A
Time range for automatical uploading: 1 ~ 65 seconds:
00 not upload automatically;
01 1seconds;
02 2 seconds;
03 3 seconds;
04 4 seconds;
05 5 seconds;
Sensor will revert the data at that time automatically in the set time interval (no

filtering)
ASCII: *RFV01000.0198
RFV is the returning sign of liquid level reading.
000.01
000.01 is the fuel level value at the moment, in percentage, with the maximum of
100.00., always being showed as XXX.XX, put 0 in front when the bytes are less than 3
before the dot, e.g. 012.21, it can be showed as 12.21%.
98 is the sum of the check.
Hexadecimal: 2A 52 46 56 30 31 30 30 30 2E 30 31 39 38 0D 0A
Protocol II
Inquiry command: *020600#
Return: $XROIL0202DDDDXX\n,
of which, DDDD is
XX is
'\n' is the end mark;
For example, $XROIL02025678XX\n,
The percentage of the fuel level is 56.78%, reading of the percentage of current liquid level is
*020600#.

You might also like