Chapter 7 – Circuit analysis, Example circuits and projects

From MKRD.info Wiki

NOTICE: As a courtesy, you are viewing a preview version of an upcoming book, Transistors and Semiconductors: Clearly, Simply, Intuitively, and Concisely Explained by Michael LoneWolf. Since this is just a preview, the text below has been stripped of formatting and images. I need YOUR help to have this book published. Please HELP by visiting my Funding Request page at the main website. DISCLAIMER: This is an obsolete (draft) version of book manuscript. It is not intended to be used for study or reference, but for book preview purposes only. Support the project so that you can purchase a print copy of the most up-to-date book version with all formatting and illustrations!



This chapter will list a limited collection of circuits, and brief explanation of their analysis and design. Circuits have been organized into categories by their function. However, the basic circuit building blocks are universal and can certainly be used in any other application or for any other function! The criteria for selection of these circuits were:

Be fun, exciting, and novel!

Be different from the same-old circuits found elsewhere

Be practical

Be relatively easy to build for a novice

Illustrate useful concepts

Note: I have listed circuits which go somewhat beyond the knowledge presented in this book. I personally think that being given a challenge is the best way of learning. However, circuit analysis skills, an ability to interpret and research datasheet information, and a few years of hobby circuit building may be required to enjoy circuits presented here.

Don't forget about how engineers design circuits. They don't know everything about building all types of circuits. One person's knowledge is usually willingly chosen to be a narrow specialty. One person by himself has to cheat by using circuits from the datasheets and Application Notes (which every company has on its website), modifying only the parts which need to be modified. Most IC circuits are variations of Typical Examples given in the datasheet.

Just like engineers, we will spend some time looking around in datasheets, application notes, and electronics parts distributors' websites. A free circuit here and there certainly does not hurt!

7.1 Circuit analysis

Real-world circuits are not as simple as circuits we have covered so far. However, they fundamentally consist of building blocks, each of which is one of the circuits we have already covered. Besides the building blocks, circuits contain components which interconnect one block to another, and components which serve a purpose of their own.

When starting out, it is beneficial to make a paper copy of the circuit, and use a pencil to draw lines around each separate circuit block. Then, each block is analyzed for:

What is the circuit type (by method of connection)?

What are parameters of the circuit (or its mode of operation)?

Which calculations can be made on the circuit components? What are its: bias, parameters, input and output characteristics?

Circuit blocks containing ICs are analyzed by reading the IC datasheet and finding out what the requirements are for external components, and the function of those external components.

7.2 What to do when a circuit does not work

Everyone wants to have the circuit working as soon as power is applied, but this doesn't always happen. Since troubleshooting requires some skill, and since troubleshooting failures can be discouraging to novice experimenters, here are a few pointers:

After building a circuit, and before powering it up for the first time:

Invest in a current-controlled power supply. Set the current limit to 1.5x predicted circuit current draw before connecting the power.

A resistance check from an unpowered circuit's VCC or VDD to COM can reveal any shorts. The resistance should certainly not be lower than 100Ω.

Do a visual check of a circuit you have just built, and verify all connections.

Briefly power on the unit and note the current draw, either by an ammeter, or from a current reading of the power supply.

For circuits such as class-A amplifiers, verify the known circuit specifications such as quiescent current.

More extensive troubleshooting tips are given in Appendix A.

Often, a circuit taken from an old book or an old schematic, and built with modern equivalent parts, or parts from the no-idea-where-they-came-from miscellaneous collection of parts do not work immediately after power is connected. It is helpful to have an understanding of how the circuit works before building one, and which parameters can be measured to verify that the circuit was designed and built correctly. Briefly, here are some illustrations of frustrating non-working circuits from when I was starting out at the young age:

A bull-horn class-A emitter-follower amplifier which specified an obsolete transistor. When built with a modern transistor, all component values should have been recalculated for the appropriate Q-point.

A comparator which was not working as I imagined it to work because it used an “open collector” configuration.

A J-K flip flop which wasn't working in a toggle application because what I actually needed was a toggle flip-flop. Make sure you know what an IC does instead of assuming knowing what it does.

An opto-interrupter which did not work with a digital gate because the control current was tiny. A digital-output interrupter, after an additional shipping cost and wait, worked as expected.

A photo sensor circuit from an old book, which was designed for an unknown LDR device, and which needed to have its bias and operating resistance recalculated.

An extensive write-up is available for each of the circuits shown at

http://www.MKRD.info/SemiconductorsBook

including in-depth circuit analysis, BOM with alternate parts, and direct links to electronic parts. Discounted parts kits, PCBs, a forum for support, as well as more advanced circuits are available as well!

7.3 Power circuits

Transformer-based power supply

The basic wall-wart style transformer-based power supply is:

Fig 7.1

Since most books omit analysis of this fundamental circuit, I want to cover some important details:

The transformer must have a secondary winding voltage rating several volts higher than output requirement. NOTE: transformer secondary winding voltage is given at a specified load. Unloaded, the voltage is higher, by as much as 3V for wall-wart type units. Devices within the power supply, as well as the load itself, must be aware that this power supply is not regulated.

Fuse F1 will see a current which is less than the maximum output current by transformer turns ratio. Fuse rating should be about 2 times that current. Note that during power-up the capacitor will need a lot of current to charge, therefore the fuse must be a slow-blow type. In wall-wart units, the fuse is actually a thermal protection feature device, and it is placed inside the transformer.

The diode bridge, either a module or from four discrete diodes, will drop a voltage of 2*VDF, and it will therefore dissipate I*V heat. If Schottky diodes are used, then the total voltage drop will only be about 0.6V.

Finally, the power supply must either be in an isolated plastic casing, or in a grounded metal enclosure. Either way, all AC line voltage precautions must be made at the transformer primary side of the circuit. All commercial units must be UL approved. Since this circuit is AC powered, I do not recommend that the user experiments with transformer based power supplies. We have more exciting things to experiment with at the low voltage side of things.

The outlet AC voltage amplitude on the transformer primary is reduced by the turns ratio, and is applied across the secondary winding. The transformer converts most of the power from the primary to the secondary. So that the P = I * V is conserved, the current on the secondary is therefore the turns ratio times the current in the primary.

The diode bridge then converts the AC nominal voltage of the secondary into a pulsing DC output.

The peak-to-peak voltage at the rectifying bridge is given by the formula

