Distance sensor

Last year we struggled with the proximity challenge a little bit. We originally chose to use an ultrasonic sensor, and to get these working, 10uS pulses are sent to the trigger pin and the time the echo pin is high is measured and converted into a distance. The Raspberry Pi is not particularly good a precise timings, it is a multi-threaded operating system and at any time it may decide to check WiFi or do some other general operating system task and miss the timings for the ultrasonic sensor. In the end we ran with an infra-red sensor which just had a high/low output with a fixed distance.

Distance sensor
This year we wanted to be able to measure the precise distance and Jon found the VL6180 infra-red sensor. This is interfaced over I2C and responds with a precise distance. This would enable the Pi to query the distance without any timing issues. The particular board we are using is from Sparkfun and it comes with information for getting started with an Arduino. Jon quickly got it up and running on an Arduino for testing and it looked very promising, so he has now produced a C library for the Raspberry Pi. You can find the library on his GitHub repository here. Jon has released the library under the MIT license so feel free to grab it and use it in your project or robot. We would love to hear if you are using this sensor or library, it looks like a very nice sensor.

I have also noticed that Leo White who is building Optimus Pi for this year’s competition is also using this sensor. He has some information on his blog here.

2 Comments

  1. Very impressive guys. I’ve opeted for the generic SR-04 due to having no experience with any sensor like this previously. Looking forward to seeing how this performs for you.

    Must dash…off to get my robot’s claw attachment laser cut… 😉

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.