Hello everyone,
I’m currently trying to integrate a 24GHz mmWave Radar sensor (Human Micro-Motion Detection, based on S3KM1110 and FMCW technology) with my Raspberry Pi 5, but I’m running into some issues. I’ve followed the connection and setup instructions as per the sensor’s official documentation, but I’m not getting any data output from the sensor. Here’s a quick rundown of my setup:
Wiring Configuration:
- 3V3 to 3.3V
- GND to GND
- TX to RXD (GPIO 14 - pin 8)
- RX to TXD (GPIO 15 - pin 10)
I have the UART pins configured as follows:
$ pinctrl get 14
14: a4 pn | hi // GPIO14 = TXD0
$ pinctrl get 15
15: a4 pu | hi // GPIO15 = RXD0
Raspberry Pi Configuration:
I followed the steps to disable serial port debugging and enable UART:
$ sudo raspi-config
# Selected Interfacing Options -> Serial -> no -> yes
$ cat /boot/firmware/config.txt | grep uart
dtparam=uart0=on
Sample Code Execution:
After setting up the environment and installing dependencies, I ran the provided demo, which only printed empty lines:
mkdir HMMD_mmWave_Sensor && cd HMMD_mmWave_Sensor
python -m venv env
source env/bin/activate
pip install pyserial
wget https://files.waveshare.com/wiki/HMMD-mmWave-Sensor/HMMD_mmWave_Sensor.zip
unzip HMMD_mmWave_Sensor.zip
cd raspberry && python Raspberry_demo.py
To debug, I created a simple script to send hex commands and read the output, but it seems like there’s no data coming through:
import serial
import binascii
import time
def send_hex_string(serial_port, hex_string):
hex_bytes = binascii.unhexlify(hex_string)
print(f"Sending hex: {hex_string}") # Debug: show what is being sent
serial_port.write(hex_bytes)
print("Data sent successfully.") # Confirm data was sent
def read_serial_data(serial_port):
print("Ready to receive data...")
while True:
if serial_port.in_waiting > 0:
data = serial_port.readline().decode('utf-8', errors='ignore').strip()
if data:
print(f"Received: {data}") # Debug: print received data
else:
print("Received data, but it's empty.")
else:
print("No data waiting.")
time.sleep(1) # Pause briefly, adjust as necessary for your context
if __name__ == "__main__":
try:
ser = serial.Serial('/dev/ttyAMA0', 115200, timeout=1)
print("Serial port opened successfully.")
except Exception as e:
print(f"Failed to open serial port: {e}")
hex_to_send = "FDFCFBFA0800120000006400000004030201"
send_hex_string(ser, hex_to_send)
try:
read_serial_data(ser)
except KeyboardInterrupt:
print("Stopped by User")
finally:
ser.close()
print("Serial port closed.")
Output:
Serial port opened successfully.
Sending hex: FDFCFBFA0800120000006400000004030201
Data sent successfully.
Ready to receive data...
No data waiting.
No data waiting.
No data waiting.
No data waiting.
Does anyone have any suggestions or insights into what might be going wrong? Any help or advice would be greatly appreciated.
Thanks in advance!