Arduino library for interfacing with the Sharp IR range finders

Published on November 14, 2013

Categories: software, embedded

Tags: c++, range-finder, infrared, model-fitting


SharpIRLib is a project around the Sharp IR range finders. It consists of two parts. The first one allows to fit a model on the sensors’ response characteristics. The second one is an Arduino library that offers an API for interfacing with the sensors.

Infrared range finders are proximity sensors. They can be used in either analog mode to measure distance, or digital mode to detects obstacles in front of mobile robots. You can find some technical details on the sensors, here.

The Curve Fitting takes some measurements from a sensor, and then processes these data in either MATLAB or Python to extract a function mapping the voltage readings to some unit of length ( or ). The library tries to abstract away the setup and operation of the sensor. It offers features such as distance reading, averaging, change of reference point and obstacle detection.

There is a tutorial on SharpIRLib on codebender’s blog. The source code is available on GitHub.