Thursday, September 25, 2008

The Light Sensors

For the light sensors we initially decided on an IR Led and TSOP pair. My brother had worked with them for a line following robot so i called him up and he told me that IR Led's are very "moody" so to make them work we have to use TSOP 1738 (38 kHz) and a 555 oscillator circuit to generate the 38kHz wave.
The circuit was taken from the first link we got on Google searching "TSOP 1738". (can be seen on the right)

Next day in school it turned out that our sir had already worked with TSOP's (for a car alarm or something) and suggested we use two 555 oscillators. This, due to the fact that the TSOP 1738 doesn't detect a 38Khz signal but infact a "change" in it.
So the first 555 oscillator was to generate the 38Khz wave and the other to make a much bigger wave (as in wavelength).

Sir's schematic

This circuit obviously had a lot of chunks we did not need so the final circuit was divided into a receiver and a transmitter. (having fried an IC in the past week we kept things simple and tested the circuit by a putting a LED across the transistor)
.

We began making the light sensor on the bread board with vigor and after countless tries and misses the sensor finally started working at a decent range but
1) the circuit was no good in measuring distance (to make sure the mouse moved straight) it just told us wether there was a wall or not.
2) gave a discontinuous output (a pulse) which we realized posed a major problem
To check the value from the sensor we could no longer simply compare the value and check, the pulse could be read both as a 1 and a 0 by the microcontroller. To resolve this, we found two ways out- using interrupts in the microcontroller (of which the IC we were using only had 2) or using a circuit to convert the pulse into a continous signal.

Things looked good till Ankush had the marvelous idea of mailing one of our seniors, (who also had tried making the micromouse) Mohit Taneja. In his reply he suggested we use an IR Led and Phototransistor pair and an ADC (analog to digital converter) to sense distance. (He suggested quite a lot of stuff but maybe thats another post..).

We unanimously decided to junk the old circuit (who dare not heed the advice of mohit taneja?) and replace it with a new one which looks like the one on the right (we just replaced the 22oohm resistor with a variable one).

After checking the circuit on the bread board (and boy does she work smoothly) we have now made three of these light sensors and mounted them on an acrylic wheel.

Today, as Ankush mentions in his post, we tested them and tried to calibrate their readings.
We were successful in doing so with two sensors but the third one was showing an altogether different range of output values so i guess we'll use that one as the front sensor and the other two on the right and left.


The Readings (which Ankush hoped so much that I'll post)
The first column is for the distance from the light sensor (in cms). Notice how he jotted them down on the first thing he could lay his hands on.

No comments: