Tuesday, March 23, 2010

LCB #4, PART 2. SWITCHES, and high-level interfaces.

More on switches, and how to use high-level interfaces for reliable performance.                                                                                                                                                                             

In LCB#4, Part 1, I discussed "dry circuit" switches and how they can be easily and directly interfaced to  low-voltage logic.  "Dry circuit" switches are acceptable in this application because they do not require high contact voltage and current for reliable operation.

Unfortunately, there are many cases when a heavy-duty switch must be used.  Examples include oil- tight industrial switches, key switches, automotive switches, high-current relays, etc.  In this case it is necessary to switch high voltage and high current to keep the contacts clean.  In many systems there is a 24V DC supply available for driving loads and operating other devices, and this auxiliary supply can be conveniently used to provide the switching current.  Of course, the 24 Volts must be translated down to the logic voltage, which we will assume is 5V.  Please see Figure 1.



An almost OK circuit:
This circuit is acceptable for casual, non-critical applications.  The use of a relatively low-value pullup resister R1, connected to +24V, insures that the contacts will stay clean.  When the switch is open, the voltage at point A will be close to 24V, and the voltage at point B will be clamped to about 5.6V by the internal diode at the gate.  The value of R2 is not critical; high values may cause problems with leakage, and low values will not limit the internal diode current to a safe value.  20K-50K is usually OK.

The internal input diodes are usually rated at 10MA, and with the values shown the current will only be about 0.8MA.  This is OK when reliability requirements are not extreme.  Noise immunity is particularly good when the switch is open because of the low impedance at B provided by the forward-biased input diode.  When the switch is closed, the capacitor provides a low impedance at B.

If you are concerned about the internal-diode current, you may add a resistor in parallel with C.  Select the resistor to reduce the voltage at B, with the switch open, to equal the logic voltage.  The divider action will  improve, somewhat, the noise immunity when the switch is closed.

Although you can usually get by with this simple circuit, let's see what happens when when point A is hit with a static discharge.  This can easily happen because many switches are simply not provided with much insulation.  Since your circuit represents a ground, an arc can penetrate the switch and strike the contacts.  Assuming the "Human Body Model" (100 pfd charged to 5KV to 10KV or more), a discharge will raise point A to a high positive or negative voltage.   This will produce a high current (1/4A or more) through R2.  Most of the energy will be absorbed by C, but the input protection diode may still be briefly stressed with high current.

The above discussion is based on the fact that R2 will limit the current.  Unfortunately, this may not always be the case;  a high-voltage static discharge can merrily arc across R2 and produce a dangerously high current in the gate protection diode.  This can readily happen if a small SMT part is used for R2.

One solution is to use several resisters in series for R2, as shown in Figure 2A.  If you are using 1/4W resistors, use 3-4 in series; with SMT resistors, it is a good idea to use 5-6 in series.


A pretty good circuit:
                                                                                    
If this is a little clumsy, or if you are paranoid about static, you can use a transient protection element from point A to ground; this will clamp the discharge.  This could be an MOV, a transient-rated Zener, or even a neon lamp.  Just to add to your worries, remember that if you clamp the discharge you will be producing a fast, high-current transient (the spark), which can radiate RF and produce nasty transients in nearby circuits.  For this reason, you are often better off without clamping the transient and just carefully limiting the current via R2 (no spark).

There are other circuits which use additional diodes to prevent the gate's protection diodes from conducting any current at all.  An example is shown in Figure 3.


A really good circuit:



In this circuit, a large transient voltage at pt. A will be safely clamped, at pt. C, to about 0.7V above the 5Vsupply, or to 0.7V below ground.  The current will be limited by R2.  Resistor R3 is very important:  since the voltage at pt. C is likely to exceed the turn-on voltage of the internal diodes (if only by tenths of a volt), it is necessary to include R3 to provide current limiting for the internal diodes.  This is a very rugged circuit, as long as you use several resistors in series for R2.

Concluding, the circuits shown here are good for driving logic with big, ugly switches or contacts.  They also provide some noise immunity and conditioning for applications where the switches are located far away (up to tens of feet, depending on the environment; shielded cable may help).  However, they are not a substitute for opto-isolated circuits or line receivers that can reject high levels of noise.  More on this sometime in the future.

Don't forget contact bounce!!!!!!!

No comments:

Post a Comment

Followers