Controlling Inductive Loads With a
Microcontroller
Basic Circuit to Control the Inductive Load
- Problems with this basic circuit.
- In this circuit the MOSFET acts as a switch. Just like
the demonstration in the previous class we know huge voltage
spikes will build up across the MOSFET (switch) as it is
turned on and off. These voltage spikes can be great enough
to burn out the thin metal oxide electrical insulation
between the gate and the substrate of the MOSFET.
- There is a floating gate between the microcontroller and
the gate of the MOSFET. This is a BAD design.
- Wires connected to the gate of a MOSFET should never
be left at an undefined state. Magnetic and or electric
fields can induce voltages in the line and spontaneously
turn on or off the MOSFET (example during microcontroller
startup) .
- In addition the metal gate separated from the
substrate in the MOSFET by the metal oxide
insulating layer creates a capacitor which will tend to
pass alternating (changing) voltages. The high voltages
created across the MOSFET when the the inductive
load is switched on and off can pass into the gate
circuit by this capacitance and my burn out the output
circuit inside the microcontroller.
- The voltage spikes created in this circuit (and any
circuit with fast switching and/or inductive circuits) can
pass through signal or power lines to other parts of the
circuit causing malfunctions and or failure.
Circuit Solution to Switching Inductive Loads
- The following circuit shows seven strategies to manage the
voltage spike problem when switching inductive loads. (Some of
these strategies are applied to mechanical switch circuits to
prevent electrical arcing as well.) Some of these strategies are
very common and should be done in every circuit and some are done
only when circumstances warrant.
- Recirculating Diode (also called clamping diode) placed
around the inductive load.
- This is almost always done. In fact many relays come
with this diode built right in.
- When the magnetic field of the inductor collapses
(when the circuit is switched off), it creates a voltage
opposite in polarity to the voltage which was applied to
it. (If + was at the top of the inductor when power was
applied then a + will be created at the bottom of the
inductor when the magnetic field collapses.) The
recirculating diode is reverse biased when the inductor
is operating but will conduct when the inductor is shut
off because it will be forward biased. This has the
effect of reducing or virtually eliminating the voltage
spike by providing a current path across the inductor
when the switch is shut off.
- As a rule of thumb the current capability of this
diode should be at least as great as the current required
by the load. (If there is a 1 A coil then use a 1A diode.
In many cases a general purpose power diode can be used.
(1N4001 is a 1A general purpose power diode, 1N4002 is 2A
and so on)
- As seen in the previous lesson demonstration, the
voltage spikes created can be very short in time
duration. In many cases general purpose diodes actually
switch too slowly to correct the problem. Ideally a type
of diode which switches faster called a Schottky diode is
used for recirculating and clamping functions
- Clamping Diode placed across the MOSFET.
- During normal circuit operations this diode is
reverse biased. This diode provides a current path if the
inductive load creates an electrical potential (voltage)
lower than ground.
- Because of the construction of many power
mosfets this diode is often actually built into the
devise. (see the data sheet for an IRF520N) It is not a
good idea to count on this internal diode, and it is
suggested that an additional diode be added
externally.
- see notes in #1 about type and current rating
of diode.
- Snubber Capacitor
- The capacitor is often added with or without a series
resistor, and in addition to or instead of a
recirculating diode.
- The idea is that the capacitor will give a current
path (to charge up the capacitor) between the ends of the
inductive load, when the inductor has been switched off.
The effect is to greatly reduce the magnitude of the
voltage spike.
- It is suggested that a 0.1 to 1 uF polyester type
capacitor is connected across a motor. (Braga)
- Pull Down Resistor
- A Pull Down Resistor should always be connected to
the gate circuit so that in absence of a signal the gate
circuit is off. (In some cases a pull up resistor may be
used.)
- The magnitude of the pull down resistor is not
critical, a suggested range is between 100k to 1M.
- In the event that voltage is induced (from magnetic
or electric fields) the resistor provides a path to
ground. (Note: for this reason it is a good idea to keep
wires connected to the gate of mosfets short)
- Zener Diode
- A zener diode is a type which will conduct in reverse
(reverse breakdown) at a very specific voltage.
- As shown the zener will have no effect on the circuit
(since it is reverse biased) until this reverse voltage
is exceeded. If we chose for example a 6 volt zeener,
then it would limit the voltage in the gate circuit to 6
volts. If 6 volts were exceeded the zeener will conduct
to ground.
- Series Resistor
- A series resistor of suggested values between 1k to
10k can limit the current in the gate circuit. This can
crreate a slight delay in operation of the gate which
need to be considered for high speed switching. (Since
the gate acts as a small capacitor, this resistor
effectively makes an rc circuit.) Adding this resistor
can eliminate a condition called latch up. Latch up is a
condition where the mosfet transistor stays on and will
not turn off. (The cause is complicated except to say
under certain conditions the mosfet acts as an PNPN
devise called a silicon controlled rectifier or SCR) One
suggestion to prevent latch up is to limit the current in
the gate circuit to less than 20 mA.
- Protection diode
- On rare ocassion a diode will be introduced
into the gate circuit. This would prevent any positive
pulses from feeding back into the microcontroller.
- Decoupling Capacitors
- Spikes caused by high speed switching can be
transferred down the power lines to the power supply of other
components of the circuit. It is for this reason we use
decoupling capacitors. The decoupling capacitor has the effect
of absorbing the electrical voltage spikes.
- Often ceramic capacitors charge and discharge too slowly
for high speed switching applications. For this reason a super
fast type of capacitor is usually specified called a tantalium.
(This is the capacitor which you have been connecting to the
power supply of the pic microcontroller for the last
year.)
- The value of a decoupling capacitor is typically between
0.1 to 0.22 uF. (p193,
Clark)
- In addition capacitors of a value between 1000 uf to 10 000
uF are placed across the power supply to provide the inrush of
current which occurs when a motor starts. (p79,
Braga)
- Final Circuit to Control the Relay
Technological Design
Home