0% found this document useful (0 votes)
102 views15 pages

rd-03 v1.0.1 Serial Communication Protocol

The Rd-03 Serial Communication Protocol V1.0.1 document outlines the communication interface and protocol for the Rd-03 module, including pin definitions, configuration parameters, and command formats. It details the steps for parameter configuration, command modes, and data output protocols, as well as specific commands for setting and reading parameters. This protocol is essential for users needing to interact with the Rd-03 module via serial communication, providing guidelines for effective usage and configuration.

Uploaded by

roger
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)
102 views15 pages

rd-03 v1.0.1 Serial Communication Protocol

The Rd-03 Serial Communication Protocol V1.0.1 document outlines the communication interface and protocol for the Rd-03 module, including pin definitions, configuration parameters, and command formats. It details the steps for parameter configuration, command modes, and data output protocols, as well as specific commands for setting and reading parameters. This protocol is essential for users needing to interact with the Rd-03 module via serial communication, providing guidelines for effective usage and configuration.

Uploaded by

roger
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
You are on page 1/ 15

Rd-03 Serial communication protocol V1.

01

Rd-03 Serial communication protocol

Version V1.0.1
Copyright ©2023
Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 1 of 15
Rd-03 Serial communication protocol V1.01

Document Resume

Version Date Develop/revise content Formulate Approval


V1.0.0 2023.06.29 First formulated Zekai Qian Jie Wei
Added automatic generation of
V1.0.1 2024.11.28 Zekai Qian Hong Xu
threshold related instructions

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 2 of 15
Rd-03 Serial communication protocol V1.01

Content
Rd-03 Serial communication .......................................................................................................1

1. Communication interface introduction .....................................................................................4

1.1. Pin definition and wiring ............................................................................................... 4

1.2. Configuration parameters and parameter descriptions .................................................. 5

2. Communication Protocol ..........................................................................................................6

2.1. Radar command configuration method ......................................................................... 6

2.1.1. Radar command configuration steps .................................................................. 6

2.1.2. Radar Configuration Notes .................................................................................6

2.2. Protocol Format ............................................................................................................. 7

2.2.1. Protocol data format ........................................................................................... 7

2.2.2. Command protocol frame format ....................................................................... 7

2.3. Send command and ACK .............................................................................................. 7

2.3.1. Open command mode .........................................................................................7

2.3.2. Turn off command mode .................................................................................... 8

2.3.3. Parameter configuration commands ................................................................... 8

2.3.4. Read parameter command ................................................................................ 10

2.3.5. Start automatically generating threshold commands ........................................10

2.3.6. Automatically generate threshold progress query commands .......................... 11

2.3.7. Configuring system parameters ........................................................................ 11

2.4. Radar data output protocol .......................................................................................... 12

2.4.1. Reporting data frame format ............................................................................ 12

3. Contact ....................................................................................................................................13

Disclaimer and copyright notice .................................................................................................14

Notice ......................................................................................................................................... 14

Statement .................................................................................................................................... 15

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 3 of 15
Rd-03 Serial communication protocol V1.01

1. Communication interface introduction

1.1. Pin definition and wiring

The Rd-03 module has a total of 5 pins, as shown in the pin diagram. The pin function
definition table is the interface definition.

Front Back

Figure 1 Pin diagram


Table 1 Rd-03 connected to TTL

Rd-03 USB to TTL

3.3V 3.3V

GND GND

RX TXD

OT1 RXD

Output high and low levels according to the


OT2
detection results, no wiring

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 4 of 15
Rd-03 Serial communication protocol V1.01

1.2. Configuration parameters and parameter descriptions

Users can modify the configuration parameters of the module through the serial port of Rd-03
to adapt to different application requirements. The configurable radar detection parameters are
shown in Table 2.
Table 2 Rd-03 configuration parameters

Parameter name Available range Explanation


