Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

24 volt -> TTL input

3 views
Skip to first unread message

Ties Bos

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
I am sure this is a pretty basic question, but I haven't been able to track
down the answer in dejanews.

I need to properly interface a 24 volt industrial system to a
microcontroller.
The output pulses of position decoders and the like are in 24 volt. As there
are also big relays and the like on this 24 volt net, I assume using a
resistor divider network is not the way to go.

I hope someone can provide me with a proper circuit to do it.

Thanks,
Ties.

George Eccles

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
The traffic industry (not necessily on the cutting edge of anything)
uses a 10K pull-up to 24v, and a 220K/68K divider, with a .1uf across
the 68K. It seems fairly robust.

On Wed, 5 Apr 2000 16:30:10 +0200, "Ties Bos" <tb...@huygens.org>
wrote:

Tom Carlson

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Ties Bos wrote:
>
> I am sure this is a pretty basic question, but I haven't been able to track
> down the answer in dejanews.
>
> I need to properly interface a 24 volt industrial system to a
> microcontroller.
> The output pulses of position decoders and the like are in 24 volt. As there
> are also big relays and the like on this 24 volt net, I assume using a
> resistor divider network is not the way to go.
>
> I hope someone can provide me with a proper circuit to do it.
>
> Thanks,
> Ties.


There's a lot of ways to go on this. I'd enjoy hearing some of the
others responses. A lot of people will use a zener, but 5 volt zeners
are pretty soft kneed.

This is one way that's kind of elegant
Vcc
|
____
/\ Diode
--
|
24 volt signal ----------BIG LIMITING RESISTOR-----------------TTL Input
|
---
/\ Diode
--
|
GND

This will feed power into your Vcc, which is OK if the current is low
enough, which it will be, with a large resistor. It's very sharp kneed,
and it's immune to fluctuations in supply voltage, which a divider
network wouldn't be. You can throw in a low pass filter too, if you
like.

--
Regards, Tom Carlson
Vancouver - WA - USA PH: (360) 944 - 8938 FX: (360) 260 - 1372
- The most exciting, most challenging, and the deadliest adventure
games of all are played on spreadsheets.

Robert

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Do you want to explain how you are going to sink upwards of 1.6mA through that
"big resistor" and still maintain a logic low<0.8 V ?- with this scheme.

James Beck

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to

I'd use optoisolators.


Jonathan Bromley

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Ties Bos wrote:
>
> I am sure this is a pretty basic question, but
...

> I need to properly interface a 24 volt industrial system to a
> microcontroller.

Not so basic. I see two very sensible replies already.
There will doubtless be more.

You could think opto-isolator, which is what most
industrial programmable controllers do. You should
also assume the worst - like, for example, allow for the
risk of temporary connection of 24V circuit to AC mains.
The factory is a brutal place. Find out about transient
suppressors, MOVs and other useful protection devices.

Be aware, too, that many industrial relay systems'
24V supplies are very, very noisy and suffer brownouts.
Whatever you do needs to have a fairly slow low-pass filter
on every input, just to cope with millisecond spikes and
dropouts.

Then you have to worry about whether your system is NPN-style
(switches have -ve supply common) or PNP-style (switched +ve).

Then you have to worry about ESD (discharge off people's bodies
as they shuffle round the factory in polyurethane-soled shoes).

Then you have to worry about EMC - any welding gear nearby?
RF heating kit? Plasma cutters? Spark erosion machines?
And if the incoming EM rubbish doesn't get you, some
bureaucrat with a field strength meter will come around
and measure the RF emissions from your microprocessor kit,
and if you haven't got the isolation just right you may well
be coupling switching-PSU or clock noise on to the 24V signal
and power lines, which for sure will be unshielded. Think
common-mode choke.

Do not spurn the humble relay. You can get "signal relays"
which have 24V coils and gold-plated wiping contacts: your
24V system drives the relay coil, and the contacts interface
straight to the logic. This is good in many ways. It has
built-in hysteresis (relay pull-in voltage is way higher than
drop-out voltage); it's slow, so millisecond spikes are
no problem; isolation is assured. Relays are also
comprehensible to the average factory installation person,
whereas solid-state inputs may seem very mysterious
to your customer's maintenance personnel.

Make sure that whatever terminals you use for these
connections are gorilla-compatible. Factory maintenance
folk like to tighten electrical connections with an
adjustable wrench.

Be ready for a shock when you see how much space, power and cash
this interfacing will cost you. The microprocessor bit is
usually the easy part.

Very good luck!!!!!

Jonathan Bromley

Paul Hovnanian

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Ties Bos wrote:
>
> I am sure this is a pretty basic question, but I haven't been able to track
> down the answer in dejanews.
>
> I need to properly interface a 24 volt industrial system to a
> microcontroller.
> The output pulses of position decoders and the like are in 24 volt. As there
> are also big relays and the like on this 24 volt net, I assume using a
> resistor divider network is not the way to go.

It could be OK. On the other hand, if there are lots of stray voltages
in the system, an opto-isolator would give you the best protection
possible.



> I hope someone can provide me with a proper circuit to do it.
>
> Thanks,
> Ties.

--
Paul Hovnanian | (here) mailto:hovn...@bcstec.ca.boeing.com
Software Conflagration | (there) mailto:Pa...@Hovnanian.com
Control | (spam) mailto:postm...@mouse-potato.com
-----------------------+---------------------------------------------
Just don't create a file called -rf. :-)
--Larry Wall in <11...@jpl-devvax.JPL.NASA.GOV>

Ed Ngai

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Ties Bos wrote:
> I am sure this is a pretty basic question, but I haven't been
> able to track down the answer in dejanews.
> I need to properly interface a 24 volt industrial system to a
> microcontroller. The output pulses of position decoders and the
> like are in 24 volt. As there are also big relays and the like on
> this 24 volt net, I assume using a resistor divider network is not
> the way to go.

> I hope someone can provide me with a proper circuit to do it.
> Thanks,
> Ties.


