One of the major issues in designing a Micromouse is finding inexpensive and reliable sensors.
The test setup uses an Arduino Duemilanove with an atmega328P running at 5Vdc and 16MHz. Unless noted, the ADC uses the internal reference voltage for conversion. A button is implemented to allow orderly capture of samples. Pushing the button tells the Arduino to capture 1000 samples.
I picked the Arduino for testing for two reasons.
The Sharp GP2D120X is an IR sensor that calculates the distance from the sensor to the target using trigonometry.
Figure 1: 0-6” response for the GP2D120X
Figure 2: 0-8” response for the GP2D120X
Both Figure 1 and 2 show that between 0”<d<1”, and 1”⇐d<8”the GP2D120X have the same range of ADC values namely, [0, 700]. For use in most Micromouse designs, the minimum usable range is 1” from the sensor. Although it is possible to create a software method to overcome the minimum range problem, the probability of an error is very high and the impact of an error is very high. The actual error ends up being an inversion of the software's perception of the distance from the sensor to the wall. Also, notice the noise floor is very high in both figures.
The noise can be minimized by using an averaging filter. On the 2009 tank design, we found that a double 10 point moving averaging filter was able to clean up the noise to an acceptable level.
The figures were generated with MATLAB. The data was gathered with Arduino (atmega328 series), on a 5V ADC reference. The GP2D120x was powered with 5Vdc with a 100uF bypass capacitor on the 5Vdc rail. The software polls the ADC 1000 times and reports the value via the serial port at 115200 baud. The code is built on the Arduino libraries.
The Sharp GP2Y0D810Z0F is a digital distance sensor. It returns a HIGH or LOW value if the distance from the sensor to the wall is within a defined range. The sensor is an active low device, meaning that it will return a LOW value for TRUE and a HIGH value for FALSE.
Figures 3 and 4 both show that the sensor works very well in the 1-4” range. Figure 3 shows that the range is usable down to 0.6”. The sensor shows no resolution between 0.6” and 4.0”, outside of the LOW value. This limits the sensor's usefulness in the Micrmouse context because the sensor is really only useful for determining if there a wall in front of the Micromouse.
The test setup used a GP2Y0D810Z0F mounted a breakout board sold by Pololu. The breakout was stuck into a breadboard and a 100uF bypass cap was place on the 5Vdc power supply rail. An Arduino was used to poll the sensor 1000 times and relay the reading to a computer via the RS232 port at 115200 Baud. The plots were generated with MATLAB.
The analog Sparkfun QRE1113 Line Sensor Breakout is an IR reflectance sensor. It is different from the Sharp sensors above in that it is directly measuring the quantity of light reflected by the wall with a photo-transistor.
Figure 6 shows that an unmodified sensor has a fairly small dynamic range, around 400 ticks on the atmega328's built-in ADC. This is about half of what the Sharp GP2D120X's dynamic range is. Looking at Figure 5, the noise figures are reasonable, with the magnitude of the noise being less than ±3 ticks. The noise figure breaks down, however, when the wall is at a 45º angle to the sensor.
The test setup used a QRE1113 mounted a breakout board with support circuitry sold by Sparkfun. The breakout was stuck into a breadboard and a 100uF bypass cap was place on the 5Vdc power supply rail. An Arduino was used to poll the sensor 1000 times and relay the reading to a computer via the RS232 port at 115200 Baud. The plots were generated with MATLAB.
LPC2148 Pin Assignments Signal Name Port Pin Function Notes -------------------------------------------------------------- EncoderLeft1 P0.30 CAP0.0 EncoderLeft2 P0.29 CAP0.3 EncoderRight1 P0.28 CAP0.2 EncoderRight2 P0.4 CAP0.1 LeftDir1 P1.22 GPIO:output LeftDir2 P1.23 GPIO:output RightDir1 RightDir2 P1.21 GPIO:output LeftPWM P0.0 PWM1 RightPWM P0.1 PWM3 LeftFront P0.13 AD1.4 LeftRear P0.12 AD1.3 RightFront P0.21 AD1.6 RightRear P0.22 AD1.7 Front P0.6 AD1.0