Shop OBEX P1 Docs P2 Docs Learn Events
Visible light sensor for BS2 — Parallax Forums

Visible light sensor for BS2

QuorsavQuorsav Posts: 5
edited 2004-10-08 00:09 in BASIC Stamp
Hey, Does anybody know of an easy visible light sensor to interface with the BS2. Just something simple so it can tell if the lights in the room are on, or if its in a dark corner. It doesn't need need to be too sensitive.

Thanks, Q

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-07 22:25
    Hey, how about a simple photocell circuit? You can use a CdS photocell and a cap with the BASIC Stamp's RCTIME function to create a light-level monitor. It's dirt cheap, too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • QuorsavQuorsav Posts: 5
    edited 2004-10-07 23:03
    Yeah, that should work pretty good.

    I was also thinking of having a circuit that would simply plug a 0 or 1 into an input on the BS2. This would reduce the ammount of work my program needs to do and make things simpler.

    Does anyone have an novel ideas how to do this?· -Q
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-07 23:34
    Use a comparitor -- one input to it will be from a voltage divider formed by the photocell and a resistor, the other input will be the tap of a pot to set the threshold. The output will be 0 or 1.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • cyberbiotacyberbiota Posts: 79
    edited 2004-10-07 23:43
    A simple photodiode/phototransistor will give you a one or
    zero input into the stamp. ·You lose the ability to tweak
    the ambient light levels that the RCTime circuit provides,
    though. ·The RatShack has phototransistors (and CDS cells as
    well). ·Good luck.· P


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dr. Peter C. Charles

    Director, Research and Technology
    CyberBiota, Incorporated
    Peter.charles@cyberbiota.com
    http://www.cyberbiota.com
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-10-08 00:09
    I'd go with the PhotoTransistor myself...With it, and a resistor, you could get a 0 or 1 input.· As Peter said though, you can't control 'easily' the amount of light that trips it.· You'd have to find a happy medium on the resistor value for the pullup, and even that would be limited.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
Sign In or Register to comment.