Minimum detection Used to set the minimum detection distance of the
0~15
distance gate radar. The length of a distance gate is 70cm.
Maximum detection Used to set the maximum detection distance of the
0~15
distance gate radar. The length of a range gate is 70cm
It takes a delay of “T”for the target status to switch
from manned to unmanned. During this period, if a
person is detected, the timing of this period will be
Delay time for restarted. The radar will only switch to the
0~65535
target to disappear unmanned state and report that no one is there after
detecting that the unmanned state has lasted for a
full “T” time.
The unit is seconds.
Trigger threshold 0~(2^32)-1 Module squared

Keep Threshold 0~(2^32)-1 Module squared


Serial port reports RDMap (host computer
Debug Mode N/A
analysis)
Normal Mode N/A Serial port print output status
The serial port reports the energy value and
Reporting Mode N/A detection results of each distance gate (to be parsed
by the host computer)

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 5 of 15
Rd-03 Serial communication protocol V1.01

2. Communication Protocol
This communication protocol is mainly used by users who need to be independent of
visualization tools. Rd-03 communicates with the outside world through the serial port (TTL
level). The radar's data output and parameter configuration commands are all carried out under
this protocol. The default baud rate of the radar serial port is 115200, 1 stop bit, and no parity
bit.

2.1. Radar command configuration method

2.1.1. Radar command configuration steps


The process of setting parameters: Enter command mode → Configure/get parameter
command → Exit command mode
1. The host computer sends "Open Command Mode" to make the MCU enter the command
mode. At this time, the MCU does not perform human body detection and only waits for
the command from the host computer.
2. The host computer sends commands such as parameter setting and parameter reading.
3. The host computer sends "exit command mode", at which point the MCU enters normal
working mode and performs human body detection.

2.1.2. Radar Configuration Notes


Note:
1. The maximum data length of a single serial command does not exceed 64 bytes (the size is
subject to the actual situation and may be different for each platform. When the host
computer sends a start command, the result returned by the slave computer includes the
cache size of the command communication). Therefore, when reading and writing multiple
registers, if it exceeds 64 bytes, it needs to be divided into multiple commands.
2. Byte order: Little endian
3. Because the serial port will output radar waveform data by default, you need to switch to
command mode before issuing commands. The usual practice is divided into three steps:
(1) Send "Open Command Mode" (because the chip may still be outputting data, the data
received by the serial port will contain waveform data, so the returned result will not be
analyzed).
(2) Clear the serial port buffer data (usually delay about 100ms to ensure that all serial port
data are cleared).
(3) Send "Open Command Mode" again and analyze the returned results.
After the command mode ends, send "Close command mode" to start waveform data
transmission.
4. It is recommended that the custom command ID range be between 0x0060 and 0x00A0.

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 6 of 15
Rd-03 Serial communication protocol V1.01

2.2. Protocol Format

2.2.1. Protocol data format


The serial data communication of Rd-03 uses the little-endian format. All the data in the
following table are in hexadecimal.

2.2.2. Command protocol frame format


The radar configuration command and ACK command formats defined by the protocol are
shown in Tables 3 to 6.
Table 3 Send command protocol frame format
Frame Header Data length in frame Intra-frame data Frame end
FD FC FB FA 2 bytes Refer to Table 4 04 03 02 01

Table 4 Data format content in the sending frame


Command word (2 bytes) Command value (N bytes)

Table 5 ACK command protocol frame format


Frame Header Data length in frame Intra-frame data Frame end
FD FC FB FA 2 bytes Refer to Table 6 04 03 02 01

Table 6 ACK frame data format


Send command word (2
Command execution status (2 bytes) Return value (N bytes)
bytes)

2.3. Send command and ACK

2.3.1. Open command mode


Any other command issued to the radar must be executed after this command is issued,
otherwise it will be invalid.
Command word:0x00FF
Command value:0x0001
Return value: 2-byte ACK status (0 for success, 1 for failure) + 2-byte protocol version
(0x0002) + 2-byte buffer size (0x0020)
Send data:
Frame Data length in
Command word Command value Frame end
Header frame
FD FC FB FA 04 00 FF 00 01 00 04 03 02 01
Radar ACK (success):
Frame Data length in Command Protocol
ACK Buffer size Frame end
Header frame word Version
FD FC FB 04 03 02
08 00 FF 01 00 00 02 00 20 00
FA 01

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 7 of 15
Rd-03 Serial communication protocol V1.01

