Floor Sensor Boards For Line Mazes

(article continued from previous page)

The All-Right robot solves orthogonal perfect line mazes. A line maze does not have walls. Instead, it is made of taped lines or painted tiles on the floor.

Although it is possible for a robot to solve a maze with fewer sensors, this particular robot has nine photoreflective sensors beneath its base.

The underside of a maze-solving robot showing five circuit boards.

The underside of a maze-solving robot showing five circuit boards.

The previous page describes a 74LV4051 multiplexer circuit that connects to the sensors using ribbon cables. The ribbon cables can be seen coming through a central hole in the robot’s base. The cables attach to the following PCBs:

Having sensors positioned top, bottom, left, and right allows the robot to be stateless in detecting intersections. That is, the robot doesn’t need to remember lines as it passes over them. Instead, it knows it is at a four-way intersection (for example) when the top, bottom, left, and right sensors all detect a line simultaneously.

Triple floor-sensor board with three phototransistor light sensors.

Triple floor-sensor board with three phototransistor light sensors.

Four of the five circuit boards have ribbon cables leading to them. Each of these boards include:

It is possible to use photodiodes instead of phototransistors (or other amplified light sensors), but a photodiode’s signal tends to be weak enough that motor noise can skew the data. It is also possible to use photoresistors, although they react relatively slowly to changes in light (see pages 368-379 of Intermediate Robot Building). Photoresistors would limit the maximum speed that the robot could drive in a line maze.

Floor-sensor board underside contains SMT components and washers.

Floor-sensor board underside contains SMT components and washers.

The floor-sensor boards are slightly more complicated than they appear on the surface. There are surface-mount components (tiny capacitors and resistors) on the other side of the board.

Similar to most circuit boards, a washer or a spacer is needed to keep the board flat when it is fastened in place. If the spacer wasn’t present, the small components or pointy solder points would result in a tilted board. The spacer also takes the force of the screw, such that overtightening won’t bend the board or crush an electronic part.

It is critical that the floor sensor boards are flat and are a consistent distance from the surface they are measuring. The amount of reflected light varies based on the distance to the target. A tilted board would make one sensor appear brighter than another sensor on the same board. A board that was too far away from the floor would cause the robot to miss a bright line, as the robot would interpret the dimness as a dark surface.

Extra infrared reflective floor sensor.

Extra infrared reflective floor sensor.

The itty-bitty black rectangular chip with four pins and two domes is a classic infrared reflective-pair light sensor. One dome is the emitter and the other dome is the photosensor. These types of photodetectors are readily available and conveniently small.

A slight problem with these types of sensors is that that can’t see very far. This is because the small size of the emitter means it doesn’t produce significant light. To compensate, this board has been screwed onto a taller spacer (the white cylinder). Notice how much further out the green board is compared to the yellow boards nearby.

The reason that this extra floor-sensor board was added to the robot is to detect the end of the maze. In the ChiBots line-maze competition, the end is marked with a giant white circle. There is a time-bonus awarded for stopping at the end point and showboating.

When the robot detects a line under all four sides (top, bottom, left, and right) and under the extra sensor, then the robot must be inside the circle at the end of the maze. Without this extra sensor, the robot would need to rotate a little bit every time it passed over a four-way intersection to determine if it was an intersection or a complete circle.

Watch closely at the end of the maze-solving movie at the bottom of the next page of this article. The robot signals successful completion by spinning around several times.