The Countdown to Maker Faire Bay Area is On!


How-To: Visualize sensor data with Arduino & Processing

Arduino Robotics Technology
How-To: Visualize sensor data with Arduino & Processing


Infrared sensors can give robotics projects useful data about nearby objects, but what if you want to actually see that data yourself? –

I recently acquired a few Sharp GP2Y0A21YK0F IR distance sensors. This is an inexpensive proximity sensor which can detect objects from 10-80cm. A nice tutorial on this sensor can be found at These sensors only detect objects within a narrow beam, so I decided to mount mine on a servo, so that I could pan the sensor approximately 180 degrees, and take multiple readings to build up an idea of what obstacles are in front of my robot. I like to visualize things, so I decided to write a small program in processing to visualize the sensor data for debugging and to help me better understand what the sensor is seeing.

Though not scaled precisely to match, the above overlay illustrates how the outside world appears via sensor panning. This could prove quite useful for remote ‘exploratory missions’. Instructions and source code available at uC Hobby.

In the Maker Shed:

Makershedsmall Arduino Family Make: Arduino

4 thoughts on “How-To: Visualize sensor data with Arduino & Processing

  1. cornishbob says:

    it would be intersting to seethis combined with a camera on te same swiveling servo, so the camera outputs an image with some kind of overlay showing the proximity or whatever is ahead.

    Imagine if you will the original image of the desktop.

    the camera would output the “robots eye view” with darker shading or something overlayed on the corection fluid bottle so humans can see the image as well as the robots “vision” of the obstacles.

    not sure what practical apllication it would have though…..


  2. Collin Cunningham says:

    @cornishbob – cool idea, could perhaps lead to some interesting 3D images?

Comments are closed.

Discuss this article with the rest of the community on our Discord server!
Maker Faire Bay Area 2023 30% off early bird ticket sales ends August 31st, 2023!

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Prices Increase in....