The pulsing DC is not a proper output to drive any electronic device. The filtering capacitor is then used to smooth out the output. This capacitor will be charged at the peaks of the pulsing DC supply, and will release its charge when voltage level drops:

Fig 7.4

The filtering capacitor value is calculated as follows. Its capacitance should be, as a rule of thumb,

, where C is capacitance, I is rated supply current, f is the AC frequency, and VR is the acceptable amplitude of ripple.

One or two volts is an accepted amount of ripple if a voltage regulator is placed after the capacitor. Capacitor voltage rating must be at least 1.5 times the maximum unloaded voltage of the secondary.

The capacitor draws a very large amount of current for a brief time when the power supply is plugged in, and the transformer throws a voltage spike when the power supply is disconnected from the outlet. A good power supply design will have circuit components which will reduce both of these undesirable transient events. A snubber across the primary will dampen transients when the power supply is disconnected.

Also, a bleeder resistor should be placed across the capacitor. The bleeder resistor discharges the capacitor in about 30 seconds when power is disconnected to safeguard both the user (which will expect no output voltage if the unit is not plugged in) and the technician (which will be troubleshooting inside the unit after disconnecting the power).

In the complete schematic below, and additional component is shown, which is called a power entry, or inlet filter module. It contains an inductor and capacitors which do a double duty of not allowing high-frequency or transients into the power supply, as well as not allowing such things to move from the power supply and back into the outlet. This module often contains a cord connector, a fuse, and a power switch all in a single package!

There is an innumerable combination of voltage regulator circuits of all kinds (circuits consisting of Zeners, pass transistor, op-amps, etc). We will only explore the popular three-terminal voltage regulating devices.

Three-terminal voltage regulators

The simplest IC to start our discussion with is the 78XX series of voltage regulators. The XX in an IC part number stands for several possible values. A 7805 is a five-volt regulator, while a 7812 is a twelve-volt regulator, and so on.

Fig 7.6

This device delightfully simple to use! Task for the reader: go thru the 7812 datasheet!

The benefits of using a simple voltage regulator on the output of unfiltered “wall-wart” type power supplies are many:

Unloaded voltage no longer exceeds specified voltage. (Unloaded voltage of wall-warts may be higher than stated output voltage by several volts)

Short circuit protection. 38XX and LM317 are internally protected against output shorts.

Great reduction of ripple voltage and noise

The last point is important. Even when using a capacitor of large value, there is still ripple and the noise of 120Hz on the output. A voltage regulator outputs a set voltage no matter what the input voltage is, therefore ripple is reduced by the regulation action.

LM317 variable voltage regulator

Next up the excitement scale is the LM317, an adjustable three-terminal voltage regulator.

Fig 7.7

Looking at the datasheet, we see that the value of the adjustable resistor is calculated from an equation. But they also give us a typical value of 5k. We will go the easy route! The “applications” section of the datasheet also lists some neat circuits. More fun circuits await in the company's Application Notes. By the way, Application Notes is where engineers steal all of their circuits from. Don't tell anyone.

Note that linear voltage regulators have to dissipate PD = IOUT*(VIN – VOUT). They also cannot produce an output which is lower than VIN + 2V. The 2V is a typical drop-out voltage, or the voltage which will be “dropped” by the regulator as it is regulating the voltage. There are also low-dropout regulators available, and are recommended for the reader to use.

Constant current regulator with a LM317

While it was designed for voltage regulation, LM317 datasheet lists some simple current regulator circuits. This device can be used if the necessary current is in the range of 50mA – 1.5A.

Fig 7.8

R1 must be in the range of 0.8Ω ≤ R1 ≤ 120Ω

Output current can then be calculated from

The adjustable resistor R1 should consist of two resistors, a 25Ω, 3W (RadioShack) rheostat in series with a 1Ω, 2W resistor. This is a recommended configuration, so that the rheostat will change the current from 50mA to a maximum of 1.25A.

Hobby voltage- and current-adjustable power supply

Fig 7.9

Since it is not safe to play with AC voltages, we are going to re-purpose one of the wall-wart unregulated power supplies everyone has lying around. Even better, an old laptop power supply can be used, which is smaller, more efficient, and provides higher voltage and current. The power supply is connected to the “In” terminal of the Fig 7.8. On the “Out” terminal, there's a current- and voltage-controlled output. A built-in feature of this circuit is short-current protection, along with over-temperature shutdown.

I recommend that you build this circuit on a PCB, and provide several connection options on the output – banana and wire post options at the minimum. This will be a circuit you'll use often. If you have read the book without building the circuits listed because you did not have a power supply, then it's a good idea to read thru the book again, with this circuit on hand.

As I have mentioned, on my website I have additional help with all of the circuits listed, a forum where you can ask questions and participate, as well as PCBs and discounted parts kits for sale.

If the reader needs more voltage or current than a wall-wart or a laptop power supply provides, then there is a dirt-cheap power supply option available with a very high ratio. It is used or free, thrown out computer power supplies. Below is the pinout for the main, motherboard connector. Additional connectors for IDE, SATA, etc provide duplicate power rails.

Color

Signal

Pin

Pin

Signal

Color

Orange

+3.3 V

1

13

+3.3 V

Orange

+3.3 V sense

Brown

Orange

+3.3 V

2

14

−12 V

Blue

Black

GND

3

15

GND

Black

Red

+5 V

4

16

Power on

Green

Black

GND

5

17

GND

Black

Red

+5 V

6

18

GND

Black

Black

GND

7

19

GND

Black

Grey

Power good

8

20

Reserved

N/C

Purple

+5 V standby

9

21

+5 V

Red

Yellow

+12 V

10

22

+5 V

Red

Yellow

+12 V

11

23

+5 V

Red

Orange

+3.3 V

12

24

GND

Black

Fig 7.10

Shaded pins are control wires. Pin 16 (Power On) is pulled up by the power supply, and must be driven low for the power supply to enable outputs. Pin 8 (Power Good) is high only if output rails are at proper voltages, and low if they aren't. I sell an enclosure on this book's website which properly houses and cools two computer power supply units. The two units can be connected in series for 24V, or for ±12V output, along with other combinations. This enclosure includes a plethora of options to connect with the many outputs.

USB power

USB ports provide 5V at a maximum of 0.5A per port. When a device is initially plugged in to the port, a maximum of 100mA is supplied. The device must not draw more than this, and it must follow an enumeration procedure if it wants to request the full 500mA. The process of enumeration involves the unit telling the port what exactly it is, and what it wants.