2.3.2. Turn off command mode

End the configuration command, and the radar will resume working mode after execution. If
you need to send other commands again, you need to send the enable configuration command
first.

Command word:0x00FE

Command value:N/A

Return value: 2-byte ACK status (0 for success, 1 for failure)

Send data:
Frame Header Data length in frame Command word Frame end
FD FC FB FA 02 00 FE 00 04 03 02 01

Radar ACK (success):


Data length in Command
Frame Header ACK Frame end
frame word
FD FC FB FA 04 00 FE 01 00 00 04 03 02 01

2.3.3. Parameter configuration commands

This command sets the radar minimum detection distance gate, maximum detection distance
gate, target disappearance delay time, trigger threshold and hold threshold parameters. For
specific parameter words, please refer to Table 7.

Command word:0x0007

Command value:2-byte parameter word + 4-byte parameter value

Return value: 2-byte ACK status (0 for success, 1 for failure)


Table 7 0x0007 Protocol Parameter Word
Parameter
Parameter name Parameter range
word
Minimum detection distance gate 0x0000 0~15
Maximum detection distance gate 0x0001 0~15
Target disappearance delay time 0x0004 0~65535 (in seconds)
Trigger threshold 0x0010~0x001F 0~(2^32)-1, the square of the modulus
Hold threshold 0x0020~0x002F 0~(2^32)-1, the square of the modulus

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 8 of 15
Rd-03 Serial communication protocol V1.01

Send data: Maximum detection distance gate 3 (not saved when power off)
Data length in Command Parameter Parameter
Frame Header Frame end
frame word ID Value
FD FC FB FA 08 00 07 00 01 00 03 00 00 00 04 03 02 01
Radar ACK (success):
Data length in
Frame Header Command word ACK Frame end
frame
FD FC FB FA 04 00 07 01 00 00 04 03 02 01

Trigger threshold and hold threshold setting guide:


The threshold value is the signal-to-noise ratio, the input value is S/N, the calculation formula
is 10lg (S/N), the range is 0~(2^32)-1
If the final threshold value is 47.47, the calculation method is 47.74=10lgX, X=10^4.774, the
calculation result of X is 59,429, and the final hexadecimal value is E825
The following configuration is required for the power-off saving parameters:
To query ABD, you need to add the ABD parameter when sending parameters.
1. To read ABD, send the following command
Data length in
Frame header Command word ABD Frame end
frame
FD FC FB FA 04 00 08 00 2F 00 04 03 02 01

2. The radar's ACK data will contain ABD parameters

Frame header Data length in Command ACK ABD Frame end


frame word parameter
FD FC FB FA 04 00 08 01 00 00 64 00 00 00 04 03 02 01

3. Maximum detection distance gate 3 power-off save reference, add ABD and parameters
based on the command not sent
Data
Frame Command Parameter Parameter ABD Frame
length in ABD
header word ID Value parameter end
frame
FD FC 03 00 00 04 03
0E 00 07 00 01 00 2F 00 64 00 00 00
FB FA 00 02 01

4. Modify the trigger threshold of the first distance gate to 47.47 and save (the trigger
threshold distance gate starts from 10, and the hold threshold distance gate starts from 20)
Data
Frame Command Parameter Parameter ABD Frame
length in ABD
header word ID Value parameter end
frame
FD FC 25 E8 00 04 03
0E 00 07 00 11 00 2F 00 64 00 00 00
FB FA 00 02 01

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 9 of 15
Rd-03 Serial communication protocol V1.01

2.3.4. Read parameter command


This command can read the current configuration parameters of the radar
Command word: 0x0008
Command value: 2-byte parameter value
Return value: 2-byte ACK status (0 success, 1 failure) + 4-byte parameter value
Send data: Read the maximum detection distance gate
Data length in Command
Frame header Parameter ID Frame end
frame word
FD FC FB FA 04 00 08 00 01 00 04 03 02 01
Radar ACK: The maximum detection range gate is 3
Data length in Command Parameter
Frame header ACK Frame end
frame word Value
FD FC FB FA 08 00 08 01 00 00 03 00 00 00 04 03 02 01

