 |
Part 1: Basic Transistor Drivers for Arduino Micro-Controllers
The output of most digital circuits and micro-processors is only five volts at most a few milli-amps. Most electrical and electronic devices require voltages and currents that will destroy digital circuits, so we must rely on what I'll broadly call driver circuits. To our left illustrates a digital output driving a typical low-power light emitting diode.
On this page we will look at transistor driver circuits using both bipolar transistors and power MOSFETs and will use them as electrical switches. Also note the concept of sink/source as we go along. When a "switch" supplies a voltage (on the "hot" side) such as a household light switch, we say the switch "sources" the voltage. If we put the switch on the neutral side of the load, we say we "sink" the voltage. All of the examples below assume a negative shared common.
|
Illustrated to the right is the most common driver circuit. It consists of an NPN bipolar transistor controlling a light bulb. For most of this page I'll assume a 24 volt, 100 mA light bulb as a load. We have a negative ground/common tied to digital ground. That is the negative side of the 24 volt supply is tied to the digital ground which is also negative in relation to its power supply. Note a digital "HIGH" is 5 volts (Vcc) and a digital "LOW" (Vss) is zero volts. The "HIGH" is switched to 5 volts inside the "chip" while a "LOW" is switched to ground. Another digital state is known as floating and is open to both Vss and Vcc.
In this example a digital "HIGH" on the input "sources" a current in the base/emitter of Q9 (limited by R1) which causes a larger current flow in the collector/emitter circuit and the lamp. If Q9 has a gain of 50 and the base current through R1 is 5 mA, then the collector current will be 250. In this case it's only 100 mA limited by the fully on lamp. In many of these transistor circuits R1 ranges for 1000 to 2200 ohms for 5 volts.
|
 |
 |
In this example we are using an NPN darlington transistor. They have very high gain and take less base current. In reality they are two transistors with common collectors and one emitter tied to the other's base. If each transistor had a gain of 100, then to total gain would be 100 X 100 = 10,000.
Like the example above we would say the transistor "sinks" the load. In the case of using a TIP120 R2 should be 1000-ohms.
|

In this example we use a PNP darlington. (TIP125)
When Q11 switches on current flows through R5
switching Q6 on. Here Q6 will "source" the load.
In the case of using 24 volts R5 should be between
2200 to 5600 ohms while R4 should be 2200-ohms.

The internal circuits of the above two Darlingtons shows
opposite electrical polarities. The diodes are used to protect
the transistors from surges created when switching
magnetic loads.
Switching on a MOSFET
 |
Here is the basic driver using a N-channel MOSFET. Unlike bipoler transistors MOSFETs are voltage operated devices, not current operated. An electrical charge (voltage) on the gate (G) relative to the source (S) will switch on the device. The only purpose of R3 (100K) is to bleed-off any remaining charge on gate terminal. In this case we "sink" the load.
|
In this example we use a P-channel power MOSFET. The source termianl (S) is connected to the positive
of the power supply and while Q10 is off (no 5 volts in) we have 24 volts on the collector (C) of Q10. When 5 volts
is supplied Q10 switches on dropping the collector voltage to zero. Q5 will switch on and "source" the load.
R6 should be 10,000-ohms and R5 2200-ohms.
In summery we have looked at a number of bipolar transistor and MOSFET driver circuits. They all have a flaw of having to be electrically connected to low voltage digital circuits. With opto-isolators we can sever this connection of the higher-voltage power supplies totally from the low-voltage digital circuits if desired. In fact we can even change the polarity of the higher voltage supplies without regards to the digital circuits common negative grounds if we desired.
See Part 2: Opto-Isolated Transistor Drivers for Arduino Micro-Controllers.
PDF files and spec sheets
[ My Homepage ] [ Electronics Mainpage ]
Added February 2009: Using a CdS Photo resistor. How to use photocells and touches on comparators, thermistors, relays, etc. Includes circuits to build and test.
Arduino demos April 30, 2009:
Using the ATMEGA168/Arduino with a 24LC08 Serial EEPROM
Using the ATMEGA168/Arduino with a DS1307 Real Time Clock
More to come. this will include using the MCP23016 I2C I/O Expander and several simple demo projects
for robotics and power control.
Atmega168/Arduino features:
14k flash program storage
1k RAM for program memory
6 PWM outputs
6 A/D inputs
UART and SPI interfaces
2 Hardware interrupts
20 general purpose I/O pins (shared with PWM and Analog pins)
16 MHz RISC microcontroller
Open-source hardware, IDE, bootloader
Easy upgrade to more powerful hardware (Wiring)
Easy to use and learn.
Visitors since March 2002
|