Seeder IR distance sensor

Here are some details of the distance sensor I added to the seeder. It’s an infra-red distance sensor from Sharp, on a carrier board from Pololu, this one I think

Here are some pictures:-

The sensor connects to the 5V/Gnd and gives an analog output which varies with the distance (between 10cm and 150cm). The output isn’t linear because it measures infra-red reflected energy, so it needs calibrating, but that’s easy enough; just set some known distances, measure the output, and then linearly interpolate between those points.

There’ll probably be some variation due to the uneven surface of the soil, but I’ll be monitoring the performance and report back in due course on how well it works.


You’re easily becoming my favorite FarmBot Operator :astonished:

1 Like

This is awesome, thanks for sharing!

And how does it work so far?

So far so good, I lower the Z axis until I get the reading which indicates 90mm above the soil, then I know how much further to lower to get 20mm into the ground. All good :slight_smile:


I bought the sensor as well, could you share a screenshot of your sequence?

I don’t use sequences, so can’t help with that side of things I’m afraid. If their sequence doesn’t support ‘calculations’ then I guess you’ll have to stop at some known depth, read the analogue pin, then do a series of comparisons (if/then/else) to determine your planting depth. Or, conversely, have a sequence which stops every 5mm or 10mm, read the pin and when you’ve got to the required height above the soil (say 80mm) then call a sub-sequence to move the extra Z to get to the required planting depth.