Shop OBEX P1 Docs P2 Docs Learn Events
has a question about the basic stamp program — Parallax Forums

has a question about the basic stamp program

boblai2010boblai2010 Posts: 18
edited 2010-03-16 21:50 in BASIC Stamp
Photoresistor how to use this resistor to measure LUX
i only find the measure RC time program in parallax.com
what is the program

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2010-03-16 16:47
    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

    http://www.siskconsult.com
    ·
  • boblai2010boblai2010 Posts: 18
    edited 2010-03-16 16:52
    But how can i get the formula
  • boblai2010boblai2010 Posts: 18
    edited 2010-03-16 16:52
    But how can i get the formula
  • FranklinFranklin Posts: 4,747
    edited 2010-03-16 17:50
    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
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-16 21:50
    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"...... Smile, there went another one.
Sign In or Register to comment.