Reference
This article details the UART and Modbus protocol for liquid level detection, including register configurations, API functions, and the principles of FMCW technology.
Communication Protocol Description
Output: UART (Modbus protocol)
| Register | Read and Write | Parameter Meaning | Instruct | Remark |
|---|---|---|---|---|
| 0x0001 | R/- | Empty Height | 01 03 00 01 00 01 D5 CA | Unitmm, filtered data |
| 0x0003 | R/- | Water Level | 01 03 00 03 00 01 74 0A | Unitmm, filtered data |
| 0x0005 | R/W | Installation Height | 01 03 00 05 00 01 94 0B / 01 06 00 05 [AA] [BB] [CC] [DD] | Unit: cm Distance from radar to water bottom,water level equal to installation height minus Go high. To read the water level, first set the installation height. |
| 0x03F4 | R/W | Device Address | 01 03 03 F4 00 01 C5 BC / 01 06 03 F4 [AA] [BB] [CC] [DD] | Range: 0x01 - 0xFD Broadcast support 0xFF |
| 0x03F6 | R/W | Baud Rate Adjustment | 01 03 03 F6 00 01 64 7C / 01 06 03 F6 [AA] [BB] [CC] [DD] | 48 96 144 192 384 560 576 1152 1290 Read, write baud rate, actual baud rate/100 |
| 0x07D4 | R/W | Range | 01 03 07 D4 00 01 C5 46 / 01 06 07 D4 00 [AA] [BB] [CC] | Default: 0X0A, unit mMaximum range is related to product model |
API Description
// Constructor: Initialize RX, TX pins and device address of the sensor
LiquidLevelDetection(uint8_t rx_pin, uint8_t tx_pin, uint8_t device_addr = 0x01);
// Initialize sensor communication, set baudrate
bool begin(long baudrate = 115200);
// Get current range (unit: meter)
float getRange();
// Get empty height (distance from sensor to liquid surface, unit: meter)
float getEmptyHeight();
// Set installation height (unit: centimeter)
bool setInstallationHeight(float height_cm);
// Get installation height (return unit: meter)
float getInstallationHeight();
// Get water level height (unit: meter)
float getWaterLevel();
Principle
Utilizing Frequency Modulated Continuous Wave (FMCW) technology.
The radar operating frequency band is 80GHz, and the maximum range of 40m is the range of measurement. Depending on the size of the object's RCS, the maximum detection distance will have deviations. The measurement zero point of the millimeter wave module has been calibrated from the antenna surface to the lens end at the factory, and the measurement distance value will be calculated from the top of the lens.
Was this article helpful?
