Shop OBEX P1 Docs P2 Docs Learn Events
How to connect an open collector output to bs1 Input — Parallax Forums

How to connect an open collector output to bs1 Input

PeterHPeterH Posts: 21
edited 2009-12-14 14:31 in BASIC Stamp
Hi there ,

I have an Autonic photoelectric sensor with an 12V Open Collector output (either NPN or PNP) that I would like to connect to a BS1. I guess that I can’t connect it directly to a PIN on then BS1. One solution would be to put a mechanical relay in between, but I am not to keen on that since it will be switching several hundred times every day. I was wondering if I could connect a transistor between the PIN and ground and have the Photo sensor output connected to the Base of the transistor?

Would this work and which transistor would you recommend or is there a better way?

/PeterH

the data sheet for the sensor can be seen here http://www.autonics.com/upload/data/K-15~16(BA).pdf

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-12-13 21:35
    You could pull the Autonic output up to 12V with a 22K resistor.· Then connect the junction of 22K and Autonic output to the BS1 input pin as some will rush to advocate.

    I'd stuff in some extra components because I'm part of the nefarious circuitry cabal (see attached.)

    Post Edit -- Hey, I show the same GND symbol on the Autonic and Stamp, but they don't have to be common (if that's not desired.)

    Post Edited (PJ Allen) : 12/13/2009 11:45:29 PM GMT
    431 x 300 - 12K
  • LeonLeon Posts: 7,620
    edited 2009-12-13 21:41
    Use a pull-up resistor to 12V and a voltage divider?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-12-13 23:48
    With the one resistor it's the·clamping-diode dodge,·like with·the direct-to-RS232 interface.·
    [noparse][[/noparse]We all know how obscenely expensive resistors are.]

    I don't like it, because now it's 12V, but then it'll 24V and next week...

    Post Edit --
    I like mine because if things change and you biff the opto it's no big deal.

    Post Edited (PJ Allen) : 12/13/2009 11:53:59 PM GMT
  • PeterHPeterH Posts: 21
    edited 2009-12-14 14:31
    Thanks ! I will try fiddling with it during Christmas

    /PeterH
Sign In or Register to comment.