I think that a voltage regulator would be a safe choice. Look at
Linear Technology LM350, input voltage = 35 volts, handle up to 3
amp output, plenty of power there. SO your looking at 1` voltage
reg, 2 resistors and 2 caps ? it should fit on a small 1" x 1"
pcb just fine.

ed

Robert

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Take a look at the Agilent HCPL-5670/1 for application examples.

Tom Carlson

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Robert wrote:
>
> Do you want to explain how you are going to sink upwards of 1.6mA through that
> "big resistor" and still maintain a logic low<0.8 V ?- with this scheme.
>

With a pull down resistor, silly! A hell of a lot cheaper than some off
the shelf solution.

Robert

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
How do you put that pulldown in there without voltage division by the "big"
resistor?

Tom Carlson

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to
Robert wrote:
>
> How do you put that pulldown in there without voltage division by the "big" resistor?

Give me a break. This isn't rocket science, even to you. Of course
there will be some. You wouldn't select it for that though, as you
aren't trying to voltage divide. You let the diodes do that work so you
aren't wedded to exactly 24V. So instead of selecting say, 200K and
50K, you'd select say, 200K and 100K. Get it?

Robert

unread,
Apr 5, 2000, 3:00:00 AM4/5/00
to

Tom Carlson wrote:

> Robert wrote:
> >
> > How do you put that pulldown in there without voltage division by the "big" resistor?
>
> Give me a break. This isn't rocket science, even to you. Of course
> there will be some. You wouldn't select it for that though, as you
> aren't trying to voltage divide. You let the diodes do that work so you
> aren't wedded to exactly 24V. So instead of selecting say, 200K and
> 50K, you'd select say, 200K and 100K. Get it?

Yes- 200||100= 67K and 67K x 1.6 mA=107 Volts. So either the controller pulls the input
down to -107 + 0.8 V or the TTL inputs force that 1.6 mA current through that resistance no
matter what! Oh yeah- the clamps- I forgot about the clamps.

R Prevo

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to

Ties Bos wrote:

> I am sure this is a pretty basic question, but I haven't been able to track
> down the answer in dejanews.
>
> I need to properly interface a 24 volt industrial system to a
> microcontroller.
> The output pulses of position decoders and the like are in 24 volt. As there
> are also big relays and the like on this 24 volt net, I assume using a
> resistor divider network is not the way to go.
>
> I hope someone can provide me with a proper circuit to do it.
>
> Thanks,
> Ties.

Use opto couplers. They ar for sale for industrial interfacing.

--
René Prevo

Netherlands organisation for applied scientific research, TNO
Physics and Electronics Laboratory, FEL
POBOX 96864, 2509JG
Oude Waalsdorperweg 63, 2597 AK
THE HAGUE, THE NETHERLANDS
email: Pr...@fel.tno.nl
Fax: +31 70 3740653
Tel: +31 70 3740391
http://www.tno.nl/instit/fel/felmain.html
http://www.tno.nl/instit/fel/fel_nl.html (dutch)

Tony Williams

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
In article <38EB635B...@earthlink.net>,

Robert <rom...@earthlink.net> wrote:
> Do you want to explain how you are going to sink upwards
> of 1.6mA through that "big resistor" and still maintain a
> logic low<0.8 V ?- with this scheme.

The "TTL" in the thread title is almost certainly
a red herring.... the man said "microcontroller".
and these days that means CMOS.... so TTL-levels
maybe, but not necessarily the current sink.

--
Tony Williams.

Ties Bos

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
Oh sure, CMOS it is. I didn't have a clue it would make that big a
difference! I would have chosen my words more carefully if I had.

Ties.

"Tony Williams" <to...@ledelec.demon.co.uk> wrote in message
news:49aaeab...@ledelec.demon.co.uk...

Tony Williams

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
In article <38EB714C...@brookes.ac.uk>,
Jonathan Bromley <jsebr...@brookes.ac.uk> wrote:
[snip]

> Do not spurn the humble relay. You can get "signal relays"
> which have 24V coils and gold-plated wiping contacts: your
> 24V system drives the relay coil, and the contacts interface
> straight to the logic. This is good in many ways. It has
> built-in hysteresis (relay pull-in voltage is way higher than
> drop-out voltage); it's slow, so millisecond spikes are
> no problem; isolation is assured. Relays are also
> comprehensible to the average factory installation person,
> whereas solid-state inputs may seem very mysterious
> to your customer's maintenance personnel.

A sealed 24v au-au comms relay is good, for reasons above,
and because the 1k-ish coil pulls a reasonable (10mA)
wetting-current (essential in an industrial environment).

I would add though that the relay coil must have a shunt
diode for the flyback clamp, otherwise you may unkindly
trash A.N Other's driving switch. But then you also
have to put a diode in series with the whole lot, to
stop A.N Other's reversed polarity wiring from trashing
your thoughtful flyback diode.

You can do it with optocouplers, but it would be good
to model the loading and input sensitivity on a 24v
1k coil relay.

Note also failsafe logic, choose logic polarities such
that; If you want to Start a machine, a positive signal
current must flow. If you want to Stop a machine, make
it the absence of current. This is the best way round
to avoid accidents (to people) if (when!) the external
wiring goes open-circuit or shorted down to ground.

--
Tony Williams.

Keith Wootten

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
In article <49aaf97...@ledelec.demon.co.uk>, Tony Williams
<to...@ledelec.demon.co.uk> writes

>In article <38EB714C...@brookes.ac.uk>,
> Jonathan Bromley <jsebr...@brookes.ac.uk> wrote:
>[snip]
>> Do not spurn the humble relay.
[snip]

> A sealed 24v au-au comms relay is good,

[snap]

The original post was concerned with 'position decoders'. Assuming
these are quadrature type devices and not just simple limit switches, a
relay may have a short but full life :-)

Use opto couplers / opto isolators (same thing). There is no sensible
alternative. <runs to bunker>

Cheers
--
Keith Wootten

Tony Williams

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
In article <ilXVQGAV...@wootten.demon.co.uk>,
Keith Wootten <Ke...@wootten.demon.co.uk> wrote:

> The original post was concerned with 'position decoders'. Assuming
> these are quadrature type devices and not just simple limit switches, a
> relay may have a short but full life :-)

> Use opto couplers / opto isolators (same thing). There is no sensible
> alternative. <runs to bunker>

Oh, Oh, a DEFCON2 .......

<strikes up the pilot light on the flamethrower>

The original post said;


"
I need to properly interface a 24 volt industrial system to a
microcontroller. The output pulses of position decoders and the
like are in 24 volt. As there are also big relays and the like

on this 24 volt net..... etc.
"

"Position decoders"; could they be quadrature decoders,
or could they be plain old proximity detectors?

Also, "big relays and the like on this 24v net"

<auto-tracking= ENGAGED, safety-interlock=OUT, system=ARMed>

--
Tony Williams.

Tom Carlson

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to

Yes...

LS TTL would be 0.4, not 1.6, which would help, but not enough. Of
course, in this day and age, anyone would use HC, or even HCT, not TTL
at all, and avoid all this.

Since he did say TTL in the title though... I'm going to hate saying
this, but yes, you're right Robert! For TTL, you would need a pull-up,
not a pull-down, and switch to ground. Since he's interfacing signals,
not switches, there's no way to pull down to logic low reliably.

Ties, use the scheme I outlined, but use HC or HCT, not TTL.

Keith Wootten

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
In article <49aaff1...@ledelec.demon.co.uk>, Tony Williams
<to...@ledelec.demon.co.uk> writes

[snipped]

> Oh, Oh, a DEFCON2 .......
>
> <strikes up the pilot light on the flamethrower>
>

> <auto-tracking= ENGAGED, safety-interlock=OUT, system=ARMed>

Ha! Auto-tracking with GPO relays and Strowger switches? Anyway,
you'll never even see me thanks to my optical isolation. I've
discovered the secret of complete invisibility - it's called the
bicycle.

Cheers
--
Keith Wootten

Robert

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to

Tony Williams wrote:

> In article <38EB635B...@earthlink.net>,
> Robert <rom...@earthlink.net> wrote:
> > Do you want to explain how you are going to sink upwards
> > of 1.6mA through that "big resistor" and still maintain a
> > logic low<0.8 V ?- with this scheme.
>
> The "TTL" in the thread title is almost certainly
> a red herring.... the man said "microcontroller".
> and these days that means CMOS.... so TTL-levels
> maybe, but not necessarily the current sink.
>
> --
> Tony Williams.

Okay, HCTMOS it is but you still have some problems with that
"big" resistor. Care to guess what they might be?


Tom Carlson

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to
Robert wrote:

> Okay, HCTMOS it is but you still have some problems with that
> "big" resistor. Care to guess what they might be?


You responded to the wrong post. I couldn't begin to guess, as I've
used this in several products with no problems. Why don't you enlighten
me?

Robert

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to

Tom Carlson wrote:

> Robert wrote:
>
> > Okay, HCTMOS it is but you still have some problems with that
> > "big" resistor. Care to guess what they might be?
>
> You responded to the wrong post. I couldn't begin to guess, as I've
> used this in several products with no problems. Why don't you enlighten
> me?
>
>

Okay- but let's deal with specifics. What was the value of the "big"
resistor and what was the MOS part number?


Tom Carlson

unread,
Apr 6, 2000, 3:00:00 AM4/6/00
to

Well on the last one, if I recall, it was as follows.


Vcc
|
_|_
/ \ Diode
---
| |\ 74HC14
12V signal -----200K---------------------|------------| o----------Micro
| _|_ |/
| / \ Diode
100K ---
| |
| |
GND GND


Keep in mind we're protecting against voltage spikes, so the 12V signal
may be on the order of 30V on occasion. in which case the diodes will
come into play.

Robert

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Tom Carlson wrote:

> Robert wrote:
> >
> > Tom Carlson wrote:
> >
> > > Robert wrote:
> > >
> > > > Okay, HCTMOS it is but you still have some problems with that
> > > > "big" resistor. Care to guess what they might be?
> > >
> > > You responded to the wrong post. I couldn't begin to guess, as I've
> > > used this in several products with no problems. Why don't you enlighten
> > > me?
> > >
> > >
> >
> > Okay- but let's deal with specifics. What was the value of the "big"
> > resistor and what was the MOS part number?
>
> Well on the last one, if I recall, it was as follows.
>
> Vcc
> |
> _|_
> / \ Diode
> ---
> | |\ 74HC14
> 12V signal -----200K---------------------|------------| o----------Micro
> | _|_ |/
> | / \ Diode
> 100K ---
> | |
> | |
> GND GND
>

> --
> Regards, Tom Carlson
> Vancouver - WA - USA PH: (360) 944 - 8938 FX: (360) 260 - 1372
> - The most exciting, most challenging, and the deadliest adventure
> games of all are played on spreadsheets.

This circuit is okay in an ideal world but as others have pointed out the noise
environment in the industrial environment can be very severe. You have no
minimum slew rate specifications on the Schmitt trigger so you are okay there.
The leakage over full temperature may approach 100mV offset caused by your 67K
ohm drive resistance and this is due to the diodes as well as the H14 input
leakage- so you are okay there. The worst case specifications on Vil and VH,min
[min hysteresis] at 0.9 V and 0.4V resp. look tight. For example, since your
divider is only 3:1 this translates into about 1.2 Volts of hysteresis referred
to the 24 V line or about 5% of your nominal input voltage range [ which is 24 V
and not 12 V ]. The typical hysteresis is 0.9V which is 2.7 V referred to the
line and about 10% of the input voltage range. It will be difficult to get
decent noise rejection from this IC because of the nearly 3:1 span in the
hysteresis voltage specification. I see also that the minimum Vin,high can be as
low as 1.55 V which is only 4.65 V referred to the 24 Volt line or less than 20
% of nominal. Doesn't this seem kind of low to you ?
You may be able to improve these numbers by going to a 7.6:1 divider rather than
3:1. The minimum hysteresis becomes 3.0V, the minimum Vin,high=11.8V, and
minimum Vin,low=6.84 V. This 7.6:1 allows for 10% tolerance on the 24 Volt and
5% in your divider to guarantee all worst case thresholds are met with 5%
margin. Notice that these numbers are better because the worst case thresholds
have been moved away from the rails and more towards midrange which is the
maximum distance from the noise.
I am not even going to get into splitting the series resistor with a shunt
capacitor, the circulating ground currents, or KV level spikes on the input.

Spehro Pefhany

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to
The renowned Robert <rom...@earthlink.net> wrote:

<some snippage >


> I am not even going to get into splitting the series resistor with a shunt
> capacitor, the circulating ground currents, or KV level spikes on the input.

It's ok for encoders, but this circuit also doesn't pass enough current
through external contacts to be used that way. It's easy to make a so-so
interface, not so easy to make a really good one for the industrial
environment. Just extending the ground wire to the encoders may cause
serious problems in a severe environment, which I think is what Robert is
referring to above.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.BlueCollarLinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Robert

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Spehro Pefhany wrote:

How about this input. Diode clamps not shown but should be included.

o----------
|
| +
zener 3.3V
| - R1-150K R2- 82K
x-----------/\/\/\------x------/\/\/\------x------> to HCTTL
| | |
/ ___ /
\ R4-1.2K ___ C -2.7uF \ R3-68K
| | |
0-----x---------------------x----------------x-------> ref


Taking this from the top we have the following Schmitt trigger specs in
min/max:


Vhyst 0.4/2.1

Vin,low 0.9/ 2.45

Vin,high 1.55/ 3.15

A false low trigger occurs when a noise spike reduces Vin from the 24 Volt rail to
Vin,low max=2.45. Call this margin Vn,low. A false high occurs when a noise spike
forces the input from the 0 V rail to Vin,high min=1.55 V. Call this Vn,high.
Using the 3:1 divider we have 0-24V maps to 0-8V so that Vn,low=8-2.45=5.55 V and
Vn,high=1.55 V-0V=1.55V . These numbers are 3x referred to the input or 16.7V and
4.65V respectively. This is quite an imbalance but it may make sense in some
situations.

Using an attenuation with factor A as above, the 0-24V input maps to 0-24xAV and
the Vn,low=24*A-2.45 and Vn,high=1.55V=Vin,high min. So the attenuation does
absolutely nothing to improve the noise margin of Vn,high. If this is not
acceptable, then by adding a zener level shift, Vz, the Vn,high can be improved at
the expense of Vn,low -of course. Now the range of 0-24V maps to 0->A*(24-Vz) and
the noise margins are:

Vn,low=A*(24-Vz)-2.45 and Vn,high=1.55 at the Schmitt input. The improvement comes
from the fact that A and Vz can be selected so that 24 V line input must bias the
zener on and reach the value Vii,high,min so that A*(Vii,high,min-Vz)=1.55 or
rearranging Vii,high,min=1.55/A+Vz which makes it apparent that the Vn,high
referred to the 24 V line has improved.

Then referred to the 24 Volt line:

Vn,low=24-[Vin,low,max,schmitt/A+Vz]

Vn,high=Vin,high,min,schmitt/A+Vz

This shows that increasing the one noise margin decreases the other.

Taking Vz=3.3Volt and 1/A=4.375 then gives

Vn,low=24-[2.45*4.375+3.3]=10V

Vn,high=1.55*4.375+3.3=10V

Continuing, the Vin,high,min referred to the 24 V line is 1.55*4.375+3.3=10V so
this sets the zener bias as it must be full on at this voltage. This effectively
sets R4 as the value to obtain (10-Vz)/Iz. Taking Iz=5mA --> R4=1.2K so then at
maximum input, Iz=(24-3.3)/1.2K=17mA or 60mW.

Computing more values, 1/A=4.375 and so A=R3/(R3+R12) where R12=R1+R2. This
arranges to 1+R12/R3=1/A=4.375 or R12/R3=3.375. Setting the Schmitt drive
impedance at ~50K so that 1/50=1/R12+1/R3
=1/R12+3.375/R12=4.375/R12-->R12=50*4.375=220K from which R3=R12/3.375=68K.
Adjusting R12=229.5K from R12=3.375*R3 and for filtering purposes using the fact
that R1+R2=229 and R2+68=R1 so that R2=82K and R1=150K works well enough.

Now with these values the RC filter time constant is 75K*C which is quite large
and can be used to eliminate contact bounce. Letting Tbounce=100ms of actual
closure time then a good time constant to use would be the noise margin voltage or
10V=24*(1-EXP(-Tbounce/RC)) or C=-Tbounce/LN(1-10/24)/R or C=2.7uF. This value of
RC sets the lowpass cutoff at 0.8 Hz which will attenuate any 60 Hz hum by 38dB or
a factor of 75. This will be important because the hysteresis is worst case
0.4/A=0.4*4.375=1.75 Volts.

Why don't you take it from here, Tom.


Tony Williams

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to
In article <38ECFE4...@earthlink.net>,
Robert <rom...@earthlink.net> wrote:

> Tony Williams wrote:
> > The "TTL" in the thread title is almost certainly
> > a red herring.... the man said "microcontroller".
> > and these days that means CMOS.... so TTL-levels
> > maybe, but not necessarily the current sink.

> Okay, HCTMOS it is but you still have some problems with that


> "big" resistor. Care to guess what they might be?

The big-R was not my original suggestion, but......

Bearing in mind that a non-isolated 24v interface
is only viable in very restricted circumstances,
this is what I have used on a machine where the 24v
supply was generated by me, and used by my sensing
switches only;

Nominal 0 to 24v +-----+
Note; 24v sensors |
are normally an \
active pullup to / 3.9k 1W.
24v (or less!!) \
or an open-circuit. | 22k 1= >2v
+----/\/\---+--> PIC input.
| | 0= <0.8v
\ |
/ 1k === 0.1uF up against
\ | the PIC pin.
| |
+-----+-----------+--> PIC 0v.

PIC inputs have inbuilt protection diodes and we prog
any input pin to always live as an output (at 0v for
1-sensing and 5v for 0-sensing), only set to an input
during the time we need to look at it.

In one case our PIC pcb lives (unshielded) alongside a
400v 3-ph 5hp motor reversing-contactor set. Not my
choice of mounting, but that dancing on the i/o ports
gets the hatches battened-down during (say) the 100mS
when contactors are going over. The steady 400v 3-ph
flowing through the contactors 6" away does not cause
problems, even during a 19Arms stall/overload trip.

That input circuit has survived (and the PIC apparently
worked) in the face of a 240vrms miswiring to one input,
but only for a short while... until the 3.9k and 1k got
carbonised and (presumably) let the 240v get onto the 22k.

However, complex direct-coupled circuits are a waste
of time when the 24v is a 'system 24v', due to earth
loop problems. In this case isolated interfacing is
the only way to go.... either relay or opto input.

--
Tony Williams.

Bill Sloman

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to
In article <38ED63D5...@earthlink.net>,

Robert <rom...@earthlink.net> wrote:
>
>
> Spehro Pefhany wrote:
>
> > The renowned Robert <rom...@earthlink.net> wrote:
> >
> > <some snippage >
> > > I am not even going to get into splitting the series resistor with
> > > a shunt capacitor, the circulating ground currents, or KV level
> > > spikes on the input.
> >
> > It's ok for encoders, but this circuit also doesn't pass enough
> > current through external contacts to be used that way. It's easy to
> > make a so-so interface, not so easy to make a really good one for
> > the industrial environment. Just extending the ground wire to the
> > encoders may cause serious problems in a severe environment, which I
> > think is what Robert is referring to above.

<snipped Spehro's sig>

> How about this input. Diode clamps not shown but should be included.
>
> o----------
> |
> | +
> zener 3.3V
> | - R1-150K R2- 82K
> x-----------/\/\/\------x------/\/\/\------x------>
to HCTTL
> | | |
|
> / ___ /
/
> \ R4-1.2K ___ C -2.7uF \ R3-68K
> | | |
|

> 0-----x---------------------x------------------x------->


ref
>
> Taking this from the top we have the following Schmitt trigger
> specs in
> min/max:
>
> Vhyst 0.4/2.1
>
> Vin,low 0.9/ 2.45
>
> Vin,high 1.55/ 3.15

<Snipped the analysis>

I hope I've fixed the ASCII art more or less as originally intended.

I can't say I like this circuit - my own inclination is to put about
100k in series with any input that comes in from an industrial
environment - if some clown applies 220V AC the resistor can survive
(V^2/R is 0.5W and any resistor long enough to stand off 220V AC can
usually dissipate this much power).

As you have said, this ends up making the input marginal if you want to
feed it into a Schmitt trigger. You certainly can get better margins
with a zener in the input, but I much prefer to replace the Schmitt
trigger with an analog comparator - you can then exploit the
differential rejection of the comparator to reject ground noise between
signal source and destination, and the relatively low off-set voltages
you get with the cheapest of comparators makes the tolerancing problem
trivial.

With a comparator both the signal and the reference inputs can be
protected by 100k resistors and diode clamps, eliminating any ground
loops, and you can hang as much filter capacitance as you can get away
with between the inputs; separate capacitors to local ground help the
high frequency common mode rejection, but capacitor and resistor
tolerances mean that you end up with slightly different cut-off
frequencies on the two inputs if you only use these two capacitors for
your low-pass filtering.

Comparators are more expensive and bulkier than zener diodes, but they
are the way to go if you want a bullet-proof interface, and don't want
to go up to an opto-coupler solution.

--
Bill Sloman, Nijmegen


Sent via Deja.com http://www.deja.com/
Before you buy.

Tom Carlson

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to
Robert wrote:
> > > Okay- but let's deal with specifics. What was the value of the "big"
> > > resistor and what was the MOS part number?
> >
> > Well on the last one, if I recall, it was as follows.
> >
> > Vcc
> > |
> > _|_
> > / \ Diode
> > ---
> > | |\ 74HC14
> > 12V signal -----200K---------------------|------------| o----------Micro
> > | _|_ |/
> > | / \ Diode
> > 100K ---
> > | |
> > | |
> > GND GND
> >

> This circuit is okay in an ideal world but as others have pointed out the noise


> environment in the industrial environment can be very severe. You have no
> minimum slew rate specifications on the Schmitt trigger so you are okay there.
> The leakage over full temperature may approach 100mV offset caused by your 67K
> ohm drive resistance and this is due to the diodes as well as the H14 input
> leakage- so you are okay there. The worst case specifications on Vil and VH,min
> [min hysteresis] at 0.9 V and 0.4V resp. look tight. For example, since your
> divider is only 3:1 this translates into about 1.2 Volts of hysteresis referred
> to the 24 V line or about 5% of your nominal input voltage range [ which is 24 V
> and not 12 V ]. The typical hysteresis is 0.9V which is 2.7 V referred to the
> line and about 10% of the input voltage range. It will be difficult to get
> decent noise rejection from this IC because of the nearly 3:1 span in the
> hysteresis voltage specification. I see also that the minimum Vin,high can be as
> low as 1.55 V which is only 4.65 V referred to the 24 Volt line or less than 20
> % of nominal. Doesn't this seem kind of low to you ?

You asked what I had done. I told you. I had a 12V signal, not a 24V.
Naturally you would change the divider for a 24V signal.


> You may be able to improve these numbers by going to a 7.6:1 divider rather than
> 3:1. The minimum hysteresis becomes 3.0V, the minimum Vin,high=11.8V, and
> minimum Vin,low=6.84 V. This 7.6:1 allows for 10% tolerance on the 24 Volt and
> 5% in your divider to guarantee all worst case thresholds are met with 5%
> margin. Notice that these numbers are better because the worst case thresholds
> have been moved away from the rails and more towards midrange which is the
> maximum distance from the noise.

Agreed. For a 24V signal, you would divide it more.


> I am not even going to get into splitting the series resistor with a shunt
> capacitor, the circulating ground currents, or KV level spikes on the input.

I don't know what you're talking about, about splitting the series
resistor with a shunt capacitor. I didn't do it. Are you promoting
this as a refinement?

As for KV level spikes on the input. I know its fashionable to over
engineer the hell out of things. But cost IS an issue. Besides, I wish
you WOULD get into it, as a KV level spike only implies 5 mA of current
through all this, and spike implies pretty darn short term, so the 5W of
power, while definitely exceeding the wattage of what are probably
surface mount components, will probably be harmless.

Robert

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Tom Carlson wrote:

>
>
> I don't know what you're talking about, about splitting the series
> resistor with a shunt capacitor. I didn't do it. Are you promoting
> this as a refinement?
>
> As for KV level spikes on the input. I know its fashionable to over
> engineer the hell out of things. But cost IS an issue. Besides, I wish
> you WOULD get into it, as a KV level spike only implies 5 mA of current
> through all this, and spike implies pretty darn short term, so the 5W of
> power, while definitely exceeding the wattage of what are probably
> surface mount components, will probably be harmless.

You better look into the maximum voltage rating of those resistors- 1KV will arc
across the small ones. Your circuit has not been subjected to a harsh environment- I
wouldn't trust this to survive.

Tom Carlson

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Robert wrote:
> How about this input. Diode clamps not shown but should be included.
>
> o----------
> |
> | +
> zener 3.3V
> | - R1-150K R2- 82K
> x-----------/\/\/\------x------/\/\/\------x------> to HCTTL
> | | |
> / ___ /

> \ R4-1.2K ___ C -2.7uF \ R3-68K
> | | |

> 0-----x---------------------x----------------x-------> ref

SNIP

>
> Why don't you take it from here, Tom.

Aside from the fact that you didn't use a fixed width font, so I'm not
even sure I reconstructed it right, it looks OK. I wonder about the
case you're so concerned about, of a KV level spike. I think your zener
and R4 are vulnerable.

I found your analysis hard to follow. Maybe it's my rustiness, but I
think you could have defined some of your terms more fully. However, it
seems your general obnoxiousness does conceal some actual knowledge.

I'm happy with my current arrangement however. While you may have
optimized your noise immunity, you did it at the expense of two more
components, which, times 30 or 40 inputs, is a significant amount of
board space. (I don't count the low pass filter, as anyone would have
that, it's not germane to the discussion, plus you could debounce in
software, if you were really tight on space)

If you will recall my original response to the poster, I was looking
forward to seeing some other approaches to this problem. Thanks for
showing me this one.

Tom Carlson

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Hmmm. I wonder what the failure mode is? Is it THROUGH the resistor,
or OVER it? I assumed it was OVER it, arcing end to end through the
air, in which case, the potting compound resolves this issue. However,
if it was THROUGH it, you may be correct.

My particular applications are automotive, so I don't worry about KV
spikes much. At least not near as much as I worry about cost.

Robert

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Tom Carlson wrote:

> Robert wrote:
> >
> > Tom Carlson wrote:
> >
> > >
> > >
> > > I don't know what you're talking about, about splitting the series
> > > resistor with a shunt capacitor. I didn't do it. Are you promoting
> > > this as a refinement?
> > >
> > > As for KV level spikes on the input. I know its fashionable to over
> > > engineer the hell out of things. But cost IS an issue. Besides, I wish
> > > you WOULD get into it, as a KV level spike only implies 5 mA of current
> > > through all this, and spike implies pretty darn short term, so the 5W of
> > > power, while definitely exceeding the wattage of what are probably
> > > surface mount components, will probably be harmless.
> >
> > You better look into the maximum voltage rating of those resistors- 1KV will arc
> > across the small ones. Your circuit has not been subjected to a harsh environment- I
> > wouldn't trust this to survive.
>
> Hmmm. I wonder what the failure mode is? Is it THROUGH the resistor,
> or OVER it? I assumed it was OVER it, arcing end to end through the
> air, in which case, the potting compound resolves this issue. However,
> if it was THROUGH it, you may be correct.

It will be through it. The film resistors can only take so much gradient before surface
leakage becomes a problem. For example, the standard metal/ carbon film 1/4 watt leaded
resistors are only rated for 350 Volts regardless of power dissipation. I don't know what
the SMT rating is but if it's a gradient problem then I would expect it to be the same.
You can increase this by stacking resistors in series to achieve the required rating/
value- but there goes your board density..

>
>
> My particular applications are automotive, so I don't worry about KV
> spikes much. At least not near as much as I worry about cost.

I think you should if you want your circuit to be impervious to anomalies like connectors
breaking or other components failing while in operation. You should educate yourself about
the available technology especially in the way of TVS's, transient voltage suppressers,
which are manufactured by dozens of companies, available in every imaginable rating and in
every possible packaging. For example, they are available in SIPs with multiple diodes and
SMT also. Apparently, the majority of applications for your product have been tame enough
not to cause any noticeable problems up to now- but things change.

Tom Carlson

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to
Robert wrote:
> > My particular applications are automotive, so I don't worry about KV
> > spikes much. At least not near as much as I worry about cost.
>
> I think you should if you want your circuit to be impervious to anomalies like connectors
> breaking or other components failing while in operation. You should educate yourself about
> the available technology especially in the way of TVS's, transient voltage suppressers,
> which are manufactured by dozens of companies, available in every imaginable rating and in
> every possible packaging. For example, they are available in SIPs with multiple diodes and
> SMT also. Apparently, the majority of applications for your product have been tame enough
> not to cause any noticeable problems up to now- but things change.

You're tsk tsking me about not making my automotive applications
impervious to 1 kV spikes? Why wimp out and stop there? Let's make
those bad boys impervious to lightning strikes and downed power lines as
well! You don't work in a university by any chance, do you?

I have looked at a lot of TVS's, MOV's, poly fuses, etc., and I don't
find them cost effective for use on general purpose digital inputs.

Robert

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Tom Carlson wrote:

> Robert wrote:
> > > My particular applications are automotive, so I don't worry about KV
> > > spikes much. At least not near as much as I worry about cost.
> >
> > I think you should if you want your circuit to be impervious to anomalies like connectors
> > breaking or other components failing while in operation. You should educate yourself about
> > the available technology especially in the way of TVS's, transient voltage suppressers,
> > which are manufactured by dozens of companies, available in every imaginable rating and in
> > every possible packaging. For example, they are available in SIPs with multiple diodes and
> > SMT also. Apparently, the majority of applications for your product have been tame enough
> > not to cause any noticeable problems up to now- but things change.
>
> You're tsk tsking me about not making my automotive applications
> impervious to 1 kV spikes? Why wimp out and stop there? Let's make
> those bad boys impervious to lightning strikes and downed power lines as
> well! You don't work in a university by any chance, do you?
>
> I have looked at a lot of TVS's, MOV's, poly fuses, etc., and I don't
> find them cost effective for use on general purpose digital inputs.

What is the SAE standard on this subject? I know they have one specifically for noise immunity. If
there is not one yet, there will be one for RF eventually. This is your area of application- tell
me.

Robert

unread,
Apr 7, 2000, 3:00:00 AM4/7/00
to

Robert wrote:

Okay- you won't tell me so I'll tell you. Looks like SAE provides plenty of guidance. This should tell
you where to start and stop. I see all sorts of applicable stuff like 1455, 111312/21/26, 1752/1/2,
1772, 1773, 1879....I wonder if you're in compliance?


>
> SAE Ground Vehicle Standards
>
>
> Subject: Electrical Parts
>
>
>
>
>
>
>
> Document Number / Title
> For more information, click on the document
> number.
> Publication Date or
> Rev. Number
> ARP1817
> Battery Industrial, Lead Acid Type, For Use in
> Electric Powered Ground Support Equipment
> A
> ARP1892
> Electrical Connectors For Use In Battery Powered
> Ground Support Equipment
> B
> AS25481
> Cable Assemblies, Electric Power, for Portable
> Ground Support Test Equipment
>
> ISO6858
> Ground support electrical supplies--General
> requirements
>
> J1105
> Horn Forward Warning Electric Performance, Test,
> and Application
> Sep 1989
> J1113/12
> Electrical Interference by Conduction and
> Coupling?Coupling Clamp
> Dec 1994
> J1113/21
> Electromagnetic Compatibility Measurement
> Procedure for Vehicle Components? Part 21:
> Immunity to Electromagnetic Fields, 10 kHz to 18
> GHz, Absorber-Lined Chamber
> Jan 1998
> J1113/26
> Electromagnetic Compatibility Measurement
> Procedure for Vehicle Components?Immunity to
> AC Power Line Electric Fields
> Sep 1995
> J112
> Electric Windshield Wiper Switch
> Apr 1988
> J1171
> External Ignition Protection of Marine Electrical
> Devices
> Jan 1986
> J1226
> Electric Speedometer Specification--On Road
> Feb 1983
> J1283
> Electrical Connector for Auxiliary Starting of
> Construction, agricultural, and Off-Road Machinery
> Feb 1995
> J1284
> Blade Type Electric Fuses
> Apr 1988
> J1299
> Electrical Propulsion Control?Off-Road Dumpers
> Jan 1991
> J1317
> Electrical Propulsion Rotating Equipment?Off-Road
> Dumper
> Jun 1982
> J1320
> Marine Electrical Switches
> Aug 1987
> J1338
> Open Field Whole-Vehicle Radiated Susceptibility
> 10 kHz--18 gHz, electric Field (Cancelled JUL95)
> Dec 1992
> J1378
> Electric Hourmeter Specification
> Jul 1998
> J1399
> Electric Tachometer Specification
> Jun 1984
> J1428
> Marine Circuit Breakers
> May 1985
> J1455
> Joint SAE/TMC Recommended Environmental
> Practices for Electronic Equipment Design
> (Heavy-Duty Trucks)
> Aug 1994
> J1614
> Wiring Distribution Systems for Construction,
> Agricultural, and Off-Road Work Machines
> Mar 1998
> J1625
> Heavy-Duty Circuit Breakers
> Apr 1996
> J1634
> Electric Vehicle Energy Consumption and Range
> Test Procedure
> Apr 1999
> J1666
> Electric Vehicle Acceleration, Gradeability, and
> Deceleration Test Procedure
> Aug 1999
> J1678
> Low-Voltage Ultrathin Wall Primary Cable
> Feb 1999
> J1715
> Electric Vehicle Terminology
> Apr 1994
> J1752/1
> Electromagnetic Compatibility Measurement
> Procedures for Integrated Circuits?Integrated
> Circuit EMC Measurement Procedures?General
> and Definition
> Mar 1997
> J1752/2
> Electromagnetic Compatibility Measurement
> Procedures for integrated Circuits?Integrated
> Circuit Radiated Emissions Diagnostic Procedure 1
> MNz to 1000 MHZ, Magnetic Field?Loop Probe
> Mar 1995
> J1752/3
> Electromagnetic Compatibility Measurement
> Procedures for integrated circuits?Integrated Circuit
> Radiated Emissions Measurement procedure 150
> kHz to 1000 MHz, TEM Cell
> Mar 1995
> J1772
> SAE Electric Vehicle Conductive Charge Coupler
> Oct 1996
> J1773
> Electric Vehicle Inductive Charge Coupling
> Recommended Practice
> Jan 1995
> J180
> Electrical Charging Systems for Construction and
> Industrial Machinery
> May 1987
> J1810
> Electrical Indicating System Specification
> Jan 1993
> J1811
> Power Cable Terminals
> Jan 1995
> J1879
> General Qualification and Production Acceptance
> Criteria for Integrated Circuits in Automotive
> Applications
> Oct 1988
> J1888
> High Current Time Lag Electric Fuses
> Nov 1990
> J1908
> Electrical Grounding Practice*HS-34/00*
> Jan 1996
> J1930
> Electrical/Electronic Systems Diagnostic Terms,
> Definitions, Abbreviations and Acronyms*HS-34/00*
> May 1998
> J2030
> Heavy-Duty Electrical Connector Performance
> Standard
> Nov 1994
> J2077
> Miniature Blade Type Electrical Fuses
> Nov 1990
> J2120
> Personal Watercraft?Electrical Systems
> Jul 1997
> J216
> Motor Vehicle Glazing?Electrical Circuits
> Mar 1999
> J2223/1
> Connections for On-Board Road Vehicle Electrical
> Wiring Harnesses?Part 1: Single-Pole
> Connectors?Flat Blade Terminals?Dimensional
> Characteristics and Specific Requirements
> Dec 1998
> J2223/2
> Connections for On-Board Road Vehicle Electrical
> Wiring Harnesses?Part 2: Tests and General
> Performance Requirements
> Dec 1998
> J2223/3
> Connections for On-Board Road Vehicle Electrical
> Wiring Harnesses?Part 3: Multipole
> Connectors?Flat Blade Terminals?Dimensional
> Characteristics and Specific Requirements
> Dec 1998
> J2293/1
> Energy Transfer System for Electric Vehicles--Part
> 1:Functional Requirements and System
> Architectures
> Mar 1997
> J2348
> Electric Windshield Washer Switch--Trucks,
> Buses, and Multipurpose Vehicles
> Mar 1997
> J2349
> Electric Windshield Wiper Switch--Trucks, Buses,
> and Multipurpose Vehicles
> Mar 1997
> J234
> Electric Windshield Washer Switch
> Oct 1977
> J2350
> Electric Blower Motor Switch--Trucks, Buses, and
> Multipurpose Vehicles
> Mar 1997
> J235
> Electric Blower Motor Switch
> May 1971
> J258
> Circuit Breaker--Internal Mounted--Automatic Reset
> Jan 2000
> J277
> Maintenance of Design Voltage-snowmobile
> Electrical Systems*HS-34/00*
> May 1995
> J392
> Motorcycle and Motor Driven Cycle Electrical
> System?Maintenance of Design Voltage*HS-34/00*
> Feb 1992
> J541
> Voltage Drop for Starting Motor Circuits
> Oct 1996
> J544
> Electric Starting Motor Test Procedure
> Aug 1996
> J551/17
> Vehicle Electromagnetic Immunity-Power Line
> Magnetic Fields
> Oct 1997
> J551/5
> Performance Levels and Methods of Measurement
> of Magnetic and Electric Field Strength from
> Electric Vehicles, Broadband, 9 kHz to 30 MHz
> Dec 1997
> J553
> Circuit Breakers
> Apr 1996
> J554
> Electric Fuses (Cartridge Type)
> Aug 1987
> J560
> Seven Conductor Electrical Connector for
> Truck-Trailer Jumper Cable*HS-34/00*
> Jul 1998
> J561
> Electrical Terminals--Eyelet and Spade Type
> Jun 1993
> J56
> Road Vehicles?Alternators with Regulators?Test
> Methods and General Requirements
> Jun 1999
> J771
> Automotive Printed Circuits
> Apr 1986
> J821
> Electrical Wiring Systems for Construction,
> Agricultural and
> Jun 1994
> J831
> Electrical Definitions
> Mar 1998
> J858A
> Electrical Terminals Blade Type
> Aug 1969
> J928
> Electrical Terminals?Pin and Receptacle Type
> Jul 1989
> J930
> Storage Batteries for Off-Road Self-Propelled Work
> Machines
> Jun 1995
> J994
> Alarm--Backup--Electric Laboratory Performance
> Testing
> Aug 1993
> J99
> Lighting and Marking of Industrial Equipment on
> Highways*HS-34/00*
> Mar 1986
> USCAR4
> Standard for Cigar Lighters & Power Outlets
> 1
>
>
>
>
>
>


Robert

unread,
Apr 8, 2000, 3:00:00 AM4/8/00
to
Here is some more information. The automotive transient electrical stress is specified in ISO-7647-1, DIN
40839, and SAE J1113. GM has created a specification from these which is GM 9105P. The specifications call
out pulse types and levels characteristic of the components that cause them. For example the alternator
load dump at level II is specified as +50V, 250ms duration, 115ms decay. The ignition coil pulse 5 level 4
is -300 Volt, 300us duration, and 107us decay and so. It appears the KV level is not a consideration. I do
not see any damage occurring to your circuit with these pulses. The only question that remains is the
level of noise on the lines aside from these monsters and how this compares with those puny Schmitt
trigger noise margins. Do you have any of these specs?

Robert wrote:

> >
> > SAE Ground Vehicle Standards
> >
> >
> > Subject: Electrical Parts
> >
> >
> >

Robert

unread,
Apr 8, 2000, 3:00:00 AM4/8/00
to
Bill, Of course this is the solution in lieu of the opto coupler. I was just going through the
exercise of determining how to get decent performance out of those bad Schmitt trigger worst case
specs. It turns out that the individual who suggested this had an automotive application in mind.
The automotive transient environment is defined in ISO 7647-1, DIN 40839, and SAE J1113, and it is
not all that bad. Everything will survive quite well for the specified amplitudes and durations. The
zener can remain a 500mW and R4 can remain at 1/2W. The biggest headache here is that he needs 30-40
copies of this and has size and cost constraints. So he probably should condense R1 and R2 into one,
get rid of C and debounce in software. This leaves him with 3 resistors and a zener versus his
normal 2 resistors. Maybe he can stay with just two resistors but I don't have any information on
the average noise background to be expected.

TheCentralSc...@pobox.com

unread,
Apr 8, 2000, 3:00:00 AM4/8/00
to
On Fri, 07 Apr 2000 14:16:05 -0700, Tom Carlson <ex...@ix.netcom.com> wrote:
>
>You're tsk tsking me about not making my automotive applications
>impervious to 1 kV spikes? Why wimp out and stop there? Let's make
>those bad boys impervious to lightning strikes and downed power lines as
>well! You don't work in a university by any chance, do you?
>
>I have looked at a lot of TVS's, MOV's, poly fuses, etc., and I don't
>find them cost effective for use on general purpose digital inputs.

You find complete circuit replacement to be cost effective?

If you don't deal with at least 250v spikes, your circuit won't last a
week.

Tony Williams

unread,
Apr 9, 2000, 3:00:00 AM4/9/00
to
In article <38EE7B43...@earthlink.net>,

Robert <rom...@earthlink.net> wrote:
> Bill, Of course this is the solution in lieu of the opto coupler.
> I was just going through the exercise of determining how to get
> decent performance out of those bad Schmitt trigger worst case
> specs.

Robert and Bill; I have no quarrel with your sums
nor the philosophies of design, when looked at from
the pov of the inboard electronics only. But you are
in danger of forgetting that it all starts with the
probable inadequacies and peculiarities of where that
24v logic switching is coming from.

240vrms +---------------+
|
=== C
Sw |
24vdc +--+/+----------+---->

0vdc +-------------------->

In general it is a high-side switch, mechanical or
a pnp transistor (say in a proximity detector) fed
by a nominal 24v rail. The practicalities of cabling
means that there is often a capacitive coupling from
various ac supplies into the input.

I have no specs to refer to, but this is my rough take
(from bitter experience) of the numbers involved here;

The "24vdc" could be 18vdc to 32vdc.

The Sw ON-resistance can be 0 to 100 ohms, whilst
the OFF-resistance can be 100k to infinity.

That Sw ON-R assumes that a sufficient wetting
current is used, say 10mA at the nominal 24vdc.

The effect of the ac-coupling could be of the order
of 1 to 2 mArms.
------------------------------------------------------

So what does that mean?

A Logic-1 should be seen when Vin is as low as
18v - (Vpk ripple) - (IR drop from Sw-resistance).
I would say Logic-1 should be seen for 12/15v min
No damage should occur for a continuous Logic-1 of
32vdc + (Vpk ripple).

A logic-0 should be seen when Vin is as high as
0v + (Vpk ripple) + (100k Sw-R flowing). I would say
that a Logic-0 should be seen for 6/7v and below.
No damage should occur for a continuous Logic-0 of
0vdc - (Vpk ripple).... actually (-24vdc - (Vpk)),
because of the possibility of reversed wiring.

If the 24v is a 'system 24v' then a CMRR is req'd,
for an unknown CMV..... it is not good news to find
out on site that the CMV is higher than assumed.

If the 24v is a 'system 24v' then the input network
must provide full input protection when the circuit
is not powered (but the system 24v is!).

It is useful for all general-purpose inputs to have
an inherent RC-filter that rejects logic levels
that do not last for longer than about 1 to 5 mS.
(Additional specific delays in software, as req'd.)

Caveat; All the numbers above are subject to total
and instant change, depending generally on
how much the customer is whinge'ing away,
about cost and size, etc.

--
Tony Williams.

Steve

unread,
Apr 9, 2000, 3:00:00 AM4/9/00
to
Ties Bos wrote:
>
> I am sure this is a pretty basic question, but I haven't been able to track
> down the answer in dejanews.

>
> I need to properly interface a 24 volt industrial system to a
> microcontroller.
> The output pulses of position decoders and the like are in 24 volt. As there
> are also big relays and the like on this 24 volt net, I assume using a
> resistor divider network is not the way to go.
----------------
Why would you think that again? Everybody else does it!


> I hope someone can provide me with a proper circuit to do it.
>
> Thanks,
> Ties.
-------------------
Either a divider or a zener.
-Steve
--
-Steve Walz rst...@armory.com ftp://ftp.armory.com:/pub/user/rstevew
-Electronics Site!! 1000 Files/50 Dirs!! http://www.armory.com/~rstevew
Europe Naples Italy: http://ftp.unina.it/pub/electronics/ftp.armory.com

kapp_...@my-deja.com

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
In article <38EC2B63...@fel.tno.nl>,

R Prevo <Pr...@fel.tno.nl> wrote:
>
>
> Ties Bos wrote:
>
> > I am sure this is a pretty basic question, but I haven't been able
to track
> > down the answer in dejanews.
> >
> > I need to properly interface a 24 volt industrial system to a
> > microcontroller.
--------------

As has been stated, optocouplers are the prime choice. You can improve
the robustness by substituting a current source (self conducting MOSFET
with gate-source Bias Resistor) for the curent limiting resistor. This
will increase the allowable input voltage range. Also, don't forget the
inverse protection diode across the optocoupler's LED to protect your
circuit against reverse polarity of the input signal.

Regards

Harald Kapp

Jonathan Bromley

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
Tony Williams wrote:

<snip>


> you are in danger of forgetting that it all starts with the
> probable inadequacies and peculiarities of where that
> 24v logic switching is coming from.

<snip cynical good sense>

> Caveat; All the numbers above are subject to total
> and instant change, depending generally on
> how much the customer is whinge'ing away,
> about cost and size, etc.

It's great to hear from someone who has apparently learnt in the
same rather unforgiving school as I have. I tend to get quite
hot under the collar when people write saying "why are you making
such a fuss, it's easy, just do it with these two components..."
because they haven't worried about all the issues.

Another interesting one from the same general area: overcurrent
protection of switched 24V outputs. How to do it? The design goals
are:

* each output good for 200mA continuous, 1A surge (up to 1 sec)
* no damage when output is shorted to any accessible power rail
(ground, nominal +24V, +12V etc)
* load on 24V power rail never exceeds 2A for any individual
output, even in fault conditions - so a load fault doesn't
take out the supply to other switched outputs
* no excessive power dissipation during prolonged shorts
* self-resetting with no manual intervention, even if the load
is not removed; no fuses!
* very small footprint (need fifteen or twenty of these on a
small PCB!)
* software can find out about failures
* 3.3V logic level drive to control each output

Maybe I'm missing a trick, but I think this is challenging.
Micrel, Allegro and Texas have some interesting parts, but
not always with the desired behaviour in fault conditions;
and "in the data book" and "available" are not necessarily
synonymous :-)

Jonathan Bromley

Tom Carlson

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
Robert wrote:
>
> Here is some more information. The automotive transient electrical stress is specified in ISO-7647-1, DIN
> 40839, and SAE J1113. GM has created a specification from these which is GM 9105P. The specifications call
> out pulse types and levels characteristic of the components that cause them. For example the alternator
> load dump at level II is specified as +50V, 250ms duration, 115ms decay. The ignition coil pulse 5 level 4
> is -300 Volt, 300us duration, and 107us decay and so. It appears the KV level is not a consideration. I do
> not see any damage occurring to your circuit with these pulses. The only question that remains is the
> level of noise on the lines aside from these monsters and how this compares with those puny Schmitt
> trigger noise margins. Do you have any of these specs?

Took the weekend off. New house.

Noise is hard to quantify in general, as you know. Obviously, more
noise immunity is better, but as I've already stated, there are points
of diminishing returns, where your return on investment for added
circuitry goes pretty low. One of the noise sources that can sneak up
on you is induced current caused from your harness vendor routing the
wiring to one of your PWM driven actuators next to one of your sense
lines. Of course I always specify shielded when cost allows it, but
this is an example of a noise source whose amplitude will change in
different configurations, depending upon the length of parallel travel
in the various harnesses.

Robert

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
So in other words, you go with what you can afford and just hope for the best?

Tom Carlson wrote:

Robert

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to

Jonathan Bromley wrote:

> Tony Williams wrote:
>
> <snip>
> > you are in danger of forgetting that it all starts with the
> > probable inadequacies and peculiarities of where that
> > 24v logic switching is coming from.
> <snip cynical good sense>
> > Caveat; All the numbers above are subject to total
> > and instant change, depending generally on
> > how much the customer is whinge'ing away,
> > about cost and size, etc.
>
> It's great to hear from someone who has apparently learnt in the
> same rather unforgiving school as I have. I tend to get quite
> hot under the collar when people write saying "why are you making
> such a fuss, it's easy, just do it with these two components..."
> because they haven't worried about all the issues.

I can create issues on the fly too. Submit a circuit and I'll create a scenario to blow it to bits
too.

> Another interesting one from the same general area: overcurrent
> protection of switched 24V outputs. How to do it? The design goals
> are:
>
> * each output good for 200mA continuous, 1A surge (up to 1 sec)

A uProc controlled bi-polar driver.

>
> * no damage when output is shorted to any accessible power rail
> (ground, nominal +24V, +12V etc)

Why stop there? What happened to the 220VAC?- and how shall this connection be made?-differential on
the control pair?-or just either line to earth ground?

>
> * load on 24V power rail never exceeds 2A for any individual
> output, even in fault conditions - so a load fault doesn't
> take out the supply to other switched outputs

Doesn't this follow from the 1A maximum surge for 1 second?

> * no excessive power dissipation during prolonged shorts

Okay- so "continuous short circuit protection." Is this something new?

> * self-resetting with no manual intervention, even if the load
> is not removed; no fuses!

Sounds like a try-again restart- nothing new here.

> * very small footprint (need fifteen or twenty of these on a
> small PCB!)

This one is kind of vague. How small?- a 1x1 postage stamp?

> * software can find out about failures

Done deal- not exactly like no such thing as testability CAD.

> * 3.3V logic level drive to control each output

If the drivers are PNP pull-ups then where is the trick?

> Maybe I'm missing a trick, but I think this is challenging.
> Micrel, Allegro and Texas have some interesting parts, but
> not always with the desired behaviour in fault conditions;
> and "in the data book" and "available" are not necessarily
> synonymous :-)

Send them the extra bucks to develop the circuit you need.

Robert

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to

Tony Williams wrote:

> In article <38EE7B43...@earthlink.net>,
> Robert <rom...@earthlink.net> wrote:
> > Bill, Of course this is the solution in lieu of the opto coupler.
> > I was just going through the exercise of determining how to get
> > decent performance out of those bad Schmitt trigger worst case
> > specs.
>
> Robert and Bill; I have no quarrel with your sums
> nor the philosophies of design, when looked at from

> the pov of the inboard electronics only. But you are


> in danger of forgetting that it all starts with the
> probable inadequacies and peculiarities of where that
> 24v logic switching is coming from.
>

> Caveat; All the numbers above are subject to total
> and instant change, depending generally on
> how much the customer is whinge'ing away,
> about cost and size, etc.
>

> --
> Tony Williams.

The zener shifted attenuator or comparator handles everything except possibly CMV. Is the message
that it is impossible to design a general purpose input- that each design must be customized to the
installation? I know that the relay approach takes care of all these problems- but what if the duty
is too high to make a relay practical.


Spehro Pefhany

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
The renowned Robert <rom...@earthlink.net> wrote:

> .. I know that the relay approach takes care of all these problems...

Relays don't necessarily deal with the CM problems, especially if there is
a high dv/dt.. coil-to-contact capacitance is non-zero (and unspecified),
most relays do not have a shield between them. You *can* get shielded
optos.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.BlueCollarLinux.com

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Tony Williams

unread,
Apr 11, 2000, 3:00:00 AM4/11/00
to
In article <38F260EC...@earthlink.net>,
Robert <rom...@earthlink.net> wrote:

> Tony Williams wrote:
> > Robert and Bill; I have no quarrel with your sums
> > nor the philosophies of design, when looked at from
> > the pov of the inboard electronics only. But you are
> > in danger of forgetting that it all starts with the
> > probable inadequacies and peculiarities of where that
> > 24v logic switching is coming from.

[etc]

> The zener shifted attenuator or comparator handles everything
> except possibly CMV. Is the message that it is impossible to
> design a general purpose input- that each design must be

> customized to the installation? I know that the relay approach


> takes care of all these problems- but what if the duty
> is too high to make a relay practical.

Any message (such as it was) is that industrial logic lives
in a dirty environment and unless you take care you can lose
serious money on a job...... because the most expensive place
in the world to mend a design is when on the customers' site.

The direct-coupled circuit is ok, but (imo) you have to 'own'
the 24v yourself (and it's 0v return) in order to be really
secure about CMV and the power-off protection.

The differential comparator is also ok, provided you design
in sufficient CMV-capability (a negative rail is probably
not available). It has the disadvantage that the component
cost/space is about the same as the opto-isolated input.

(Actually, an RS485 differential receiver chip could be a
better bet for direct-coupled differential interfacing,
notably for its inherent CMV capability, even unpowered.)

The preferred general-purpose input is quite clearly the
opto-isolator, provided the sensitivity/loading/timing
is designed with the source deficiencies in mind. Note
the need on optos to cope with the production spread of
Gain, and the tendency for that Gain to reduce with age.
Opto is the main choice of the real experts in this field,
the PLC manufacturers.

The sealed au-au miniature relay is good for a novice in
industrial logic (the original questioner I think) because
it provides isolation and the input sensitivity/loading/
timing is inherently about right for reliable interfacing.
2x protection diodes, the relay, and an inboard resistor.
No further job-knowlege needed, no costly ambush on site.

Which is why I still think that Jonathan Bromley had it
about right, on (roughly) post no.2 of this thread.

--
Tony Williams.

Tony Williams

unread,
Apr 11, 2000, 3:00:00 AM4/11/00
to
In article <38F1CE73...@brookes.ac.uk>,
Jonathan Bromley <jsebr...@brookes.ac.uk> wrote:

> * each output good for 200mA continuous, 1A surge (up to 1 sec)

> * no damage when output is shorted to any accessible power rail
> (ground, nominal +24V, +12V etc)

> * load on 24V power rail never exceeds 2A for any individual
> output, even in fault conditions - so a load fault doesn't
> take out the supply to other switched outputs

> * no excessive power dissipation during prolonged shorts

> * self-resetting with no manual intervention, even if the load
> is not removed; no fuses!

> * very small footprint (need fifteen or twenty of these on a
> small PCB!)

You obviously need a glass package with 15-20 24v/20W
lamp filaments inside. :-)

> * software can find out about failures

That's why it has to be a glass package, to be able
to mount a photocell under each filament........

--
Tony Williams.

R.H. Disco

unread,
Apr 11, 2000, 3:00:00 AM4/11/00
to
Most people will recommend a division of the voltage so that ttl level is
achieved.
This is alright, but u have to filter the signal also....otherwise youre cpu
can be damaged by
spikes and signals received on the lines. Use an RC filter......


signal-------R----------------R-------- cpu
|
|
C
|
|
Ground

Ties Bos <tb...@huygens.org> schreef in berichtnieuws
8cfilr$7lc$1...@ares.cs.utwente.nl...


> I am sure this is a pretty basic question, but I haven't been able to
track
> down the answer in dejanews.
>
> I need to properly interface a 24 volt industrial system to a
> microcontroller.

> The output pulses of position decoders and the like are in 24 volt. As
there
> are also big relays and the like on this 24 volt net, I assume using a
> resistor divider network is not the way to go.
>

0 new messages