Maxim has two articles on charging from USB: Tutorial 4803 – The Basics of USB Battery Charging: a Survival Guide, and Tutorial 3241 – Charging Batteries Using USB Power.

There is only one IC on the market, MAX8895 which does not require a microcontroller to get the 500mA from USB, legally. However, since the datasheet is top-secret, I have no solution but to reveal a dirty secret: most USB ports provide at least 500mA without you having to ask for it. For reasons of cost, a whole bank of computer USB ports is protected by a single high-current PTC Resettable Fuse (an automatically resettable fuse). Those funky Asian USB-powered devices (reading lights, toys, coffee cup warmers, desktop fans, even keyboard vacuum cleaners!) draw more than 500mA, and they do not even bother to communicate with the USB port.

One of the following should be used inside your device to protect the USB port of the host device:

A PTC Resettable Fuse (or a PolySwitch™) with a holding current rating of 500mA

A specialized USB current limiter (or an “electronic current switch”) such as NCP380/NCV380, TPS2140/41/50/51, MAX1931, MAX1946, LTC3101

An input-current-limited DC-DC switching controller, such as LT1618

A specialized chip designed to be powered off USB (such as USB Ni-MH (DS2710) or Lithium battery charger (MCP73837/8))

12V to 5V USB car adapter and charger, 1A

The USB specification states that 100mA at 5V is available to a device when it is plugged in. If the device properly enumerates (identifies itself), it can request up to 500mA of current. The USB specification has been revised to support what are essentially wall-wart power supplies with a USB connector as the output jack. These power supplies are used by modern electronics such as cellphones for a universal and standardized power source, which can quickly charge the battery of the device. Fast charging is enabled by the fact that such a power supply is allowed to be able to deliver more current than 500mA without the need for enumeration.

Fig 7.11

The USB connector on the output serves as a Dedicated Charged Port, outlined in the USB Battery Charging Specification (v1.2). Note that a 1A 7805 part with an adequate heatsink is required, since a DCP can supply more than the usual 500mA USB current. The specification states that R2 should be a short, but we will use 10Ω in case some idiotic non-conforming device ties data lines to a power rail. Output indication LED D2 is a good idea, in case the adapter or car fuse blew or the ignition key must be turned ON for power to be supplied to the cigarette adapter. Note that an electronic device may actually expect as much as 1.5A from a DCP, which will of course cause the 7805 to shut down. However, while the RadioShack 7805 is rated for 1A, several companies make a “7805” device which can handle 1.5A or more. And also please don't make the LED red in color. Since it is indicating “Power OK”, it must be green. Fuse F1 must be user-accessible. If it is not visible, the unit must have a label stating that it is fused, as well as location and current rating of the fuse. Any device oriented towards the mass consumer should think of details such as these and not assume something which might not exist (attention from the user, understanding of car's electrical system, intelligence, etc, etc).

7.4 Light circuits

Constant current regulator with a JFET

Fig 7.12

A JFET with gate shorted to source becomes a constant-current source. However, JFETs with high IDSS are no longer sold. The best device I could find is an NXP Semiconductors PMBFJ108,215 (Digi-Key Part Number 568-2078-1-ND). Its maximum IDSS is 80mA. I don't expect an average device to be above 50mA, but that is good enough for most LEDs. This JFET is only available as a SMD part.

If a potentiometer is placed between source and the output, then the current can be adjusted all the way down to zero. This JFET current source will make a great 10/20mA universal LED tester.

Constant current regulator for LEDs with a LM317

LM317 can be used if a large LED test current is needed.

Fig 7.13

Adjustable resistor R1 consists of two resistors: a 100Ω potentiometer in series with a 20Ω resistor. This is a recommended configuration, since the rheostat will change the current from 10mA to a maximum of 63mA. These currents are sufficient for high-brightness or medium-power LEDs.

Note that voltage VIN must not be more than a few volts (drop-out of LM317) above the highest forward voltage of the LED being tested, for safety of the device. For example, if this circuit was connected to a VIN of 24V and it was connected to the LED with reverse polarity, then the current source would place the entire 24V across the device, destroying it by exceeding the reverse voltage limit. Since typical LED forward voltages are 3-4V and a typical drop-out voltage of LM317 is 2V, then 9V is sufficient.

Resistorless LED drivers

So far we have used either a voltage dropping resistor or a transistor acting as a resistor to drive low-power LEDs. This is inefficient. For higher-power LEDs above a few tens of milliamps, it even becomes impractical and pointless.

A specialized switching driver IC is used in these cases. Among the features which can be implemented with a specialized IC or discrete circuit are:

Boost DC-DC converter if battery voltage is less than LED VF. Among the “boost” converters, there's the Linear Technology LT1618.

High efficiency Buck DC-DC converter if power supply voltage exceeds VF. Examples for the reader to look at are ON Semiconductor NCP3066 and NCL30100, Infineon ILD4035, National Semiconductor LM3405, etc.

Settable current by either a resistor or digital control

LED brightness control with PWM

I have included many datasheets to look at in the complimentary datasheet compilation for this book.

Commercial-grade LED modules and drivers

Many high-power "white" LED modules are not RGB combinations, as may be done at low power, but are a UV LED module which illuminates a phosphor coating, which then gives off "white" light. Fluorescent lighting uses the same principle. The tube with a gas inside produces UV light. The white coating on the tube converts UV light into "white" light.

This usually results in a "cold" white light which is a poor imitation of real sunlight. "Warm" whites are usually easier on the eye and reproduce colors of surfaces more closely to sunlight.

We are going to look at a 1W high-power white LED module from Cree, XPGWHT-L1-0000-00H51-STAR (Digi-Key 955-1019-ND, $10.65 @1).

Fig 7.14

The small device in the center is the LED module itself. The large white plate is the device mounting and heat transfer plate. Four copper pads are soldering terminals. An additional heatsink is needed, such as Wakefield Thermal Solutions 882 Series. Heat and current management is required in order to ensure reliable and long LED life.

Let's see if we can find a way to power this LED from two AA rechargeable battery cells. We will be using two cells, and will be discharging them in about 6 hours. From my personal experience, 1-3W of LED illumination is a good amount of light in "flashlight" applications.

We now need a driver IC which was designed to be powered from rechargeable cells. Its specifications should be:

Designed specifically for Ni-MH cells

Switching-mode

Turn off when cell voltage drops below 1V to avoid severely shortening battery life span from deep discharge