2.3.5. Start automatically generating threshold commands


This command sets the parameters for automatically generating thresholds and enables
the MCU to start automatically generating threshold calculations. For specific parameter
words, refer to Table 8.
Table 8 Automatically generated threshold parameter table
Parameter name Parameter range Explanation
10 times magnification factor, for example,
Trigger threshold
0x000A~0x00C8 when the factor is 2, the parameter value is
generation coefficient
0x0014
10 times magnification factor, for example,
Hold threshold
0x000A~0x00C8 when the factor is 2, the parameter value is
generation coefficient
0x0014
Command word: 0x0009
Command value: 4-byte parameter value
Return value: 2-byte ACK status (0 success, 1 failure).
Send data: Trigger threshold generation coefficient is 4, hold threshold generation coefficient is
1.5.
Data length in Command Parameter
Frame header Frame end
frame word Value
FD FC FB FA 06 00 09 00 28 00 0F 00 04 03 02 01
Radar ACK: Maximum detection range gate is 3.
Data length in Command
Frame header ACK Frame end
frame word
FD FC FB FA 04 00 09 01 00 00 04 03 02 01

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 10 of 15
Rd-03 Serial communication protocol V1.01

2.3.6. Automatically generate threshold progress query commands


This command can query the progress of automatically generating thresholds. The return value
contains the progress percentage. When the percentage is 100, it means that the threshold
generation is complete.
Command word: 0x000A
Command value: None
Return value: 2-byte ACK status (0 success, 1 failure) + 2-byte percentage
Send data:
Data length in
Frame header Command word Frame end
frame
FD FC FB FA 02 00 0A 00 04 03 02 01
Radar ACK: Success, percentage is 60%
Data length in Command
Frame header ACK Percent Frame end
frame word
FD FC FB FA 06 00 0A 01 00 00 3C 00 04 03 02 01

2.3.7. Configuring system parameters


This command can configure the radar system parameters, parameter word
0x0000-systemMode
Command word: 0x0012
Command value: 2 bytes parameter word + 4 bytes parameter value
Return value: 2 bytes ACK status (0 success, 1 failure)
Table 9 0x0012 Protocol Parameter Word
Parameter name Parameter Value Explanation
Debug mode 0x0000 Serial port reports RDMap
Serial port reports energy value and
Report mode 0x0004
detection results of each distance gate
Normal mode 0x0064 Serial port prints output status
Send data: Set to debug mode
Data length Command Parameter Parameter
Frame header Frame end
in frame word ID Value
FD FC FB FA 08 00 12 00 00 00 00 00 00 00 04 03 02 01
Radar ACK:
Data length Command
Frame header ACK Frame end
in frame word
FD FC FB FA 04 00 12 01 00 00 04 03 02 01

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 11 of 15
Rd-03 Serial communication protocol V1.01

2.4. Radar data output protocol

Rd-03 outputs radar detection results through the serial port. By default, it outputs basic target
information, including target status and movement distance. If the radar is configured in
reporting mode, the radar will additionally output the energy value of each range gate. Radar
data is output in the specified frame format.

2.4.1. Reporting data frame format

In the normal radar mode defined by the protocol, the reporting message frame format is shown
in Table 10. In the debugging mode and reporting mode, the definition of the reporting data
type value is shown in Table 11 and Table 12.
Table 10 Normal mode
Target state Movement distance
No range distance(cm)
OFF N/A

Table 11 Debug mode


Frame
Data Frame end
header
RDMAP: 20 (Doppler) * 16 (range gate) * 4 (square of
AA BF 10 14 FD FC FB FA
modulus)
Table 12 Reporting Mode
Frame Target Energy of each
Data length Test result Frame end
header distance range gate
2 bytes, the total
number of bytes
of detection 32 bytes, 16
1 byte
results, target (total number of
F4 F3 F2 F1 00 No one 2 bytes F8 F7 F6 F5
distance and range gates) * 2
01 Someone
energy values ​ bytes
​ of each range
gate

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 12 of 15
Rd-03 Serial communication protocol V1.01

3. Contact

Ai-Thinker official website Office forum Develop DOCS


LinkedIn Tmall shop Taobao shop Alibaba shop

Technical support email:[email protected]

Domestic business cooperation:[email protected]

Overseas business cooperation:[email protected]

Company Address:Room 403,408-410, Block C, Huafeng Smart Innovation Port, Gushu 2nd
Road, Xixiang, Baoan District, Shenzhen.

Tel:+86-0755-29162996

WeChat mini program WeChat official account

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 13 of 15
Rd-03 Serial communication protocol V1.01

Disclaimer and copyright notice

The information in this article,including the URL address for reference,is subject to change
without notice.

The document is provided"as is"without any guarantee responsibility,including any guarantee


for merchantability,suitability for a specific purpose,or non-infringement,and any guarantee
mentioned elsewhere in any proposal,specification or sample.This document does not bear any
responsibility,including the responsibility for infringement of any patent rights arising from the
use of the information in this document.This document does not grant any license for the use of
intellectual property rights in estoppel or other ways,whether express or implied.

The test data obtained in the article are all obtained from Ai-Thinker's laboratory tests,and the
actual results may vary slightly.

All brand names,trademarks and registered trademarks mentioned in this article are the
property of their respective owners,and it is hereby declared.

The final interpretation right belongs to Shenzhen Ai-Thinker Technology Co.,Ltd.

Notice

Due to product version upgrades or other reasons,the contents of this manual may be changed.

Shenzhen Ai-Thinker Technology Co.,Ltd.reserves the right to modify the contents of this
manual without any notice or prompt.

This manual is only used as a guide.Shenzhen Ai-Thinker Technology Co.,Ltd. makes every
effort to provide accurate information in this manual.However, Shenzhen Ai-Thinker
Technology Co.,Ltd. does not guarantee that the contents of the manual are completely free of
errors.All statements and information in this manual And the suggestion does not constitute
any express or implied guarantee.

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 14 of 15
Rd-03 Serial communication protocol V1.01

Statement

Ai-Thinker may provide technical and reliability data (including data sheets), design resources
(including reference designs), application or other design recommendations, network tools,
safety information and other resources (the "Resources") "as is" without warranties of any kind,
express or implied. Including, but not limited to, express or implied warranties of suitability,
fitness for a particular use, or non-infringement of any third party's intellectual property
rights.And specifically declares that it is not liable for any necessary or incidental losses,
including but not limited to, arising from the application or the use of any of our products and
circuits.

Ai-Thinker reserves the right to release information in this document (including but not limited
to metrics and product descriptions) and any changes to our products without prior notice. This
document automatically supersedes and replaces all information provided in previous versions
of the same document number file.

These resources are available to skilled developers who design with Ai-Thinker products. You
are solely responsible for: (1) Selecting the appropriate Ai-Thinker products for your
application; (2) Design, validate, and run your application and product throughout its life cycle;
(3) Ensure that your application meets all applicable standards, codes and laws, as well as any
other functional security, information security, regulatory or other requirements.

Ai-Thinker may authorize you to use these resources only for the development of applications
of Essence Products described in this Resource. Without the permission of Ai-Thinker, any unit
or individual shall not extract or copy part or all of these resources, and shall not be transmitted
in any form. You are not entitled to use any other Ai-Thinker intellectual property rights or any
third party intellectual property rights. You shall indemnify you in full for any claims, damages,
costs, losses and liabilities arising against Ai-Thinkeror its representatives in connection with
the use of these resources, for which Ai-Thinker is not liable.

The products offered by Ai-Thinker are subject to the terms of sale of Ai-Thinker or other
applicable terms attached to Essence's products. Essence's availability of these resources does
not extend or otherwise change the warranties or warranties disclaimers applicable to product
releases.

Copyright © 2023 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved Page 15 of 15

You might also like