Sensors and shiny maze walls.

By | April 19, 2010

Among the various thing you will hear said by contestants at a micromouse contest, the topic of walls will frequently come up. Generally in some disparaging way that indicates that the walls are in some sense to blame for their misfortune. I have certainly said so more than once but what effect do shiny walls have?

Today, I decided to do some experiments and find out. The idea was to test a couple of sensor types and different walls to see what the effect of angle alone had on the sensor response for each wall type. The results were a bit surprising.

The test setup is shown below:

Walls are placed on a rotary table so that the front surface was exactly over the center of rotation. They were kept aligned with the help of magnets on the surface of the table which also served to hold down a disk of black card to represent the maze floor. In this way, reflections from the floor should be reduced. The rotary table can be turned by repeatable amounts as small as 1/6 of a degree if necessary.

The emitter under test was placed on a solderless breadboard and connected up exactly as it might be in a micromouse. In this case, that meant it was connected in series with a 5.6Ohm resistor to the 5V supply and switched on an off through a ULN 2803 darlington.

The emitter pulses are generated by an arduino board. The timing is non-critical but consistent so that the results can all be compared. For each reading, the sensor was read 32 times and averaged before the reading was sent to the computer for entry into a spreadsheet and subsequent graphing. Sensor readings are the difference between the sensor value without the emitter and the value with the emitter to eliminate the effect of ambient light.

Once set up, readings are taken every 2.5 degrees and plotted on a graph over the range 60 to 120 degrees. That is, with the emitter +/- 30 degrees from perpendicular. Moderate care was taken to try and get the emitter reasonably perpendicular to the wall in all directions. This could (and should) have been done better. The emitter light pattern was arranged to be, as much as possible, centered over the center of rotation of the wall. With these precautions taken, the average distance from the emitter to the wall would remain constant at 60mm. the detector was placed to one side of the emitter. It would have been better if it had been directly above or below.

The test wall set included

  • a wall with the face covered by a piece of white laser printer paper to provide a flat, non-specular reflection that should be very uniform cross its surface.
  • A standard Korean plastic wall as used in many mazes. this was arranged so tha the emitter illuminated the wall half way between the dips in the surface caused by shrinkage over the internal webs.
  • A new Taiwanese plastic wall since these are visibly very shiny.
  • An old, melamine-covered wall with a smooth surface which does not appear very shiny.


So, what did the results look like:

First we have a SFH409 IR LED. It has a peak emission at 950nm and is well matched to the TSL252 used as a detector. Beamwidth according to the data sheet is +/- 20 degrees – very wide. Here are the response curves:

As expected, the paper surface gives the smoothest response. it is clear that the emitter was not well positioned with respect to the 90 degree angle but it was left untouched so all the curves were directly comparable. The Korean walls were the least reflective. Melamine gave a good response which varied smoothly with angle. Both the Taiwanese and the Korean walls gave an uneven response. this is no simple artifact and was repeatable. The polar emission graph of the SFH409 gives a clue:

Here you can see that the emitted light is not even and the slope of the polar chart drops off at about +/- 10 degrees. This corresponds roughly to the pattern seen in the response curves. The shinier Taiwanese walls enhance this effect.

Next, I tried a SFH4503. These are a powerful emitter that I use in my current mice. They have a much narrower beam angle. According to the data sheet, this is +/- 4 degrees. Here are the results:

This time I had the emitter pointing slightly off axis in the other direction. No matter. The vertical scale shows just how much more light is being put out by these emitters compared to the SFH409. More light means better signal-to-noise so that is good. Again, the paper surface has the smoothest response. However, see now the effect of shininess. First, there is a very marked peak in the response on shiny walls with the Taiwanese being most affected. A change in the angle of incidence by only 5 degrees could cause a change in response of 25%. No wonder I sometimes struggle with my forward sensors. These are pointed right at the wall and it would not take much of an angular error to make their readings nonsense. You will also see that the shape of the response is not good with two distinct peaks appearing at about 10 degrees off axis with the Taiwan walls. So, even if I had the sensors angled, I would still suffer from apparent distance changes cause by small angular changes. The polar diagram for the SHF4503 looks like this:

You can clearly see the additional lobes in the response at 10 degrees. When viewed with an IR camera this shows as an annular ring of light around the central spot.

