Shop OBEX P1 Docs P2 Docs Learn Events
i need help triggering bs2 w/ outside circuit — Parallax Forums

i need help triggering bs2 w/ outside circuit

MubotMubot Posts: 13
edited 2008-01-18 04:10 in BASIC Stamp
Hi guys... having a bit of trouble here..

i created a circuit thats basically a light/dark detector, it uses an LDR (cds cell) and a voltage comparator ... the output voltage is 1.37 when low and 1.53 when high ..... im trying to get it to set a bs2 pin to mimic the state of the external circuit....
i.e when i pass my hand over the photocell the circuit goes high and sets the bs2 pin to high

i just cant get the bs2 to correspond! -- shouldnt i just be able to connect my (+) output of the circuit straight to a pin and have it work?

the circuit is being powered by the bs2 and when im checking with a meter the output is well within the 1.4v trigger point.

HELP??? what am i missing?

Post Edited (Mubot) : 1/18/2008 3:01:44 AM GMT

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-01-18 02:32
    The output of a comparator is +V or GND.

    Any possibility of your uploading your schematic?
  • MubotMubot Posts: 13
    edited 2008-01-18 02:38
    it's based on this schem.

    im only using 6v and i have added resistors to the comparators output to read 1.37 when low and 1.53 when high ... thats the path im sending to the bs2 pin

    PhotoBasicCell.GIF

    Post Edited (Mubot) : 1/18/2008 3:10:34 AM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-01-18 03:10
    Let's have the circuit and the Stamp at the same potential (5V).·

    You cannot have the series LED and the Stamp pin together.

    The output is either +5V or GND (see pic attached, it's yours with some modifications.)·

    When the voltage across the photocell is greater than the threshold (2.5V), then the output goes to Ground (Vss.)· Otherwise it should be "at supply", 5V.

    Post Edit -- Thought to mention that you can do "photocelly" things using RCTIME, too.

    Post Edited (PJ Allen) : 1/18/2008 3:20:46 AM GMT
    410 x 327 - 19K
  • MubotMubot Posts: 13
    edited 2008-01-18 03:36
    DUDE.. IT WORKED!

    why was the LED causing a problem?

    i didnt use the rctime thingy cuz i thought it might be too slow ... this particular set up is just about instant.

    thanks sooo much 4 your help
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-01-18 03:58
    The forward voltage drop through the LED may have been enough to keep the Stamp input from rising far enough to register as a high. The attached circuit shows a way to drive an LED from a pulled-up output such that the output pin rises all the way to +5V when not being pulled low.

    -Phil
    313 x 340 - 2K
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-01-18 04:00
    Mubot -

    If I understand this correctly, the one voltage was too low to represent a logical 1 which needs to be over 2.5 VDC (if I remember correctly). Now it's set to show 0 or +5 VDC which is plenty of difference, and above the 2.5 VDC minimum for a logical 1.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Veni, Vidi, Velcro! - I came, I saw, I stuck around!
  • MubotMubot Posts: 13
    edited 2008-01-18 04:10
    Bruce Bates said...
    Mubot -

    If I understand this correctly, the one voltage was too low to represent a logical 1 which needs to be over 2.5 VDC (if I remember correctly). Now it's set to show 0 or +5 VDC which is plenty of difference, and above the 2.5 VDC minimum for a logical 1.

    Regards,

    Bruce Bates

    that make total sense .... but in all the reading i have done it says that the threshold is 1.4 volts over or under will trigger ???

    im pretty much a figure it out as i go...not knowing much electronics guy...so i VERY much appreciate all the help guys!
Sign In or Register to comment.