Max and Min of sensors


#1

I was wondering where I can find the max reading of sensors. I would like to specifically know the max of the light sensor. I saw the threshold but have no idea what the max rating is. I hope this is a simple question.

Greg


#2

Hi Greg:

For the three light sensors along the top front edge of Sparki: I looked at the Sparki schematic and it has a photo-transistor that pulls up a 47K-ohm resister to Vcc which is connected to an 8-channel analog mux for each sensor. The mux is a 10-bit A/D converter, so it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. It also says that the input range and resolution can be changed using analogReference(). I looked thru the Sparki.cpp code and didn’t find analogReference() being used. Therefore, the max range should be 0 to 1023. I would guess that the top end is a bit lower to compensate for the tiny forward voltage drop across the photo-transistor, but that should be negligible.

Putting my Sparki to the test, I can get a reading of 0 if I cover the photo-transistor completely with something black; so we’re good on the dark end. If I give it some high intensity light from a Cree Q3 LED putting out about 200 Lumens, I get an average of 1015 (high reading was 1020) So, that seems about right too.

For the infrared reflectance sensors (bottom of Sparki), I use a threshold of 600 to determine black from white. I usually get in the 100s or lower when Sparki is sitting on a black line and in the 900s when he is sitting on something white. The same 10-bit A/D reads these sensors, so the absolute min should be 0 and the absolute max should be 1023; however, I don’t think that the sensor themselves will push the voltages to 0 or Vcc (since they have an IR source built into them). Just a guess without looking at any part specs. Mine look like they can go down to about 4 (reflecting into a flat black surface at a distance) and as high as 990 (on a white glossy surface). These sensors are used for detection, so absolute and precise numbers are not really needed.

Steve