SonicMEMS US5 Grove Ultrasonic Sensor Instruction Manual
- June 12, 2024
- SonicMEMS
Table of Contents
SonicMEMS US5 Grove Ultrasonic Sensor Instruction Manual
WORKING MECHANISM
Model
US5 system has 3 working modes: IO mode, UART mode, and UART REQ mode.
The output frequencies are all 100Hz.
- IO mode : When the US5 is powered on, the default is IO mode. When a soft material is recognized, the TX output is low; when a hard material is recognized, the TX output is high. The output frequencies is 100Hz.
- UART mode: When the US5 enters the UART mode, it outputs the specified data according to the communication protocol. The output frequencies is 100Hz.
- UART mode: The user sends a command to query the output results. The maximum query frequency is 100Hz
Measuring Principle
This product is based on the ultrasonic time-of-flight (ToF) principle, and is
equipped with related acoustics, electricity and algorithm design, and
realizes high-precision distance measurement through the energy difference of
ultrasonic echo signals on the surface of different materials, and output
millimeter-level distance information and its echo energy intensity value, and
can also output flag bits to distinguish soft and hard materials.
SYSTEM COMMUNICATION
Communication Mechanism
US5 communicates commands and data with external devices through the serial
port. When an external device sends a system command to US5, US5 resolves the
system command and returns a corresponding reply message. According to the
command content, US5 switches the corresponding working status. According to
the content of the message, the external system can parse the message and
obtain the response data.
Note: The US5 data communication adopts the little-endian mode, least
significant bit firs
FIG 1 US5 SYSTEM COMMUNICATION
Communication Protocol
CHART 1 US5 COMMUNICATION DATA PROTOCOL
Packet Header| Command Code| Response Length| Data
Segment| Check Code
---|---|---|---|---
2 Bytes| 1 Byte| 1 Byte| …| 1 Byte
The command message and the working message are formulated according to the data protocol in Table 1, and the communication baud rate is 115200.
Command Message
The external system can set the corresponding working status of US5 and
obtain corresponding data by sending related system commands. The system
commands issued by US5 to external are as follows:
CHART 2 US5 SYSTEM COMMAN
System Command | Description | Answer Mode |
---|---|---|
0x40 | Reset module | No response |
0xF8 | Set to IO mode | Single response |
0xFE | Set to UART mode | Single response |
0xFA | Set to UART REQ mode | Single response |
0xFC | Obtaining measurement data in UART REQmode | Single response |
Setting the IO mode:
Setting the UART mode:
Setting the UART REQ mode:
Obtaining measurement data in UART REQ mode:
Response Message
The response message is the message returned by the system according to the received command. Different commands have different response content of the response message, and the response message is a single response; No response means that the system did not receive and parse the system command correctly
Response message:
- Data: The command code in the command message parsed by the US5: 0xF8, 0xFE in Chart 2.
Data Message
Data message is the message that the system outputs the measurement results,
which will be output at a rate of 100Hz in the UART mode. In UART REQ mode,
every time a 0xFC command is sent, a measurement result is returned.
- Data: The meaning is as follows:
CHART 3 THE MEANING OF THE DATA SEGMENT OF THE DATA MESSAGE
Packet Header | Distance Value | Intensity Value |
---|---|---|
1 Byte | 2 Bytes | 1 Byte |
- Blanket sign : 1 means with blanket, 0 means no blanket;
- Distance value : the unit is mm;
- Intensity value: a numerical value representing the strength of the ultrasonic signa
For example:
Data segment parsing :
- Blanket not detected (0x00);
- The distance is 37mm (0x25 + 0x00<<8);
- Intensity value is 150 (0x96).
Frequency Calibration
The frequency of the ultrasonic transducer has been calibrated at the factory, and usually does not need to be calibrated again. If necessary, a hard material object can be placed 19mm in front of the end face of the module, such as steel plate, wood board, etc., and ensure that the end face is parallel to the plane of the hard material object, and then operate according to the following steps.
-
Sending the calibration mode command
Note that this instruction needs to be sent three times in a row for the reply packet to occur. -
Staring the calibration mode command:
-
Check whether calibration has completed:
-
Query response for calibration completion:
A value of 0 indicates that the calibration is not complete, while a value of 1 indicates that the calibration is complete
Check Code
The check code uses single-byte accumulation to verify the current data
packet. Only the check code itself does not participate in the check
operation. The check code solution formula is:
Check Sum = ADD??????(????) ?? = 1,2, … , ????�
ADD?????? is an accumulation formula, which means to accumulate the numbers
from subscript 1 to end in the element
ATTENTION
- There may be a jump in the output result at the critical point of the range, and the host side needs to judge the data.
- Avoid splashing water in the use environment, which will cause abnormal output results.
REVISION
Date | Version | Writer | Content |
---|---|---|---|
2021-12-09 | 0.1.0 | **** Leo | The 1st release |
**** 2022-02-10 | **** 0.1.1 | 1) Add an example of data packet parsing; 2) |
The check code indicates that it is changed from ADD8 toCS
**** 2022-11-24| **** 0.2.0| 1) Add reset instructions2) Add the
UART REQ mode description3) Add frequency calibration instructions
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>