Line Tracking Sensor From Sven Horstmann:

The following was reported by Sven: I wanted to build a robot that tracks a line without constantly jerking left-right-left, I tried a solution with a moving light-sensor, but that didn't work very good anyway.

So my next idea was a Robot with 3 light sensors, mounted side by side to the front of the robot, but that would consume all the ports of the RCX. So I started a little analysis on the input Ports of the RCX (with a scope and a multimeter, without taking anything apart, so I don't know if the real light sensor is constructed similar to mine), and now I have built a Prototype of a 3-channel light sensor, that needs only one input port of the RCX and also uses the internal power-supply provided by the RCX.

The interface consists only of a 6 diodes (1N4148), needed to compensate the fact, that a sensor can be connected in any direction to the port, and the polarity changes when turning the connector 90 degrees, and also to separate the supply power from the analog signal to be input to the RCX.

The line sensor has 3 phototransistors that provide 3 analog signals, these are threshholded by 3 comparators (they are in one case). The 3 (now digital) dark/bright-signals are then combined by 3 resistors (like in an example to combine multiple touch-sensors (by Paul Haas)) to form on analog signal, that is input to the RCX. By checking the range of the input-value, I can determine which of the phototransistors sees black or white. When these 3 sensors are mounted on the frontside of the robot, I can tell if there is a line and

The prototype still needs some fine tuning, so don't expect this to be the final version, but it can be an example of how to add new sensors to the RCX that need a power supply. After I found off-the-shelf components (up to now its build from stuff out of my electronics junkyard), I will provide a new circuit and maybe a PCB... (I found out that 3 of these old power consuming LEDs are a bit too much to handle for the power-supply, but with low current LEDs it will work better. Right now I'm using only two LEDs (unlike in the schematic).

Multiple extensions are possible: Instead of 3 phototransistors detecting a line, you could fit them with red, green and blue colour filters, provide light with a white LED and you would then have a colour recognizer. As you can switch the sensor-supply-power on and off by changing the sensortype (from light to temperature or push-sensor), you could use this to select 2 different input sources, without using an output port ! Or you trigger an external counter which selects one of n input sources.


Click Here to Return to the Main Page