Shop OBEX P1 Docs P2 Docs Learn Events
BS2 input conditioning — Parallax Forums

BS2 input conditioning

ArchiverArchiver Posts: 46,084
edited 2001-04-18 19:41 in General Discussion
Hello,

I was reading, in one of the PDF files, about methods for
conditioning of digital inputs for the stamps. I have built a circuit
(Breadboard) for use in my truck. Four of the BS2 I/O's are used as
inputs to monitor changes in the 12V signal (ie ON=12V, OFF=0V). The
PDF showed that for this input type, an optocoupler (4N35, I
believe), should be used. I chose to use a 2N3904 and a couple of
resistors such that the 12V input switches on the transistor which
then passes the 5V VDD signal level to the stamp. This however,
requires one transistor and 3 resistors for each input pin in my
design - but it works great.

In an effort to minimize parts and simplify my PCB, I want to use
one resistor and a 4.7V zener diode to condition the ~14V input down
to 4.7V. This would allow the normal voltage fluctuations in the
trucks 12V system while maintaining the BS2 input level at 4.7V. In
testing, I have found that the BS2 will consistently recognize 4.7V
as a "high".

The only downside I can see, and finally the point of my post, is
that if the zener were to ever fail open circuited, the stamp would
be passed the full voltage of ~ 14VDC. This is an unlikely failure,
but if it occurred, would the stamp be damaged ?

