Micromouse sensors are subject to several sources of error and interference. Capturing a set of data samples lets you do some simple analysis of the effects of those errors.The test rig was set up with a section of wall placed at about 50mm from the sensors. This gives a large reading where noise and interference should be a small proportion of the results. 4096 samples were taken at approximately 250Hz and the results analysed in Excel with the built-in data analysis tools. First we have the raw data:

Raw sensor data

Here you can see that noise accounts for about 1-2% of the sensor reading. This is perfectly acceptable in this application and should cause no problems for the mouse. Probably half that would be quantisation noise from the ADC converter. The larger spikes are probably side effects of not having taken the trouble to write a ‘proper’ test program so there are several interrupt sources upsetting the timing. The spikes show, I think, periodic beating between the sample rate and the background interrupts. I should really eliminate that effect but…Next the results are arranged into a histogram. If the noise were purely random (Gaussian), you might expect a nice bell-shaped curve.

Histogram of sensor data sample

Well, that seems a bit odd at first sight. However, for this test I had arranged that there would be some incandescent lighting. As this is not very bright in the room where the tests were done, I placed the bench magnified over the test setup to concentrate the light from the overhead lamp onto the test area. With sinusoidal interference overlaid on the data, this is exacly the kind of result you might expect. The actual sensor reading is somewhere in between the peaks which are the result of the interference.Processing the data with a Fast Fourier Transform (FFT) should show up any periodic interference in the results.

FFT plot from the sensor data sample

Sure enough, there is a distinct peak at about 100Hz – exactly where you would expect it where there is incandescent ambient lighting in the UK. A quick check of the statistical analysis gives a standard deviation of about 2.8These tests were repeated with the wall at about 120mm from the sensor where the average sensor reading was around 100. Here the interference would be a larger portion of the result. Once again the standard deviation is about 2.5 but this now represents an error five times greater than before. You would, of course expect signal to noise ratio to worsen as the distance increases. Even so, maximum expected errors are still quite acceptable over the normal working range of the sensor. These sensors are normally used for steering over a quite restricted range of distances around 80mm or so.

Leave a Reply

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