Sensor Data Processing

Distance sensor setup

This is a description of an experiment where the output data from a distance sensor was modeled into useable information. By Jasper de Kruiff, Karin Niemantsverdriet, Vincent van Rheden, Willem Willemsen


In our experiment we did control tests for every interval of 10cm around the supposed sensor limit of 150cm (from 80 to 200cm). This was done by placing the sensor on top of a ruler and pointing it to a fixed target. 100 readings at an interval of 100 ms were taken from each distance. An Arduino Duemilanova was used to convert the analogue sensor data into digital values. These values were then stored in an Excel datasheet for later use in Illmo.

For more information on how we set up the experiment, please see the tutorial Collect data with Arduino.

Signal Processing

While collecting our data we noticed many peak values even when measuring at fixed distances. We knew up front that these peak values would have a major impact on the reliability of our model. Therefore we shifted the focus of our experiment towards signal processing. Our goal in this experiment became to try various signal processing techniques in order to get the most reliable sensor data. Statistics will be used to verify and compare the signal processing techniques and draw conclusions.

Our first instinct was to average values in order to remove some of the peaks. Another way to filter out peaks is to use the median of several values. In our experiment we finally decided to use both a median filter and an average filter with a filter size of 5 and 9 samples.

Our expectation was that the median filter would be a better method for removing peaks, as an individual peak has no direct influence on the median value, while it does have a slight impact on the average.

Statistical Analysis

These graphs represent the data which is filtered by a median filter of five values. The left graph shows the original data, the right graph shows the data after the optimization. The data sets were entered and optimized within the Illmo program, as explained in the Model Optimization in Illmo tutorial.


We attempted to answer two questions with statistics. (How much) did our use of signal processing improve the reliable distance of our sensor? At what distance is the sensor reliable according to our specifications. We collected data from the distance sensor at 10 cm intervals between 80 and 200 cm. We consider the sensor to be reliable if it can differentiate two distances in such a 10cm interval with more than 95% certainty.

The statistics clearly show that signal processing improved the reliable distance of the sensor. We applied a median filter and an average filter on the raw sensor data. With both filters, the data was much more reliable than the raw data. Our results show that the median filter was slightly more effective at filtering out peaks than the average filter was. We concluded that the raw data was more than 95% reliable up to a distance of 100 cm, while the processed data was reliable up to a distance of 160 cm. Both data sets indicate that the reliability decreases with distance.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s