Constant-current output

PWM brightness control

Optionally, monitor battery cell and LED module temperatures

Fig 7.16

For low battery indication, the output can be reduced to a low brightness level, or a second red or blinking-red LED can be used to indicate a low-battery condition. I chose the red LED indication. LED used must have VF of less than 2V, and a low current draw.

Potentiometer sets the brightness by varying output current (not by PWM, so color variation will be seen, and control will not be uniform). External PWM input may be a better solution to keep LED "color" the same at low brightness levels.

The optional 555 circuit below will provide a suitable PWM output to linearly vary LED brightness:

Fig 7.17

LED blinker

If a single blinking LED is needed, then RadioShack and others sell special blinking LEDs. These LEDs contain a tiny IC inside the plastic housing. Another benefit of those LEDs is that they are driven from a constant-voltage power supply, unlike the common LEDs. Therefore, they do not require current limiting. A good application for such an LED is a fake car alarm blinker.

If two LEDs are needed which blink in sequence, then a classic circuit called an astable multivibrator can be used:

Fig 7.17

Assume that after some time of the power being applied to the circuit, transistor T1 happens to be opened, and T2 closed. From that moment, capacitor C1 starts to discharge thru the low-resistance collector-emitter junction of T1, as well as R2. As C1 is being discharged, the negative voltage polarity on closed T2 decreases. As soon as the capacitor is completely discharged, and voltage at the base of T2 approaches zero, T2 will begin to open.

Current will appear in T2 collector, which will act thru C2 to lower the positive voltage on the base of T1. As a result the current flowing thru T1 starts to decrease, while current thru T2 starts to increase. Eventually, T1 closes and T2 opens.

Now capacitor C2 starts to discharge the the open transistor T2 and resistor R3. That causes T1 to open and T2 to close, and the cycle repeats.

Switching frequency is set by the RC networks C1-R2 and C2-R3. The resistance of two base resistors must be significantly higher than needed by , so that the transistors are not always ON. Switching time is then found from:

τ = 2*R*C

Incidentally, this circuit is one of the few excusable reasons to use diagonal circuit lines and a transistor symbol which is horizontally mirrored.

An excellent application for this circuit is a safety blinking light for bicyclists, hikers, walkers, or runners. The best switching frequency for these applications is around 4Hz. I recommend that rechargeable cells are used to power this circuit. Since each cell produces 1.2V "full charge" voltage, and typical red LED forward voltages are 1.7 to 2.25V, then just two AA cells can be used, with low-resistance current limiting resistors. This will result in good energy efficiency and battery life.

Let us redraw this circuit in a more traditional manner:

Fig 7.18

Looks familiar, doesn't it? What we see are two stages of common-emitter amplifiers. The dashed line is a path of small current flow, which may be thru a PCB, a finger, or something else. Why is it called “positive feedback”? Because each of the two stages are inverting amplifiers, but they are together a non-inverting amplifier. If a small voltage increase on T2 collector is fed back into T1 base, the two stages amplify that small voltage increase, and an amplified version of that increase appears on T2 collector. However, since the feedback is still there, that amplified version on T2 is again fed into T1 base, and so on, until the amplifier does nothing but amplify itself.

The reader has actually heard this circuit perform many times. Any time a microphone starts to cause ringing or a high-pitch noise in the speakers, it is that microphone coupling the output of the speakers into the amplifier input.

Unless you need an oscillator, positive feedback is to be avoided.

Light-sensitive circuits

A logic-level output photo-interrupter is the easiest circuit to build.

Fig 7.19

If an open-collector device is used, then a pull-up resistor RP is required, but I recommend rail-to-rail or tote-pole output devices. The output is powerful enough to drive logic or a transistor directly.

TV remote control tester / indicator

Instead of trying to press the buttons harder, swearing, and throwing the TV remote against the wall, let's build a circuit which will indicate if the remote is working. We will use either a photodiode or a phototransistor. The TV remote pulses a near-infrared LED with a typical emission peak at 940 or 950nm. This LED can actually be seen thru a camera, because camera sensitivity extends into infrared, unlike the human eye.

The very low detection current of a photodiode requires us to use a FET or a pre-amplifier. If we decide on a low-power MOSFET, then we can use the following circuit:

Fig 7.20

More detection current flows in phototransistor devices. We can then use readily available TO-92 BJTs:

Fig 7.21

Alternatively, we can use a single self-contained logic-output detector device (if it is cheap enough):

Fig 7.22

Fig 7.23

Christ-mas circuits

Circuits below turn ON strings of lights in a sequential sequence. When a minimum of three strings are used, it is easy to create an illusion of “running” lights. The lights themselves can be formed into any shape, such as a tree, heart, etc.

Running Christ-mas LED lights sequence

Analysis of this circuit is the same as for the astable multivibrator. Only two LEDs are shown, but an arbitrary number can be used, if component values and voltages are adjusted accordingly.

Fig 7.24

Running Christ-mas incandescent lights sequence

This is an incandescent lights version of the same circuit. A used lights string can be cut up and re-used here. For example, three sequences of eight lights each can be used, with a medium-voltage power supply. To keep base current low and base resistor value high, use Darlington transistors mounted on a heatsink.

Fig 7.25

Burned out Christ-mas light bulb detector with a JFET

Fig 7.26

Night-light

Fig 7.27

The same circuit built with a single specialized switching regulator IC:

Fig 7.28

Fig 7.29

This $10 project can be one of many things, three of which are a portable night-light circuit with a rechargeable battery and an LED, a home-made solar (garden) light, or a small “forever” emergency flashlight. Building one by yourself will enable you to choose quality parts, which will ensure high brightness for several hours, and a long device life. This tiny chip contains a built-in photo-sensor amplifier, and a step-up switching DC-DC regulator. The regulator needs just a single external inductor to operate, and boosts the 1.2V of a single cell up to the needed forward voltage of an LED. An IC like this one is used in many inexpensive LED flashlights and garden lights. I recommend that the entire circuit be skillfully assembled on a cheap and tiny “SMD adapter” from Futurlec. An enclosure is also needed for the whole assembly, and this is up to the reader. Since I have specified a thru-hole inductor and capacitor, their leads should be clipped as short as physically possible for reliable circuit operation.

