Temperature and Humidity Sensor
Sonbus SM7820B Temperature and Humidity Sensor
- Official documentation: Sonbus SM7820B
Preparation
- Rhino Pi A1
- Sonbus SM7820B temperature and humidity sensor
- Additional cables
- External 5V power supply
Hardware Connection
The sensor requires at least 5V power. Since the Rhino Pi A1 5V pin and GND pin are still under development, this example uses an external power supply for the sensor.
Connect the sensor RS485 A/B signals to the Rhino Pi A1 RS485 A/B interface.

Test
The Sonbus temperature and humidity sensor requires a manual measurement command to return results. Each command produces one result.
- Because
minicomcannot easily send raw hexadecimal input, create a script to convert hexadecimal text to binary and send it to the serial port. Example script:
#!/bin/bash
# Check parameter count
if [ "$#" -ne 2 ]; then
echo "Usage: $0 [serial port] [hex data]"
exit 1
fi
SERIAL_PORT=$1
HEX_DATA=$2
printf "$HEX_DATA" | xxd -r -p > $SERIAL_PORT- Send the measurement command using the script:
./send_hex.sh /dev/ttyHS1 '010300000002C40B'/dev/ttyHS1 is the RS485 device node on Rhino Pi A1.
010300000002C40B reads temperature and humidity measurement data. Other commands, such as baud rate configuration, are available in the Sonbus product manual.
- Use
minicomon AidLux to receive data. If it is not installed, install it with:
sudo apt update
sudo apt install minicomOpen the serial port:
sudo minicom -D /dev/ttyHS1 -b 9600 -H-b 9600 sets the baud rate to 9600 (the sensor default).
-H enables hexadecimal display.

Result Analysis
After sending the request frame, the sensor returns a response frame, for example:
01 03 04 0a e4 17 65 76 07
The response format is shown below:

Data field 1 is temperature, and data field 2 is humidity. For example, convert 0a e4 to decimal: 2788.
The scale factor is 100, so the actual temperature is 2788 / 100 = 27.88°C, indicating the current room temperature is 27.88°C.