Shop OBEX P1 Docs P2 Docs Learn Events
Photo Resistors — Parallax Forums

Photo Resistors

ArchiverArchiver Posts: 46,084
edited 2002-02-15 21:20 in General Discussion
For those of you who use or would like to use photo resistors but have
trouble with the RCTime function or dislike using it because of the extra
capacitor assembly here is an alterntive solution.

Tie one end of your photo resistor to ground (I use the Parallax PRs) and the
other end to 5 VDC through a 470 ohm resistor. Take the 470/PR junction to
an ADC input. Using a TLC2543 ADC - 12-bit - and with the PR about 30 inches
from my lamp I get raw readings of about 1800 unshaded and about 4000 with
the PR covered. This disparity is more than enough to give an excellent
control range. I write

if AD0 < 2000 then LEDoff
if AD0 > 3000 then LEDOn

If you can turn an LED off or on, then you can close a relay, open a door,
bake a cake or whatever. I strongly recommend the TLC2543 - it is 12-bit,
11-channel and easy to program. With 11 channels you can monitor 11
locations or events with only 4 I/O lines, and that's a pretty good I/O
utilization. Keep your programming as clean as possible to reduce overhead
and improve the ADC- driven response. No more capacitors, nor calculating RC
times.

Thought you might be interested.

Sid - W4EKQ

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-02-15 21:01
    What is the price of that chip and where I can get one?
    Original Message
    From: <Newzed@a...>
    To: <basicstamps@yahoogroups.com>
    Cc: <JonWms@a...>
    Sent: Friday, February 15, 2002 3:39 PM
    Subject: [noparse][[/noparse]basicstamps] Photo Resistors


    > For those of you who use or would like to use photo resistors but have
    > trouble with the RCTime function or dislike using it because of the extra
    > capacitor assembly here is an alterntive solution.
    >
    > Tie one end of your photo resistor to ground (I use the Parallax PRs) and
    the
    > other end to 5 VDC through a 470 ohm resistor. Take the 470/PR junction
    to
    > an ADC input. Using a TLC2543 ADC - 12-bit - and with the PR about 30
    inches
    > from my lamp I get raw readings of about 1800 unshaded and about 4000 with
    > the PR covered. This disparity is more than enough to give an excellent
    > control range. I write
    >
    > if AD0 < 2000 then LEDoff
    > if AD0 > 3000 then LEDOn
    >
    > If you can turn an LED off or on, then you can close a relay, open a door,
    > bake a cake or whatever. I strongly recommend the TLC2543 - it is 12-bit,
    > 11-channel and easy to program. With 11 channels you can monitor 11
    > locations or events with only 4 I/O lines, and that's a pretty good I/O
    > utilization. Keep your programming as clean as possible to reduce
    overhead
    > and improve the ADC- driven response. No more capacitors, nor calculating
    RC
    > times.
    >
    > Thought you might be interested.
    >
    > Sid - W4EKQ
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-02-15 21:06
    For Tad

    You can get them from Digikey. Price is about $7.50, which is much less than
    a 2- or 4-channel.

    Sid
  • ArchiverArchiver Posts: 46,084
    edited 2002-02-15 21:17
    Maybe I'm being stupid here, but why can't you just build a voltage
    divider such that the photoresistor pin reads high on off and low on on
    (or ther other way around)... that's what I did, it didn't require ADC or
    anything, just resistors and a cds photocell.



    On Fri, 15 Feb 2002, tad heckaman.com wrote:

    > What is the price of that chip and where I can get one?
    >
    Original Message
    > From: <Newzed@a...>
    > To: <basicstamps@yahoogroups.com>
    > Cc: <JonWms@a...>
    > Sent: Friday, February 15, 2002 3:39 PM
    > Subject: [noparse][[/noparse]basicstamps] Photo Resistors
    >
    >
    > > For those of you who use or would like to use photo resistors but have
    > > trouble with the RCTime function or dislike using it because of the extra
    > > capacitor assembly here is an alterntive solution.
    > >
    > > Tie one end of your photo resistor to ground (I use the Parallax PRs) and
    > the
    > > other end to 5 VDC through a 470 ohm resistor. Take the 470/PR junction
    > to
    > > an ADC input. Using a TLC2543 ADC - 12-bit - and with the PR about 30
    > inches
    > > from my lamp I get raw readings of about 1800 unshaded and about 4000 with
    > > the PR covered. This disparity is more than enough to give an excellent
    > > control range. I write
    > >
    > > if AD0 < 2000 then LEDoff
    > > if AD0 > 3000 then LEDOn
    > >
    > > If you can turn an LED off or on, then you can close a relay, open a door,
    > > bake a cake or whatever. I strongly recommend the TLC2543 - it is 12-bit,
    > > 11-channel and easy to program. With 11 channels you can monitor 11
    > > locations or events with only 4 I/O lines, and that's a pretty good I/O
    > > utilization. Keep your programming as clean as possible to reduce
    > overhead
    > > and improve the ADC- driven response. No more capacitors, nor calculating
    > RC
    > > times.
    > >
    > > Thought you might be interested.
    > >
    > > Sid - W4EKQ
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >

    Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc. (ServNet)
    Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma - Bremerton
    email: lamont@a... WWW: http://www.serv.net
    "...There's no moral, it's just a lot of stuff that happens". - H. Simpson
  • ArchiverArchiver Posts: 46,084
    edited 2002-02-15 21:20
    For Lamont

    What you say is true but can you control a relay or a motor with it?

    Sid
Sign In or Register to comment.