Shop OBEX P1 Docs P2 Docs Learn Events
Light Sensor TSL230 Help — Parallax Forums

Light Sensor TSL230 Help

Tom PTom P Posts: 97
edited 2008-04-15 19:16 in BASIC Stamp
I would like to monitor six TSL230 light sensors and display them via Debug.
Some sort of program that steps through the different sensors
I would fix the sensivity and scalling to X10 via +/_ pins.
Can anyone help with a program to do this.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-15 15:49
    There's very little difference between monitoring 6 sensors and monitoring one sensor.
    The TSL230 has an output enable pin which you'd connect with a pullup resistor to an I/O pin.
    You can connect the other pins in parallel. To "step through" the sensors, you'd just initialize
    the six I/O pins to HIGH, then step through them setting one to LOW for the measurement,
    then setting it to HIGH again. It's easiest if the 6 I/O pins are sequential so you can do:
    FOR i = 0 TO 5
       LOW the1stPin+i
       ' measure level - use TSL230 example as model
       HIGH the1stPin+i
    NEXT
    
  • Tom PTom P Posts: 97
    edited 2008-04-15 18:48
    I would like to be able to scan all 6 sensors continuously.
    Will the above example do this?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-15 19:05
    You can only process one sensor at a time. The Stamp is a single-threaded processor and can only perform one function at a time. When it's counting the output pulses of a single TLS230, it can't do anything else. You would need some kind of external hardware to do the counting for all six or you would need to use a Propeller which has multiple processors (plus two independent counters in each processor). The Propeller is also fast enough to be able to count several sensors simultaneously using a single processor with assembly language.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-04-15 19:16
    Tom,

    This is a duplicate thread…You have already posted this at the link below. In the future, please follow up on your original thread rather than starting a new one. If not for replies I would have removed this one already.

    http://forums.parallax.com/showthread.php?p=718387

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.