Although a special procedure must be followed to properly and fully charge Ni-MH cells, we will be charging the cell at 0.1C (one tenth of total mAh charge). The two solar cells will provide 1.5V at 270mA at full illumination. Less the 0.1V internal diode drop of the IC, and the battery should see a maximum of 1.4V. 1.45V is at the same time a good Ni-MH cell charge voltage, as well as being the absolute maximum allowed. If your cell at hand has a somewhat higher cell voltage, then a series combination of two silicon and one Schottky diode can be placed across the cells to “clamp” the voltage output.

The amount of energy stored should be about:

We will then discharge the cell with three 20mA, 3.2V white LEDs. Length of LED illumination is highly dependent on the amount of radiant energy which reaches the solar cells (dependent upon cloud cover, latitude, and angle of sunlight).

“NC” for ICs always signifies a “Not Connected” pin. Most of the time, the pin is not connected to anything internally. However, it is a good idea to actually leave the pin unconnected to any PCB traces. The pin might become utilized in a later version of the same chip, or it may actually be connected to a circuit inside which serves no function, but will not tolerate an external connection.

The datasheet of the ZXLD383 is well-written, and the reader should look thru it.

You must remove any and all garden lights when below-freezing daylight temperatures start, and / or before first snow starts.

How does this compare to retail devices? Let's do an analysis.

Those solar walkway lights retail for about $5 at quantities of 1. That means a manufacturing cost of $1 at a typical retail mark-up. I guesstimate their usable life of 1 year (1 season as they are likely installed in mid-spring). They most likely use Ni-Cd rechargeable cell inside. This battery has a memory effect, has poor output in cold temperatures, and does not last for long. They most likely use a few discrete components. Charging is likely done by connecting the solar cell directly to the battery, and the LED is likely driven thru a voltage dropping resistor. The solar cell used is tiny, and the LED is feeble. With components like this, you'll be lucky if you return late from a hard day's work and the path light is still ON.

Other LED modules

For an example of what is available commercially (always expensive, however), there's the BlinkM from ThingM.com (a RGB LED module):

Fig 7.30

This $15 module can be commanded by a microcontroller to produce any arbitrary RGB color and brightness level, as well as store and play back sequences of colors.

7.5 Time circuits

Kitchen timer

Fig 7.31

555 Timer

A 555 is a wondrous and universal single-chip timer solution. A few external components determine what the chip does. The reader is encouraged to read the printout which comes with the RadioShack 555 chip, its online datasheet, and additional online information about 555 circuits. Many other circuit functions (besides just a timer) can be built with the 555 by choosing how to connect the external components.

Fig 7.32

Here's an interesting lesson to learn. We just saw two versions of a timer. One was with a JFET, and one was with a specialized chip. The JFET version has a limit on maximum time delay due to storage capacitor size. The 555 version uses a single specialized chip which just needs a few external components. A third version of the same kitchen timer can be built with a microcontroller, such as on a Parallax Professional Development Board. That version would have a display and can play a music clip as an alarm. It could also send a text message and a social website status update along with the audio cue to the girl who's cooking. It would, however, cost over a hundred dollars and consume a relatively large amount of power.

Commercial units have a crystal display, a few buttons to set an arbitrary time length, and a low-power piezo alert. They can be bought for about ten bucks, and will last a year on a battery. You, as an experimenter, are free to build circuits which were not optimized to be cheapest, simplest, smallest, and so on. Have fun!

7.6 Audio circuits

AM demodulation – Crystal Radio

AM stands for amplitude modulation. There's a carrier wave or frequency in the AM band in the frequency range of 535 kHz to 1705 kHz. The amplitude (power) of the carrier is modulated (increased and decreased accordingly) by an audio frequency of 20Hz-20kHz:

Fig 7.33

Here the carrier wave is modulated with a constant-frequency signal. The high carrier frequency is needed so that small radio transmitter and antenna can be used, along with a small receiving antenna. FM band, at around 100MHz, uses frequency modulation, but more importantly, FM has even smaller transmitter power and transmitting as well as receiving antenna sizes. A cellphone uses 900MHz and higher frequencies, while Wi-Fi and Bluetooth are 2.4GHz and higher. The fact that you don't even see an antenna in those applications shows the benefits of the higher frequencies.

The simplest way, historically, to demodulate AM is with a crystal (a diode predecessor), or with a Ge (germanium) diode:

Fig 7.34

Since the diode conducts only one way, this will be its output:

Fig 7.35

The modulating signal can now be clearly seen. Since the headphone cannot physically respond to the ≈1MHz carrier, it will only see the ≈1kHz modulating signal, and will convert it to an audible output. The high frequency will choose a path of least resistance thru the capacitor across the headphone – the carrier frequency is no longer needed for us.

Building a crystal radio has been the traditional thing to do. For the interested reader, I will refer you to the December 2011 issue of Nuts and Volts magazine, for the pg. 60 article on building such a radio. This type of radio is also covered in an innumerable amount of other websites, books, and magazines.

I will only mention the points which are usually omitted from explanation:

The type of diode used must be a Ge (germanium) diode with a forward bias voltage of only 0.1-0.2V. Compare this with 0.6-0.7V for a Si (silicon) diode. The type of diode used must also be a small-signal diode, as compared with a typical rectifier Si diode made for larger current, but lower switching frequencies and response. Only specialized outfits sell Ge diodes. A Ge diode cannot be purchased from the established electronics parts distributors.

The radio requires a large outdoor antenna (a long piece of wire), and a real grounding to the Earth (a copper water or heating pipe, or a rod into the ground will do). There is no way to receive more distant AM stations than the one from your city with an in-door antenna.

The inductor (coil) must be of a large physical size, and must use thick copper “enameled” or “magnet” wire. The capacitor must be with a large capacitance range (preferably, plate design with air dielectric). Such capacitors are only sold by specialized outfits, or one can be re-used from any AM old radio (those which still had a “wheel” to select the frequency). This combination of high-quality parts results in a high Q (electrical quality) of the resonating circuit. The circuit will resonate at a single specific carrier frequency, and will develop a high voltage across itself. Just like a children's swing seat can develop a large amplitude by small nudges at the right frequency, so can the resonating L-C combination develop a voltage of excess of 0.1V by nudges of 1μV from the antenna. The ferrite-core coil can be used from an old AM radio, as well.

The headphone used must be a piezo, high-resistance type. Don't even think of using the headphones you use to listen to your music. The piezo headphone will have an internal resistance in excess of 1kΩ, so it'll not load the feeble crystal radio output like a 32Ω music headphones would.