Regards, John.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-04-18 02:50
    Yes ... it would probably kill the stamp input pin that went overvoltage.

    Two "Stamp Savers":
    1) Use a 22K resistor in series with the Stamp input pin. This alone should
    save the Stamp from 14 volt input.

    2) Connect 2-4.7 volt zeners in parallel. If one zener fails, the second
    will take over. The probability of both failing is miniscule.

    Ray McArthur

    > The only downside I can see, and finally the point of my post, is
    > that if the zener were to ever fail open circuited, the stamp would
    > be passed the full voltage of ~ 14VDC. This is an unlikely failure,
    > but if it occurred, would the stamp be damaged ?
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-18 03:18
    In some applications I have used a simple 78L05 TO-92 3 terminal
    regulator as conditioning device for pin input. It is cheap,reliable,
    single device, and with wide range input.
    ACJacques

    john_trinca@h... wrote:
    >
    > Hello,
    >
    > I was reading, in one of the PDF files, about methods for
    > conditioning of digital inputs for the stamps. I have built a circuit
    > (Breadboard) for use in my truck. Four of the BS2 I/O's are used as
    > inputs to monitor changes in the 12V signal (ie ON=12V, OFF=0V). The
    > PDF showed that for this input type, an optocoupler (4N35, I
    > believe), should be used. I chose to use a 2N3904 and a couple of
    > resistors such that the 12V input switches on the transistor which
    > then passes the 5V VDD signal level to the stamp. This however,
    > requires one transistor and 3 resistors for each input pin in my
    > design - but it works great.
    >
    > In an effort to minimize parts and simplify my PCB, I want to use
    > one resistor and a 4.7V zener diode to condition the ~14V input down
    > to 4.7V. This would allow the normal voltage fluctuations in the
    > trucks 12V system while maintaining the BS2 input level at 4.7V. In
    > testing, I have found that the BS2 will consistently recognize 4.7V
    > as a "high".
    >
    > The only downside I can see, and finally the point of my post, is
    > that if the zener were to ever fail open circuited, the stamp would
    > be passed the full voltage of ~ 14VDC. This is an unlikely failure,
    > but if it occurred, would the stamp be damaged ?
    >
    > Regards, John.
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-18 03:32
    For #2, Shouldn't the zeners be connected in series to protect the
    stamp pin ?

    Charlie Bachetti


    --- In basicstamps@y..., "Ray McArthur" <rjmca@u...> wrote:
    > Yes ... it would probably kill the stamp input pin that went
    overvoltage.
    >
    > Two "Stamp Savers":
    > 1) Use a 22K resistor in series with the Stamp input pin. This
    alone should
    > save the Stamp from 14 volt input.
    >
    > 2) Connect 2-4.7 volt zeners in parallel. If one zener fails, the
    second
    > will take over. The probability of both failing is miniscule.
    >
    > Ray McArthur
    >
    > > The only downside I can see, and finally the point of my post,
    is
    > > that if the zener were to ever fail open circuited, the stamp
    would
    > > be passed the full voltage of ~ 14VDC. This is an unlikely
    failure,
    > > but if it occurred, would the stamp be damaged ?
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-18 04:30
    At 01:33 AM 4/18/01 +0000, john_trinca@h... wrote:

    > In an effort to minimize parts and simplify my PCB, I want to use
    >one resistor and a 4.7V zener diode to condition the ~14V input down
    >to 4.7V. This would allow the normal voltage fluctuations in the
    >trucks 12V system while maintaining the BS2 input level at 4.7V. In
    >testing, I have found that the BS2 will consistently recognize 4.7V
    >as a "high".

    Good choice of zener voltage. A stamp will recognize a logic 1 for any
    voltage above about 1.4 Vdc.

    I would use an input series resistor of 10k or so. In addition, you need
    to consider how you see a logic 0. Does the 14V input actually go to
    ground or does it float. An additional 10k resistor in parallel with the
    zener eliminates the floating input problem and also improves your noise
    margin.

    You can eliminate the zener if your input voltage is well defined. If you
    know that it can't go above 16 Vdc, leave the series resistor at 10k and
    make the shunt resistor 3.3k . That protects you for input voltages up to
    about 20 Vdc and still works with voltages down to about 6 Vdc. Your
    nominal input voltage is 14V - lots of headroom.

    I use that exact technique in my high volume products, except that I use
    10k and 2.4k since my nominal input is 17 Vdc.

    dwayne



    Dwayne Reid <dwayner@p...>
    Trinity Electronics Systems Ltd Edmonton, AB, CANADA
    (780) 489-3199 voice (780) 487-6397 fax

    Celebrating 17 years of Engineering Innovation (1984 - 2001)

    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    Do NOT send unsolicited commercial email to this email address.
    This message neither grants consent to receive unsolicited
    commercial email nor is intended to solicit commercial email.
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-18 05:58
    > For #2, Shouldn't the zeners be connected in series to protect the
    > stamp pin ?

    No. The idea is that if one zener opens, the second one takes over.
    Usually, the zeners are not perfectly matched for breakdown voltage, so one
    will take all or most of the current. If it fails, the second zener will
    regulate. I guess if I were doing the job, Dwayne Reid's approach would be
    preferable, since it uses cheaper parts and still protects the Stamp.

    Regards,
    Ray McArthur
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-18 08:27
    Dwayne,

    That's perfect. The truck voltage is fairly stable and I think the
    two resistor application would be ideal for my purposes. I didn't
    realize that the stamp would still "see" a "high" even down at 1.4 V.

    Thanks, John.

    --- In basicstamps@y..., Dwayne Reid <dwayner@p...> wrote:
    > You can eliminate the zener if your input voltage is well defined.
    If you
    > know that it can't go above 16 Vdc, leave the series resistor at
    10k and
    > make the shunt resistor 3.3k . That protects you for input
    voltages up to
    > about 20 Vdc and still works with voltages down to about 6 Vdc.
    Your
    > nominal input voltage is 14V - lots of headroom.
    >
    > I use that exact technique in my high volume products, except that
    I use
    > 10k and 2.4k since my nominal input is 17 Vdc.
    >
    > dwayne
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-18 19:41
    At 07:27 AM 4/18/01 +0000, john_trinca@h... wrote:
    >Dwayne,
    >
    > That's perfect. The truck voltage is fairly stable and I think the
    >two resistor application would be ideal for my purposes. I didn't
    >realize that the stamp would still "see" a "high" even down at 1.4 V.
    >
    >Thanks, John.

    I don't think that it is in the specs, but, yeah, the original stamp 1
    does. I assume that all the other PIC based stamps do the same.

    Since this is going on a vehicle, I'd probably do it slightly
    differently. This takes 3 resistors instead of 2. Input shunt resistor:
    4k7. Series resistor: 100k. Output shunt resistor: 33k.

    What I've done is 2 things: scale the divider network to use higher value
    resistors. This limits input current if an overvoltage situation
    occurs. Second, provide a low value input shunt resistor to minimise the
    effects of leakage current being seen as a false logic HI.

    The reason for scaling the input divider is to deal with load dump
    transients. On a 12V vehicle, you can expect load dump transients up to
    about 40Vdc lasting for as long as 100 msec. To the stamp, this looks like
    a 10Vdc input with a source impedance of about 24k which translates into a
    input clamp current of about 200 uA - well within the input clamp ratings
    on the PIC.

    dwayne



    Dwayne Reid <dwayner@p...>
    Trinity Electronics Systems Ltd Edmonton, AB, CANADA
    (780) 489-3199 voice (780) 487-6397 fax

    Celebrating 17 years of Engineering Innovation (1984 - 2001)

    * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    Do NOT send unsolicited commercial email to this email address.
    This message neither grants consent to receive unsolicited
    commercial email nor is intended to solicit commercial email.
Sign In or Register to comment.