XM125 - Measurement

Hmm - I’m seeing very little variation- only when my test object is off sensor axis or a bad reflector.

Reviewing the acconeer app/example, the sequence we follow matches there operating pattern maybe a bad sensor on your end or the I2C connection mode of operation from acconeer needs some tweaks.

Kirk

Hi Kirk.
I just wanted to let you know that I had the time to test with the other module. The results seemed better. Great!

How should I interpret the different peaks?

E.g peak1, peak2. If I just want one distance measurement?

You can implement an averaging algorithm in your code…a ‘moving average’ is what I usually recommend, the number of samples to average will depend on how fast you’re polling, but you can try taking the last 20 using ((0.95 * old average) + (0.05 * new single datum)) / 20 as a starting point and make it fit your use case (as few as 2 samples are needed, although hopefully obviously you would then divide by the # samples new + old, weighted)

@xkaas - Great to hear the results are better.

Looks like Rusty has provided some pointers on how to actually use the data from the sensor.

Anything beyond that is really a questions for Acconeer- they are the experts.

Thanks again for testing all this out!

-Kirk

1 Like

Where in the code (Example 6, version 2.0) can we set sampling settings and all? I havent been able to find this part.

We are currently measuring garbage in underground containers that are about 3.5 m3, or what is equal to 280cm in depth.

Will ask them too!
Is it possible to do some kind of calibbration via the arduino code?

You can, but it isn’t already implemented/done for ya…you’ll need to create a function within the example that takes the readings and wraps the data into a more useful output for you

We don’t provide custom code, but if you feed that example’s code/text into an AI model (claude is great for this kind of thing!) and describe your wants you can likely get it going with a few tries/retries

1 Like

I will give claude a try. But just to completly understand - the peaks should be sampled and calculated upon?

What I often see is I have the ceiling at 2m. It reads 2m with a high signal in minus. E.g -8000

If I put an object over it at 1 m, I get a peak0 at 2 m, and a peak1 at 1m.

Would the average of this not be wrong?

You can filter out known erroneous values if need be

If anyone ever get to work more with these please ping me.
I’ve tried both with claude and other AI tools - And doing some avereaging. I think the code is fine, however, the issue always arises - Wrong or very slow distance measurement

15:32:43.799 → Distance Peak 1: 80.30cm Distance Peak Strength 1: -4651
15:32:46.697 →
15:32:46.697 → Number of Values Detected: 2
15:32:46.697 → Distance Peak 0: 2.00m Distance Peak Strength 0: -542
15:32:46.697 → Distance Peak 1: 80.20cm Distance Peak Strength 1: -5050
15:32:49.626 →
15:32:49.626 → Number of Values Detected: 2
15:32:49.626 → Distance Peak 0: 2.00m Distance Peak Strength 0: -409
15:32:49.626 → Distance Peak 1: 80.10cm Distance Peak Strength 1: -4990
15:32:52.522 →
15:32:52.522 → Number of Values Detected: 2
15:32:52.522 → Distance Peak 0: 2.00m Distance Peak Strength 0: -737
15:32:52.556 → Distance Peak 1: 80.00cm Distance Peak Strength 1: -4689
15:32:55.456 →
15:32:55.456 → Number of Values Detected: 2
15:32:55.456 → Distance Peak 0: 1.99m Distance Peak Strength 0: -477
15:32:55.456 → Distance Peak 1: 80.40cm Distance Peak Strength 1: -4684

In this case, 80cm is the wall - 2m I have no idea where. It will jump back and fort hbetween peaks so we cant just sort by peak1 or peak2.

For our use case, we are trying to do waste management. Using the acconner example works. Im unsure if we have any way to configurate the arduino libary this way. Else we just need to implement it directly in C :slight_smile:

I’d love to hear if anyone gets the distance measurement working like in the tutorial video. I dont think this will work for waste.