The two points behind building an AM radio is this way are: 1) Build a traditional circuit, 2) Which does not need a battery to operate. For those who won't feel guilty when cheating with a battery, we'll cover how to do just that.

Amplifying crystal radio audio output

In my opinion, the factor of a crystal radio in most need of improvement is the feeble audio output amplitude, and the requirement of the high-resistance piezo headphone. We want to at least clearly hear the product of our build, right?

Cheat #1: Build a crystal radio and load its output with a 10k resistor in the place of the piezo headphone. Connect the input of any microphone amplifier across that resistor. For example, any computer will have a “mic in” input jack available.

Cheat #2: JFET “crystal” radio. Let's use a JFET gate diode as the “rectifying” diode, and build an audio-signal amplifier:

Fig 7.36

Cheat #3+: Commercial radios are built with many amplifying stages. There are RF pre-amplifier stages, before and after the resonating L-C circuit to raise carrier wave amplitude. There are also several stages of audio amplifiers after demodulation takes place. Furthermore, radios of recent design use tricks such as heterodyne, superhet, single-IC, and all-digital designs.

Low-power audio amplifier

Class-A headphone amplifier and JFET microphone or guitar pre-amplifier circuit has been already covered in previous sections. As a reward for the effort, I will now introduce circuits which will have higher power levels while also being simpler to build.

RadioShack sells an LM386-1, which makes for a simple low-power audio amplifier.

Fig 7.37

This skeleton circuit from the datasheet has a gain of 20, and can produce 0.2W into 8Ω load. Why not the 325mW which the datasheet claims? Because one of the plots shows that THD (total harmonic distortion) increases quickly at higher power levels. Distortion of more than 0.1% THD is considered to be detectable by the ear. Distortion of more than 1% is to be avoided. For more power, the -2 or -3 version of the IC can be used, or any number of other ICs which are much better at the task.

Two more components can increase voltage gain to 200. The 0.05μF and 10Ω combination is a snubber network. The capacitor is a short at undesirable high frequencies which are generated due to the inductive load. The resistor limits current and dissipates the energy.

0.1W of output power is low. This is only enough to power those tiny speakers that those readers who have taken apart cheap consumer electronics will recognize. We can use this chip to prepare the audio signal for a more powerful AB class amplifier output stage.

7.7 Temperature circuits

7.8 Control circuits

Fig 7.38

7.9 Solar Projects

There are specialized ICs made to extract the maximum amount of power from a low-power solar cell or a panel. They are typically called harvester circuits. Representatives include Linear Technology LTC3108 and TI BQ25504.

Among the low-power solar to battery chargers, there is the STMicroelectronics SPV1040 and TI BQ24210.

At medium power levels, for charging Li-Ion/Polymer, LiFePO4 and Lead-Acid chemistries, there's a TI BQ24650.

Solar DC-DC circuits to extract the maximum amount of power can be built with STMicroelectronics SPV1020 and TI SM72442.

On my website, I have extensive write-ups for three different “forever” light sources:

1) Low power solar portable light using a rechargeable Li+ cell and a high-brightness white LED

2) Medium power solar light using an SLA battery

3) High-power light for the parts of the world which do not have access to cheap or reliable electrical power.

The first project is more concerned with high brightness and full utilization of the LED, solar cell, and the lithium cell than it is about cost. The circuit uses a medium-power solar panel to charge a lithium cell, which can subsequently be discharged by a high-power LED. Applications for the circuit include professional quality outdoors walkway night-time illumination, high-power night-light, or a self-recharging flashlight for areas of the world without cheap and constant electrical power.

The last project accepts input from a medium-power solar panel, a small-scale wind or run-of-the-river (micro hydro) generator, automatically extracting the most amount of I*V power. Energy is stored in used car batteries which have become unusable for their main application. This battery is desulfated and is subsequently allowed to be only partially discharged. Output options include a high-power LED, regulated 12V, and 100-240V, 50-60Hz AC.

7.10 Driving High-Power MOSFETs

Let's summarize what we have covered in sections of Chapter 3. A MOSFET is a voltage-controlled device which has an input capacitance. This gate capacitance is a high input resistance at steady-state operation, and no gate current flows at steady-state.

Turning the device ON or OFF requires charging and discharging of the gate capacitance. If only a slow switching speed is needed at low VDD levels, then a low-current drive, such as that of a discrete transistor or a logic gate, can be used, but switching speed will be slow, and there will be RON*(ID)2 losses during state transitions.

When the switching frequency increases above a kilo-hertz, the gate capacitance must be charged and discharged quickly, and therefore drive current is required. As an example, a 10kHz PWM application may seem to be easy, but if a 5% duty cycle is requested, the circuit will effectively switch for a single pulse of equivalent time of 200kHz switching.

There is an important datasheet parameter, the Total Gate Charge, given in nC (nano-coulumb). This parameter is the product of time and current (time x current), which is required for the MOSFET to change its state. For example, for a Qg of 8.3nC, supplying 10mA of current will charge or discharge the gate capacitance in μS.

The additional factor to keep in mind is the transfer of current from a drain voltage swing (from COM to VDD) back into the driver circuit.

These drive requirements for fast driving of power MOSFETs usually mean an IC driver. A driver IC is which can provide enough drive current to switch the MOSFET quickly enough. Note that a smaller gate capacitance allows the use of a less powerful driver.

IC MOSFET low side driver

Fig 7.39

This will make a very robust circuit. From my personal experience, high-power, high-speed MOSFETs and their drivers are a weak link of many circuits. Often, if one malfunctions, the other device is destroyed as well. A common mode of MOSFET failure is for all pins to become shorted to each other. In this case, the MOSFET driver burns out as well.

Let us look at every component of this circuit.

Driver chip must be of a specialized MOSFET driver type. Its drive current must be enough to ensure adequate speed of MOSFET switching. For thru-hole parts, devices such as the Microchip TC1410-12 family are a popular choice.

Driver decoupling capacitors. These must be placed physically close to the IC. The high current output of the driver means that the same current will be switching in the power rail if decoupling capacitors were not used.

Gate resistor must be of a high enough value for the driver IC to tolerate a MOSFET driving an nasty load, fail connect the gate to Common. This resistor slows down switching speed as a trade-off.

Gate ESD protection resistor will protect the MOSFET if the driver IC is either unconnected, power is not applied to the circuit, or the driver IC fails open.

