Help Needed with 24GHz mmWave Sensor on Raspberry Pi 5

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!

Is the Pi UART pins correct ? You could try swapping them.


src: https://www.hackatronic.com/raspberry-pi-5-pinout-specifications-pricing-a-complete-guide/

2 Likes

Hey Reza,

I second what Michael has said. Swapping your TX and RX connections is a good starting point. Would you be able to let us know where you have found the documentation to see if it can give us any insight into this issue?

Thanks, Sam.

1 Like

Hi,

Thank you, @Michael99645 and @Samuel.

Indeed, swapping the UART pins worked!

Would you be able to let us know where you have found the documentation to see if it can give us any insight into this issue?

I was using the official Waveshare documentation: https://www.waveshare.com/wiki/HMMD_mmWave_Sensor.

Thank you!

Great, I like things that are simple fixes.

1 Like

Awesome, glad this didn’t give you to much trouble.

Hi Reza
I’m testing this sensor with a Pi Zero and I’m getting a flow of data see below. I have not changed any of the default settings. Waveshare’s guide says: “The HMMD mmWave Sensor operates in default mode by outputting detection results through the serial port. The output consists of a string indicating ON/OFF along with the target distance gate.”


I’m struggling to find any correlation between the default output and the my range from the sensor. It seems that the initial sensor reading is somewhat related to range but this does not appear to update if I move about. Are you able to get meaningful data, and if so, could you suggest how this is done?
Thanks, Richard

Hi @Richard83832,

I attempted to run this program on a Pi Zero W and I kept running into a device error with it being unable to find the sensor on the serial bus. Did you run into any similar issues?

Hi Aaron, no, I didn’t have a problem getting output from the sensor, but in my case the output seemed useless. I’ve given up on this sensor for the moment and I’m trying a PIR instead.

Thanks for letting me know.

I had no issues with a Pi 5 its something about the Zero that is causing issues for me.

I hope the PIR provides more success for your project.