View Full Version : has a question about the basic stamp program

03-16-2010, 11:33 PM
Photoresistor how to use this resistor to measure LUX
i only find the measure RC time program in parallax.com
what is the program

03-16-2010, 11:47 PM
You will have to calibrate the photresistor you have chosen against the number returned when it is connected to the Stamp and using the RCTIME command.

The Stamp is measuring only the effect of the resistor and the capaitor on the time it takes to charge/discharge.

You will have to give the Stamp a formula to convert from the RCTIME result to LUX. This can be done easily by borrowing a lightmeter and calibrating your Stamp circuit.

Tom Sisk


03-16-2010, 11:52 PM
But how can i get the formula

03-16-2010, 11:52 PM
But how can i get the formula

03-17-2010, 12:50 AM
You put your device under a light and read rctime. Then with a lightmeter calibrated in lux you write that number next to your rctime value. Do this for different light levels and you will end up with the data you need to create your formula.

- Stephen

03-17-2010, 04:50 AM
I'd start with the good ol' line formula:

Y= MX + B

You'd need two data readings, hopefully at the low end and one at the high end. Enter the numbers and find M and find B (if there is one, although in a perfect world B would be zero.)

If all the data points match up, or are close in between the two readings, then it's a linear relationship. If not, and you want more accuracy you'd proceed to other algebraic formula.

You might also find that at the extremes (Low and high end) the data is non-linear.

"puff"...... crap, there went another one.