Gate TVS. From my experience, MOSFET drivers are fragile, unlike claims to the contrary. A TVS at the gate will protect both the driver and the gate dielectric from voltage pulses exceeding VGS(max).

Big capacitor right across the circuit must be a low ESR aluminum. This will be a physically large component. It must be placed as close to the MOSFET as possible to eliminate voltage drops and noise when large amounts of supply current are being switched.

The flyback diode has been already discussed.

Driving High-Side MOSFETs

N-channel vs. P-channel

There is a choice which needs to be made regarding the type of MOSFETs used in a high-side configuration. The choice is to use either P-channel or N-channel MOSFETs.

Fig 7.40

If we use P-channel MOSFETs for the top portion of the H-bridge or in a single-MOSFET high-side configuration, then VG = +Vsupply will have them OFF, and VG = (VCC – VGS(max)) will turn them ON, since turn-on gate voltage for those MOSFETs is measured from their source voltage level.

Using P-channel MOSFETs will come with their drawbacks: lesser choice/availability, higher RON, slower switching speed, and larger VTH.

N-channel MOSFETs are more popular, but as we saw in an earlier section, they cannot be used “upside down” due to the source to drain diode.

For an N-channel device, VGS = VS or VGS = COM will turn the MOSFET OFF. To turn the device ON, however, connecting the gate to VCC will not do it. When the MOSFET is open, ID = 0, and VD = VS = VCC. To turn the device ON, the gate must be brought 5 to 10 volts or so above VCC level.

This voltage source above VCC is either generated within the driver circuit, or by a secondary power rail. Driver ICs designed for driving high-side MOSFET configurations usually have a built-in charge pump (a built-in boost DC-DC converter) which requires just a single external capacitor to function.

The capacitor-based charge pump has two critical limitations:

1) It cannot be used for steady-state circuits. In order for the charge pump to work, the driver must be commanded to toggle the gate at the rate of at least a few hertz.

2) The charge pump can deliver a limited amount of current. Low-side drivers have their drive current capacity measured in amps, but high-side drivers can only deliver a small amount of current, leading to slow switching speed.

In a low-speed or low-frequency but high-current circuit, a specialized high-side driver IC is used along with an N-channel device.

In a high-speed or high-frequency circuit, either a separate bootstrap power rail must be used with an N-channel device, or a P-channel MOSFET is used instead.

There are several options arising out of the combinations available:

1. Use N-channel MOSFETs, which are low-cost and have good parameters. Use a charge pump high-side driver IC. This charge-pump method cannot be used for steady-state MOSFET operation (ON for a long time). International Rectifier Application Note 978 summarizes different methods and circuits.

2. Use an N-channel MOSFET, a high-side driver IC, and a separate dedicated floating voltage supply rail. Obviously, you will need to implement the separate voltage supply.

3. In a half-bridge or bridge configuration, use two N-channel MOSFETs for both the high and low sides, and use a single driver IC designed for this purpose. Use either an integrated charge pump or an external floating power rail.

4. Use a P-channel MOSFET. If VDD is in the range of VGS(on) < VDD < VGS(max), then use an inverting low-side driver, or just swing the gate to COM with another low-power MOSFET or a BJT. If high-side P-channel MOSFET does not have to turn ON and OFF quickly, build a discrete driver (if slow-speed operation). Example circuits are given below.

5. Use a dedicated IC for the task, which will invert the input (level shifting), will be capable of being powered by the high-voltage supply, and limit gate swing to VGS(on) below power supply voltage. ICs such as LTC1693-5 are available.

6. Use a specialized “load switch” IC with a built-in P-channel high-side MOSFET and a driver. These integrated solutions are useful where the load is attached to the Common (such as automotive wiring), and cannot be re-located to VDD. Explore Digi-Key category Integrated Circuits (ICs) > PMIC - MOSFET, Bridge Drivers - Internal Switch > {High Side, High Side Switch, Relay/Lamp Driver, Relay/Load Driver}. A large selection of devices has been included in the book's datasheet collection file. In most cases, a single dedicated high-side switch IC (with a built-in MOSFET) is cheaper and easier to use than a discrete circuit or an IC / discrete MOSFET combination.

Note that for a P-channel MOSFET to be equal in its parameters to an N-channel, it has to be about three times larger (internal physical size of the semiconductor material inside). If it is of the same cost as an N-channel, then its RON and switching speed are about three times worse. Also, VTH as well as VGS(on) are worse as well.

Nevertheless, for slow switching speeds, a high-side P-channel MOSFET does not require a specialized IC with a built-in charge pump or an external floating power rail, which in most cases makes controlling the device simple in comparison with high-side N-channel driving.

Driving a high-side P-channel MOSFET

Fig 7.41

The Zener regulating voltage is chosen to be the maximum gate drive voltage required. This ensures that VGS(max) is not exceeded. This circuit is not sensitive to VDD voltage variations, as long as it is not below the minimum VGS needed to ensure the MOSFET is fully open to current.

Notice that the use of voltage dividing resistors limits the maximum gate current drive.

The circuit on the right uses a BJT instead. For variety, an inductive load is shown along with the proper orientation of the flyback diode.

In both circuits, R2 is a pull-up resistor to keep the p-channel MOSFET OFF with no drive. R1 limits the current to below the Zener diode maximum. R4 keeps the driver transistor OFF with no input applied.

If the VDD voltage is regulated, and is of a known value, then the circuit can be simplified to a voltage-divider circuit, more commonly known as a level-shifting circuit:

Fig 7.42

IC N-channel MOSFET high side driver

That high-side voltage rail can be created either with additional components for the driver chip (boost DC-DC converter using a capacitor perhaps), or by using a floating rail power supply which will be generated elsewhere.

MAX1614, LTC1981/2, LT1910, and LTC1154 do not require an external boost capacitor for slow-speed operation, because a capacitor is built-in.

An example circuit with the International Rectifier IR2117:

Fig 7.43

H-Bridge Drivers

If you want to see what is available for drivers, explore Digi-Key's category – Integrated Circuits (ICs) : PMIC - MOSFET, Bridge Drivers - External Switch. Intersil HIP4080 thru 4082 H-bridge drivers seem to be the popular choice.

7.11 H-Bridge Protection, filtering, and energy storage – Reality

Realistic design for high current / high voltage operation is not easy. I will briefly cover several important issues.

I am particularly upset by claims of some motor controllers, two of which are pictured below:

Fig 7.44

Both of these modules claim 25A continuous rating. Let us thoroughly de-bull$hit these claims.

