Shop OBEX P1 Docs P2 Docs Learn Events
Proximity sensors and the Stamp — Parallax Forums

Proximity sensors and the Stamp

ArchiverArchiver Posts: 46,084
edited 2003-02-16 23:15 in General Discussion
I have two NPN prox sensors that are 10-30 vdc and need to interface
them to the stamp. I will be using 12 vdc to drive the prox's and a
LED/resister combo for the load(proximity sensors have to have a load
to work I guess). Questions; for the stamp to see when the prox is
tripped could I use the other side of the load(and then through the
NPN)for a path to ground? Will I have problems combining
-5v and -12v? Any help would be appreciated.
Ian

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-02-16 19:40
    In a message dated 2/16/2003 10:43:43 AM Pacific Standard Time,
    iphillips@s... writes:

    > I have two NPN prox sensors that are 10-30 vdc and need to interface
    > them to the stamp. I will be using 12 vdc to drive the prox's and a
    > LED/resister combo for the load(proximity sensors have to have a load
    > to work I guess). Questions; for the stamp to see when the prox is
    > tripped could I use the other side of the load (and then through the
    > NPN)for a path to ground? Will I have problems combining
    > -5v and -12v? Any help would be appreciated.
    > Ian
    >

    Regarding the "load" for your sensor. The sensor likely has an NPN open
    collector output. This means that the collector of the NPN transistor is not
    tied to anything. A user typically will tie the collector to +5 volts through
    5k to 10K ohms. Therefore, when the NPN transistor is completely off, the
    collector will be at 5 volts. When the NPN transistor is in saturation, the
    collector will be at 0 volts (0.2 or so). This gives the user a logic 1 and
    0 respectively.

    Depends greatly on the sensor used. Many have an analogue output, while
    others have a digital output.
    If you have an analogue output, you may need to tie the collector of the NPN
    side to the input of a comparator. The reference input to the comparator is
    tied to a voltage level that you must determine experimentally. To determine
    the reference voltage level, do the following.
    Watch the output (collector) of the NPN device verses the distance
    (proximity). This will give you the value for your reference voltage to the
    comparator.
    The output of the comparator can be wired in such a way to give you a logic 1
    or a logic 0, something the stamp can easily interpret.

    Enjoy. There are lots of good hardware guys that reply to this forum and will
    likely give you alternate methods to achieve your desired results.

    Ken


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-16 19:41
    In a message dated 2/16/2003 10:43:43 AM Pacific Standard Time,
    iphillips@s... writes:

    > I have two NPN prox sensors that are 10-30 vdc and need to interface
    > them to the stamp. I will be using 12 vdc to drive the prox's and a
    > LED/resister combo for the load(proximity sensors have to have a load
    > to work I guess). Questions; for the stamp to see when the prox is
    > tripped could I use the other side of the load(and then through the
    > NPN)for a path to ground? Will I have problems combining
    > -5v and -12v? Any help would be appreciated.
    > Ian
    >

    What brand and manf# sensors are you using?


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-16 19:50
    In the usual way things work out for me I have two different types. 1 -
    An Omron E2E2-X5C1 ($95 CND). 2- ACI LCM1-1206P-ARU4 NPN N.O. 200ma max
    ($50 CND). By the time I found the second my boss had already ordered
    the first. Oh well.
    Ian

    Original Message
    From: smartdim@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=CrUOfoQxhJTJHUK5CWmdyyR--pRdQogBgcLrlw-KYcJxUoiYnFbLKG3eptkjJpiDOkQ5E8SBKg]smartdim@a...[/url
    Sent: February 16, 2003 2:42 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Proximity sensors and the Stamp

    In a message dated 2/16/2003 10:43:43 AM Pacific Standard Time,
    iphillips@s... writes:

    > I have two NPN prox sensors that are 10-30 vdc and need to interface
    > them to the stamp. I will be using 12 vdc to drive the prox's and a
    > LED/resister combo for the load(proximity sensors have to have a load
    > to work I guess). Questions; for the stamp to see when the prox is
    > tripped could I use the other side of the load(and then through the
    > NPN)for a path to ground? Will I have problems combining
    > -5v and -12v? Any help would be appreciated.
    > Ian
    >

    What brand and manf# sensors are you using?


    [noparse][[/noparse]Non-text portions of this message have been removed]


    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 2003-02-16 21:20
    Does the sensor just turn on and off when something is detected, or does it
    output a voltage depending on the distance of the item detected? If it
    simply is on or off, I would use an opto-isolator to interface it with the
    Stamp -- less risk of hosing the Stamp with 12 volts.

    Original Message

    > I have two NPN prox sensors that are 10-30 vdc and need to interface
    > them to the stamp. I will be using 12 vdc to drive the prox's and a
    > LED/resister combo for the load(proximity sensors have to have a load
    > to work I guess). Questions; for the stamp to see when the prox is
    > tripped could I use the other side of the load(and then through the
    > NPN)for a path to ground? Will I have problems combining
    > -5v and -12v? Any help would be appreciated.
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-16 21:41
    In a message dated 2/16/2003 11:50:02 AM Pacific Standard Time,
    iphillips@s... writes:

    > In the usual way things work out for me I have two different types. 1 -
    > An Omron E2E2-X5C1 ($95 CND). 2- ACI LCM1-1206P-ARU4 NPN N.O. 200ma max
    > ($50 CND). By the time I found the second my boss had already ordered
    > the first. Oh well.
    > Ian
    >
    >
    Here is a link to the sensor you have. It shows the load connected from the
    black wire to the brown wire. If you wire it like this, just as dweasal
    mentioned, you will want to use an opto isolator so you don't cook your
    stampl

    However, that is an extra 6 pins (6pin dip package) you need to deal with for
    the opto isolator.
    Another approach with less pin count is to connect the load between the brown
    wire and +5 volts. And the brown wire also goes to the stamp. You will get a
    logic 1 and 0.

    Is is necessary to use an LED in your load? If you do use an LED in your
    load this arrangement may not work. It may not give you a logic 1. The reason
    is as follows:
    When the LED circuit has no current going through it, it is extreemly high
    impeadance, somewhere about 7 meg. If the input circuit of the stamp is not
    alot greater than 7 meg, you will not get a logic 1 when there is no current
    going through the LED. If you must have the LED (assuming you need a visual
    indication of detection) use the opto isolater suggested by dweasel. If you
    need more detail on either hook up, write back.

    Ken
    <A
    HREF="http://oeiwcsnts1.omron.com/pdfcatal.nsf/PDFLookUpByUniqueID/A0C26A2BE4F15\
    19186256B0500500C8D/$FILE/D06E2E23WireDC1101.pdf
    ">
    http://oeiwcsnts1.omron.com/pdfcatal.nsf/PDFLookUpByUniqueID/A0C26A2BE4F151918

    6256B0500500C8D/$FILE/D06E2E23WireDC1101.pdf</A>


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-16 21:59
    That's the right one alright. So, I attach one side of the load to the
    Brown(+12v) and the other to +5v? The only thing that I am a little
    confused about is how the stamp will read this with +12v going to it. I
    was looking at it as just a simple pull up switch situation. Not the
    case?

    Original Message
    From: smartdim@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Obg0yd_QgRssC2XWHBfAB-5TXQbP0Z23Qm2xqw86Iw7PbfAZ4Pzuo4L6apBw37Bm1XRr3M5KiP_EXwQ]smartdim@a...[/url
    Sent: February 16, 2003 4:41 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Proximity sensors and the Stamp

    In a message dated 2/16/2003 11:50:02 AM Pacific Standard Time,
    iphillips@s... writes:

    > In the usual way things work out for me I have two different types. 1
    -
    > An Omron E2E2-X5C1 ($95 CND). 2- ACI LCM1-1206P-ARU4 NPN N.O. 200ma
    max
    > ($50 CND). By the time I found the second my boss had already ordered
    > the first. Oh well.
    > Ian
    >
    >
    Here is a link to the sensor you have. It shows the load connected from
    the
    black wire to the brown wire. If you wire it like this, just as dweasal
    mentioned, you will want to use an opto isolator so you don't cook your
    stampl

    However, that is an extra 6 pins (6pin dip package) you need to deal
    with for
    the opto isolator.
    Another approach with less pin count is to connect the load between the
    brown
    wire and +5 volts. And the brown wire also goes to the stamp. You will
    get a
    logic 1 and 0.

    Is is necessary to use an LED in your load? If you do use an LED in
    your
    load this arrangement may not work. It may not give you a logic 1. The
    reason
    is as follows:
    When the LED circuit has no current going through it, it is extreemly
    high
    impeadance, somewhere about 7 meg. If the input circuit of the stamp is
    not
    alot greater than 7 meg, you will not get a logic 1 when there is no
    current
    going through the LED. If you must have the LED (assuming you need a
    visual
    indication of detection) use the opto isolater suggested by dweasel. If
    you
    need more detail on either hook up, write back.

    Ken
    <A
    HREF="http://oeiwcsnts1.omron.com/pdfcatal.nsf/PDFLookUpByUniqueID/A0C26
    A2BE4F1519186256B0500500C8D/$FILE/D06E2E23WireDC1101.pdf">
    http://oeiwcsnts1.omron.com/pdfcatal.nsf/PDFLookUpByUniqueID/A0C26A2BE4F
    151918

    6256B0500500C8D/$FILE/D06E2E23WireDC1101.pdf</A>


    [noparse][[/noparse]Non-text portions of this message have been removed]


    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 2003-02-16 22:19
    In a message dated 2/16/2003 1:58:35 PM Pacific Standard Time,
    iphillips@s... writes:

    > That's the right one alright. So, I attach one side of the load to the
    > Brown(+12v) and the other to +5v? The only thing that I am a little
    > confused about is how the stamp will read this with +12v going to it. I
    > was looking at it as just a simple pull up switch situation. Not the
    > case?
    >

    Not quite......

    The diagram shows the load connected as follows....one side of the load is
    connected to the black wire, the other side of the load is connected to the
    +12 volt wire...this condition will give you either +12 on the black wire, or
    0 volts on the black wire. +12 volts to the stamp input pin is VERY BAD.

    Instead of connecting the other side of the load to +12, connect it to a +5
    volt source.
    The load is not connected to the +12 in any way shape or form.

    So, you should end up with one end of the load connected to the black wire,
    the other end of the load connected to +5 volts. The end of the load that is
    connected to the black wire also goes to your stamp input pin.

    In this condition, the sensor output (black wire) will be either a logic 1 or
    logic 0 (5v or 0V). Again, this is without the "LED" load, just a simple
    resistor about 10k ohms will work fine.

    Write back if you have questions...

    Ken


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-16 22:21
    In a message dated 2/16/2003 1:46:01 PM Pacific Standard Time,
    smartdim@a... writes:

    > However, that is an extra 6 pins (6pin dip package) you need to deal with
    > for
    > the opto isolator.
    > Another approach with less pin count is to connect the load between the
    > brown
    > wire and +5 volts. And the brown wire also goes to the stamp. You will get
    > a
    > logic 1 and 0.
    >

    I now see the confusion. I INCORRECTLY said to connect the load between the
    brown and +5.....That is WRONG,

    The load gets connected between the black and +5, sense the state of the
    black wire.

    Ken


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-16 22:27
    Of course! Can't see the forest for the manuals.... I'll stop there.
    They suggest using the higher voltage because it's there. Thanks again.
    Ian.

    Original Message
    From: smartdim@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=7BitkxwaETdInNa6MpzBluk8l0vzQ11f7I06yBl1XtKkN1nSLxyso6pVMRb8xjv-5XOYXDeJmMiLKVA]smartdim@a...[/url
    Sent: February 16, 2003 5:20 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Proximity sensors and the Stamp

    In a message dated 2/16/2003 1:58:35 PM Pacific Standard Time,
    iphillips@s... writes:

    > That's the right one alright. So, I attach one side of the load to the
    > Brown(+12v) and the other to +5v? The only thing that I am a little
    > confused about is how the stamp will read this with +12v going to it.
    I
    > was looking at it as just a simple pull up switch situation. Not the
    > case?
    >

    Not quite......

    The diagram shows the load connected as follows....one side of the load
    is
    connected to the black wire, the other side of the load is connected to
    the
    +12 volt wire...this condition will give you either +12 on the black
    wire, or
    0 volts on the black wire. +12 volts to the stamp input pin is VERY BAD.

    Instead of connecting the other side of the load to +12, connect it to a
    +5
    volt source.
    The load is not connected to the +12 in any way shape or form.

    So, you should end up with one end of the load connected to the black
    wire,
    the other end of the load connected to +5 volts. The end of the load
    that is
    connected to the black wire also goes to your stamp input pin.

    In this condition, the sensor output (black wire) will be either a logic
    1 or
    logic 0 (5v or 0V). Again, this is without the "LED" load, just a simple

    resistor about 10k ohms will work fine.

    Write back if you have questions...

    Ken


    [noparse][[/noparse]Non-text portions of this message have been removed]


    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 2003-02-16 23:15
    In a message dated 2/16/2003 2:26:43 PM Pacific Standard Time,
    iphillips@s... writes:

    > Of course! Can't see the forest for the manuals.... I'll stop there.
    > They suggest using the higher voltage because it's there. Thanks again.
    > Ian.
    >

    You are correct, they show the load connected to the +12 because it is there.
    But just to make sure you understand, that configuration will blow the input
    to the stamp.


    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.