Power switch as current amplifier

This article has tendency to explain why microcontroller (MCU) devices are not good enough to directly drive devices like DC motors or any other high current load.

Below picture shows the electrical concept of the port pin related to the microcontroller device. It is not concrete example of some specific MCU port (but it is much closer to the 8051 pin port configurations), it is an example, which means that each time, we have to take a look into MCU specification to see how ports are organized and configured, before we make a design decision.

Figure #1: pin - electrical concept
In the center of the pin configuration, there is a flip-flop, electrical device with capabilities to memorize one bit of information: 1 or 0, and belongs to the class of the bistable multivibrators, a basic RAM memory building block. It is a D type of flip-flop, where D input is connected to the data-bus together with central processor unit (CPU). Also, three control signals are presented:

- Read flip-flop: read previously saved one bit information
- Read pin port: read signal from the port pin
- Write signal: save one bit information to the flip flop

That also means, that there are three different CPU instructions where control signals are generated at the time of instruction execution. For example: when read flip-flop signal is generated by CPU controller, related to read flip-flop instructions, Q signal, output from the flip-flop is connected to the data-bus. The same stand for read-pin control signal. By doing so, we actually control from where we would like to read values, from the flip-flop or from the port pin (signal value from some external device). Now, if logic 1 is written to the flip-flop, inversely Q is set to logical zero or 0 volts, which means that FET transistor is not active, the transistor is switched off. If we write logic 0 to the flip-flop, inversely Q is set to logic 1 or, for example 5 volts (depends on internal electronics related to MCU pin) and FET transistor is switched on providing current flow. That current is very small, about 20mA or smaller. Available current also depends on the number of the currently active FET transistor. All these kind of information is available under MCU specification/documents. Let say that we do have about 20 mA, that is a very small current to drive DC motor, it is not even possible to trigger DC motor rotation. To start DC motor rotation we certainly need much more powerful current source. That is the reason why it is not possible to drive DC motors directly with MCU. You can try to do that, but MCU will be damaged by very height DC current. Because of that, external power transistors are used to drive devices like DC motors. To drive DC motor power transistor is used and it is configured to work as a switch. If the transistor is configured to work as a switch that means that it works like a light switch, presented on below picture (figure #2), to turn on and off lights in our room. The same stand for power transistor, no differences, except that light switch is triggered by the hand while power transistor is triggered by MCU signal generated by executing software.

Figure #2: light switch
Now, because we do know that power transistor work as a switch in order to drive DC motor, we can make some approximations for the sake of simplicity and better understanding. As we can see there are no big differences between switch presented in the figure #2 and switch presented in the figure #3.

Figure #3: power transistor as switch

Beside power transistor, to drive DC motors, we do need more components. FR diode or fast rectifier diode which protects the rest of the electrical circuit from damaging by back electromotive force which flows from DC motor to the other parts of the circuit when motor rotation is stopped. As we can see, there are two possible scenarios as it is presented on below picture.

Figure #4: DC motor driver circuit
First scenario, figure #4 left circuit, when power transistor is switched off. In that case, all back electromotive force, energized during motor rotation is directed back to the power supply by FR diode in order to prevent the rest of the circuit from damage. FR diode should be fast, and do not forget to drive your motor with chargeable batteries, because back electromotive force is returned back to the power supply. That also means that your DC motor could work as a battery charger when power transistor is switched off. The second case is presented in the figure #4 right circuit. In this case power transistor is turned on and all current flows from the power supply through DC motor and power transistor. For example, if TIP122 Power Darlington transistor is used, that means that maximum 5A is available. Now, everything is clear. MCU provides about 20mA while power transistor provides 5A to drive DC motor and it is good enough to drive the most DC motors related to the mobile robots. Interfacing between MCU and power transistor, in this case, is done over the resistor connected in series with power transistor base pin. Now, everything is clear. ULN2803 IC is nothing else than 8 power Darlington transistors organized in an array. Pay attention here, 5A power transistor could also be damaged by higher currents, for example 10A, especially in case if DC motor is in stall mode or under the heavy load. It is not possible to drive DC motors declared on 30A maximum with a power transistor declared for maximum 5A. To drive DC motor declared on 30A maximum, we do need a power transistor with minimum of 30A.

Related articles:
Programmable autonomous vehicles – Fundamentals, Part I 
SERPENT I - DC motor controller/driver
SERPENT I - PCB DIY (do it yourself) assembling - video clips examples
SERPENT II - Pit VIPER Rattle - DC motor controller/driver 
How to build do it yourself printed circuit board (DIY PCB) by using thermal transfer method
DC motor torque vs DC motor speed
How to design voltage reference by limiting current consumption
Fake VC830L digital multimeter

Comments

Popular posts from this blog

Electrolytic capacitors and design rules