How much is 25A? A lot! Your house wiring 25A circuit uses 12AWG solid (or single strand) wire (which is inflexible). If you use a flexible multi-strand wire, it will be even thicker. This is a very thick cable! Using anything less will lead to voltage drops, voltage spikes, and possibly melted and shorted wires. Same goes for the PCB. I am looking at a picture, and that 25A seemingly comes out of a tiny IC pin of the module on the left. I am having a hard time believing that. Now imagine that 12AWG wire spread out in a thin sheet of copper over the PCB. That is how wide they would have to be! A lot of specialized knowledge, heavy copper gauge, and careful layout is required!

Now for the module on the right. They have an interesting statement on their website – “Warning: This motor driver has no over-current or over-temperature shut-off. Either condition can cause permanent damage to the motor driver. We recommend you use the current-sense output CS to monitor your current draw if your application will put the driver close to its limits of operation.”

How nice of them. They can omit the heatsink, claim a continuous rating of 25A, and deny liability if you overheat the module due to its lack of a heatsink!

But more importantly, how big is a 0.5HP motor, which some motor controller claims to be able to control? It's this big:

The specifications are:

Weight: 30lb

Current: 39A

Cost: $330

Dimensions: Huge

Fig 7.44

It is easy to make BS marketing claims if no one can afford the large motor to test the driver with! Why the claims? Because these units are being sold for about a 10x markup on the cost of having these made in large quantities. Designing a proper circuit requires a seasoned engineer, and would result in an expensive circuit.

This current (39A) is for a steady rotation under a specified load. How much current will be needed to start the motor under load? Many times that amount for a second or two.

And what would happen should the motor controller be dumb enough to command the motor to STOP immediately? That 500W of stored mechanical inertia energy can't disappear. It will go back into the driver, and punish it. You may be able to find a few pieces of the circuit around the room. First, the tiny circuit advertised will have its every single electronic component destroyed by the energy surge coming back from the motor. Then, all of those components will go up in smoke. A little later, they will explode. And only after than that, the reply from the driver will reach the microcontroller – “OK, I think I can stop this motor dead in its tracks...”.

No matter how fascinating it is to try to stop a motor, it is more interesting to try to reverse it.

The controlling circuitry must not allow sudden direction reversals for any motor type, but especially for the brushed DC motor.

If the H-bridge reverses a loaded motor, a current of at least twice that of the steady-state requirement would need to be applied to the motor. The electromagnetic and mechanical inertia would first have to be overcome before the motor can even stop.

Energy is conserved – this is the basic physics principle I hope you have been taught. The mechanical energy of a rotating mass is given by

, which is of the same form as that for a linearly moving mass:

The driving circuit must either absorb this energy (to stop the motor), or overcome it (to reverse motor direction). The energy doesn't simply disappear into thin air. It would manifest as dissipated heat, a spike of current back into the power supply, or a MOSFET destruction. To prevent current being forced back into the power supply, a forward-biased diode is used between the power supply and the H-bridge.

A brushed DC motor must not be reversed while it is rotating. Because a significant current will flow thru the motor, and the commutating brushes will be working in an opposite way, significant burn-out of the carbon brushes will occur. A brushed DC motor must first have the current ramped down. It must then be braked. Only after the motor has stopped can the current be ramped up on the opposite direction to reverse motor rotation.

I then look at the modules again, and I see small capacitors for power supply filtering. Can't believe that either. The unit on the right ships a capacitor separately. How many people do not even install it? Trying to swing 36V thru an inductive load which needs 25A at steady-state (DC behavior) requires a huge amount of current. Filtering is needed for the drivers as well. Otherwise, those current spikes will be passed back to the power supply or the battery, and will likely cause any digital logic connected to that power supply to fail due to spikes in power supply rail.

Any motor controller must also use transient suppressors. A brushed DC motor is extremely noisy. The equivalent circuit looks something like:

Fig 7.45

The commutator rotates, applying the battery voltage to sequential windings. I highly recommend for the reader to take apart a “toy” DC motor and find out how it works.

The commutation creates EMF noise, voltage spikes, and arcing. Thoughtful manufacturers place three capacitors on their motors (from each terminal to the metal casing, and between the two terminals) to eliminate some of the noise. Otherwise, it travels back to the controller, and any other circuitry physically close to the motor.

This also means that dangerously high voltage spikes are present on the motor terminals, and wires connecting to the controller:

This is something I never wish you find out on yourself. Wires connecting the power supply to the controller, and to the motor must all be of proper gauge and insulation, properly secured against vibration and possible cuts, and must be electrically secure. DO NOT TOUCH any high-power wires, and certainly DO NOT secure them to the motor by holding them with your hands. Very high voltage spikes will be generated! Additionally, any motor under test MUST be secured properly, taking into account the torque that 400W or more of power can generate.

Because of all of the reasons stated above: high inrush current, noise, etc plenty of capacitive filtering is required in any motor controller. Note the three capacitors right across the bridge. These are there to prevent switching noise to propagate elsewhere into the circuit, and to provide energy for those switching transitions. The polarized capacitor is an electrolytic or tantalum, with low ESR. The non-polarized capacitor is a high frequency filter. It should be ceramic. Both must be placed as closely to the MOSFETs as physically possible.

H-bridge shoot-thru

Schottky diodes tend to not turn OFF until current thru them ceases completely. This is why many amateur designers, if they ever had the diodes installed, take them out after they probe around their driver and find shoot-thru occurring.

Fig 7.46

There's no need to blame a single component. A successful high-speed, high-power switching design involves a cooperation between a fast driver IC, mild-mannered MOSFETs, very fast Schottky flyback diodes, a proper TVS solution, appropriately-sized low-ESR capacitors, and a properly laid-out PCB artwork.

Why are very fast Schottky diodes required in the first place? Because the fact that two MOSFETs turned ON does not mean that the load will obey quickly. Furthermore, if bridge direction has just been reversed, the full bridge supply voltage will briefly remain across the load terminals. There must be a path for this current.

Fig 7.47

Fast Schottky diodes for protection, and transient voltages suppressors must be used in an H-bridge circuit. They must be chosen carefully to withstand worst circuit condition possibilities. Circuit layout must be skillfully and carefully done, with protection devices placed as close as possible to the MOSFETs, and PCB traces of sufficient cross-section and proper routing must be implemented.

Fig 7.48 Add diode on power supply input

This is the minimum design I would use for a 25A drive.