Looking for a distance Sensor

Hello,
maybe someone can help me.
I'm looking for a distance sensor.

The sensor is supposed to send me distances between paving stones and a vehicle (size: like a lawnmower).
It's about recognizing the joints in the paving stones.
The distance from the paving stones to the vehicle is approximately 3-6 centimeters vertical.
The sensor should scan a transverse line of around 3-5cm and provide around 30-50 distance values.

I've already tried few things, unfortunately not with satisfactory success.

e.g. color scanner: Unfortunately too slow and too inaccurate on dark pavement. No unique vector.
e.g. ultrasound: Unfortunately there is no clear point assignment. No unique vector.
e.g. camera (image processing): Unfortunately, there is no clear assignment for dark or defusive images. No unique vector.

I've now landed on a distance laser, but haven't found a suitable module yet.
A lidar with a scanning angle of around 45° and a distance of 0-50mm with a resolution in the millimeter range would be ideal.
Perhaps also important: The module should also work outside, so sunlight should have no influence.

Pretty challenging, right? But maybe someone has an idea or tip. Would be very grateful.

How would you know if the change in distance isn't caused by the lawnmower moving up and down as it moves over the pavers.

Yes, that's right, that will be an issue. But as long as I don't have any data, I can't test what influence the driving of the vehicle has. I would say, at moment second priority.

Hi,
did you try VL53L0X Sensor yet?
I was looking for a distance sensor and tried this one as well. It was working fine and there are easy sketches available to run it.

* VL53L0X Test am 24.6.24 ok mit 5V und 3,3 vom Board
5V anschluss Sketch von AZDelivery
scl ist pin 21 am Mega und
sda ist Pin 20
*/



#include "Adafruit_VL53L0X.h"
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
void setup() {
Serial.begin(115200);

char buf[150];
  snprintf( buf, sizeof(buf), "\nSketchname: %s\nBuild: %s\t\tIDE: %d.%d.%d\n\n", __FILE__, __TIMESTAMP__, ARDUINO / 10000, ARDUINO % 10000 / 100, ARDUINO % 100 / 10 ? ARDUINO % 100 : ARDUINO % 10);
  Serial.print(buf);   // Ausgabe des Sketchnamens

while (! Serial) {
delay(100);
}
Serial.println("VL53L0X sensor test");
if (!lox.begin()) {
Serial.println(F("Failed to boot VL53L0X"));
while (1);
}
}
void loop() {
VL53L0X_RangingMeasurementData_t measure;
Serial.print("Reading measurement - ");
lox.rangingTest(&measure, false);
if (measure.RangeStatus != 4) {

Serial.print("Distance (mm): ");
Serial.println(measure.RangeMilliMeter);
}
else {
Serial.println("Out of range!");
}


//if (measure.RangeMilliMeter <20) {

 delay(400);
}

(Comments are in German, but I think there should not be any problems to understand the meaning, I run it on an Arduino Mega)
Best regards
Andy

I disagree but it's your project.

Hello schanderl,

I've also looked at the VL53L0X.
I'am German, so I can read this, and I use also the MEGA.
It's actually exactly what I need, but isn't it a one-point sensor?
I need about 50 points in a row across the direction of travel so that I can find the joint.
I didn't find any information as to whether the VL53L0X can do that.
Can you give me information about this?

Yes

I didn't find any information as to whether the VL53L0X can do that.

It can't

So either your sensor needs to move across the travel or you need 50 sensors.
But why? You might get better suggestions if you just tell what are trying to accomplish and what kind of pavement you have....

Did you consider to add lights?

An alternative might be to use UV light and UV sensors, or IR?
These might give different reflections.

Can you post a photo of what the problem looks like?




Hello,

First of all, thank you very much for the well-intentioned advice.
And OK, photos say more, so here are some.
Here one photo like many paving stones with joints that can be seen.
The vehicle should recognize the joints and drive along them as accurately as possible.
If it can do that, a laser should burn away the weeds in the joints.
(safty first of course, but this is a later task).
As mentioned, I've already tried a few things, including image recognition.
But image recognition, or better line tracking, is done with grayscale images.
Not easy with this picture.
The other picture is my first attempts at image recognition.
The small vehicle is object tracking with PIXY camera, which works great by the way. It follow the object.
The larger vehicle can already track lines, even excellently if the background is light and the line is much dark as possible.
But until now it isn't so easy to recognize the joints in the stone image.

Can the PIXY be taught to recognize the blocks?

Yes, but in this case I have to change the firmware of PIXY. This would be a big task.

That can bring challenge also for the distance measurement approach.

Why "not easy"? Any image can be converted to gray scale.

Recognizing those joints would be quite simple using OpenCV. Consider using an RPi Zero or Zero 2 running linux and using Python or C/C++ and OpenCV for the line detection and steering.

There are plenty of tutorials and examples to follow, for (a randomly chosen) example python - How to detect lines in OpenCV? - Stack Overflow

Thank you for the comments and suggestions.

I have now picked out two topics that are promising.

On one hand, triangulation for distance detection.

On the other hand, which interests me very much, the use of a Raspberry Pi with a camera and its own evaluation using OpenCV.

The page "How to detect lines in OpenCV?" in StackOverflow contains really good information.

Google Colab also sounds very interesting and I didn't know it yet.

A lot happen since I stopped my work.

There's a lot to do, let's get it on.