Acconeer XM125 output readings not correct

I bought his board https://www.sparkfun.com/products/24540 SparkFun Pulsed Coherent Radar Sensor - Acconeer XM125

I downloaded these libraries:

SparkFun Toolkit 0.9.1

SparkFun Qwiic XM125 v1.0.1

I am using the default firmware (i.e. i2c_presence_detector.bin) and example code Example01_PresenceBasicReadings. In the serial window it displays random readings when sitting on my desk pointed at the ceiling about 5ft above the sensor.

the distance jumps around lot:

16:56:45.102 → Presence Detected: 162mm

16:56:45.712 → Presence Detected: 162mm

16:56:46.323 → Presence Detected: 162mm

16:56:46.933 → Presence Detected: 162mm

16:56:47.546 → Presence Detected: 54mm

16:56:48.159 → Presence Detected: 54mm

16:56:48.751 → Presence Detected: 54mm

16:56:49.349 → Presence Detected: 54mm

16:56:49.947 → Presence Detected: 54mm

16:56:50.558 → Presence Detected: 54mm

16:56:51.158 → Presence Detected: 54mm

16:56:51.768 → Presence Detected: 30mm

16:56:52.378 → Presence Detected: 210mm

16:56:52.982 → Presence Detected: 210mm

16:56:53.621 → Presence Detected: 54mm

16:56:54.187 → Presence Detected: 174mm

16:56:54.833 → Presence Detected: 198mm

16:56:55.442 → Presence Detected: 198mm

I was watching your demo video where he tapes it to the wall and goes outside his office but it reads in cm. Can you tell me what example he used and the bin firmware used ?

thanks

Maybe the code changed between the video and now but you can see the sketch name in the video and it’s example 2.

https://github.com/sparkfun/SparkFun_Qw … 0Usage.ino

compiled the code you provided but still getting unknown readings none of which makes sense. Is there a calibration step I missed ?

These readings should be around 1524mm since the ceiling is 5ft, 60 inches away. I tried pointing to walls etc but the output jumps around a lot.

19:59:26.338 → Presence Detected: 42mm

19:59:26.966 → Presence Detected: 150mm

19:59:27.557 → Presence Detected: 258mm

19:59:28.149 → Presence Detected: 150mm

19:59:28.788 → Presence Detected: 150mm

19:59:29.402 → Presence Detected: 150mm

19:59:30.003 → Presence Detected: 150mm

19:59:30.572 → Presence Detected: 174mm

19:59:31.217 → Presence Detected: 162mm

19:59:31.798 → Presence Detected: 30mm

19:59:32.407 → Presence Detected: 42mm

19:59:33.020 → Presence Detected: 150mm

19:59:33.625 → Presence Detected: 150mm

19:59:34.211 → Presence Detected: 42mm

19:59:34.840 → Presence Detected: 54mm

19:59:35.452 → Presence Detected: 162mm

Sparkfun?

No insight from me here … just +1 on your observations of unexplained, and effectively meaningless (?) readings from the XM125 module running default presence detection code. (My setup would appear to be very similar to yours … module on desk, nothing around it, pointing upwards towards ceiling. About 6’ distance in my case). I’ve attached numbers from one trial, but I’ve also noted trial-to-trial variation. Only additional thing to add is that there is a change in the numbers when object is inserted/removed from the beam, suggesting some sort of detection.

(Trying to switch over to flash the distance detection code to the module, but struggling to get the STM32CubeProgrammer and module to communicate … that’s another topic though. Haven’t tried the Acconeer Exploration Tool yet).

Hi

I received my XM125 module this week and getting the same results as yourself. Just meaningless readings, both using the presence and distance modes.

Anyone else getting good data from the unit?

I flashed the module with i2c_distance_detector.bin and now using Example06_DistanceBasicReading and getting very stable readings.

my guess is the presence example needs to use the GPIO pin and if high then display the distance ?

But I think the SF examples have a typo - they are using mm when it should be cm. This makes sense my reading pointing at the ceiling (5ft way) says 154mm - .5ft, but 154cm would be 5 ft. Then I moved the sensor about 3ft from a wall and got 100mm, but again 100cm would be ~ 3ft.

SF can you confirm the code examples should be in cm, not mm ?

I was encouraged by your latest findings so also managed to flash I2c_distance_detector.bin, then run Example06 to check things out … I concur that the readings are much closer to as expected now as well as stable. (… and I’m sure you are correct that the readings are intended to be in cm, not mm).

for the STM32CubeProgrammer (I am using windows) open device mgr (start, run, devmgmt.msc) , expand ports, verify the COM name, then in the STM32CubeProgrammer in the upper right corner select the blue button and change it to uart, select the COM port from device mgr, etc and it should connect.

I was watching the SF video again and noticed they had CM so maybe they just have not updated their examples with the right units.

Hi

I agree with the cm/mm comments, I just changed the code and getting the following which agrees closely with the actual distance to the ceiling

Peak0 Distance, Strength: 193cm, 75.98in.

4294962

Peak0 Distance, Strength: 190cm, 74.80in.

4294962

Peak0 Distance, Strength: 191cm, 75.20in.

4294962

Peak0 Distance, Strength: 193cm, 75.98in.

4294963

Peak0 Distance, Strength: 192cm, 75.59in.

4294961

Peak0 Distance, Strength: 192cm, 75.59in.

4294961

Peak0 Distance, Strength: 176cm, 69.29in.

4294963

Peak0 Distance, Strength: 193cm, 75.98in.

4294961

I created a github issue for this, follow up @ https://github.com/sparkfun/SparkFun_Qw … y/issues/3

Thanks everyone for the feedback! I’m not the original designer of this particular product so it took me a few hours longer than I’d like to get to the bottom of what’s going on with the library. The default values within the registers are indeed in millimeters but within the library, this value is being divided by 10 which as you all know, gives you centimeters. I’ll update the library to give results in millimeters and add some commented out code within the first example to give measurements in different units if the user decides that’s what they want.

Cheer,

Elias

thank you Elias ! and thanks to everyone for helping test this !