OK – so what about a laser. These have a clearly defined spot of light and we can easily see it so what could be bad? The laser in this test was a random 5mW module found on eBay. It it driven using the exact same circuit as the LEDs. Here is its response:

For this test an TSL252 was used as the detector since the TSL262 has a daylight filter to exclude visible light. Apart from that, I believe they are identical devices. Although visibly bright, rather smaller readings come back using the laser. Here you can see that the small spot of the laser seems to accentuate the specular effect of shiny surfaces. That is, the amount of light reflected close to perpendicular is much greater than when off-axis. Now my first thought was that this is just due to the shininess of the surface but it is apparent that the effect is much less with a shiny Taiwanese wall than it is with a relatively dull melamine wall.


Some time ago, I was reading about laser target designators. That text spoke of guided munitions having to be within the ‘cone’ of laser light reflected from the target before they could successfully home in on the target. So, consider a surface that is all specular – light a mirror. The reflected light from that is all specular and consists of the original beam leaving at the angle of incidence. You would have to be directly in line with that to see it at all but then it would be very bright. A less shiny surface will have most of the light behave like the mirror but a small amount will be reflected in a diffuse manner. However, being shiny the cone of diffuse reflection will be very narrow and mostly along the axis of the reflected beam. So, when the beam is reflected back close to the detector, there will be the spike we see from the Taiwanese walls but, because the surface is more shiny, the spike will be small and narrow because we are not very close to the axis of the reflected bean and not much energy goes into the cone. Paradoxically then, surfaces that are still shiny but which have a greater diffuse component have a wider cone of diffusely reflected light making it more likely that the detector sees it. Thus we see a wider and larger response. Paper, having essentially no specular component to its reflection gives a suitably smooth, even response.

What can we conclude?

Well, it would be nice if contest maze walls were all faced with printer paper but I don’t suppose that will happen.

First, lasers are attractive but I think great care needs to be taken to ensure they are not used anywhere near perpendicular to a wall surface. This might be tricky to arrange but an angle of, say, 30 degrees should be fairly safe in keeping the beam at least 15 degrees off perpendicular for all surfaces. Forward facing sensors are tricky though and might need considerably more cunning to keep them reliable.

IR emitters (or visible light for that matter) need more care than I had suspected. Having chosen the SFH4503 for its narrow beam and high output, I had not considered the effect of the secondary lobes with shiny walls. Although I was aware there could be an issue with specular reflection, I had not thought it might be so large. Looking at the results for the SFH409, it might be better to choose an emitter with a wider beam rather than a narrower one. Perhaps +/- 10 degrees and no (or minimal) sidelobes.

A quick look at the OPE5594A favoured by Ng Beng Kiat shows it to have exactly those characteristics. So, let’s give that a go:

Pretty good. In fact these are about what I would have hoped for in the first place. Perhaps it is not such a bad thing that the SFH4503 is no longer available. Time to hit the datasheets to see what else might be suitable.


6 thoughts on “Sensors and shiny maze walls.

  1. Kartik Mohta

    Clearly shows the difference a good emitter makes. 🙂

    But, is using lasers really a good idea? The emission angle is almost zero, so you get a very small patch of light on the wall leading to the very small detector values.

  2. peteh

    It is possible to get larger responses by increasing the brightness, and the small light spot increases the accuracy of the edge detection.

    I think the effects of specular reflection are just too great to make them reliable as a general purpose sensor emitter.

  3. Marios

    Kato used lasers on one of his mice.I think it was called ‘aero’. He also continues to use a very low angle IR’s. I think he’s using the SFH4550 led(3 degrees half angle).

    I did a similar test like you Peteh and i use the OPE5594A at the moment(its very good) but i will test the SFH4550 along with the TPS601 receiver just out of curiosity.

  4. Pranjal Chaubey

    Thanks for putting up the results of your analysis Peter….you save us a lot of time and effort! 🙂 😀

    When we had a micromouse competition in our college two years back, we actually used printer A4 sheets because the white paint was not good enough! Maybe, they should think of tweaking the maze design rules a bit. 🙂

  5. Anonymous

    Where can I buy OPE5594A, SFH4550 and TPS601. Not having to much luck finding them on the web..

  6. peteh

    It rather depends what country you are in. I buy pretty much only what I can find at Farnell in the UK.

    TPS601 are very hard to find outside of S.E Asia it seems.

Leave a Reply

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