Description
The ULN2803A 8-Channel Darlington Driver is a logic compatible NPN Darlington transistor array for driving high current / high voltage loads.
PACKAGE INCLUDES:
- ULN2803A 8-Channel Darlington Driver
KEY FEATURES OF ULN2803A 8-CHANNEL DARLINGTON DRIVER:
8 Darlington transistor pair channels
50V @ 500mA current sink capability
- Built-in kick-back diodes for driving inductive loads
- Suitable for driving high voltage LEDs, small motors, fans, relays
- Breadboard friendly
- 3.3 and 5V compatible inputs
The ULN2803A has 8 separate drive channels each comprised of high current NPN Darlington transistor pairs with built-in kick-back diodes for switching inductive loads like motors. The internal logic for each channel is shown to the right.
It is well suited for driving higher powered 7-Segment displays, solenoids, relays, fans, small motors and many other low to moderate power devices.
The driver is used on the low side of the load which means it is connected between the load and ground and are used to sink current to ground.
A single channel can handle up to 50V@ 500mA. The maximum per channel overall will depend on how many channels are being used and the duty cycle that the channel is switching at. The channels can be connected in parallel for higher current capability.
Inputs are 3.3 and 5V logic compatible.
OUR EVALUATION RESULTS:
These chips have been around for a long time and are popular for driving moderate power devices where you need to control more voltage or current then a typical MCU can handle directly. They are also very inexpensive and usually easier to wire up than using standard transistors.
The diagram below shows a single channel of the ULN2803A being used to drive a small motor and fan using the PWM output of an MCU.
Hookup is simple. The PWM output of the MCU connects to the input of one of the channels on the ULN2803A. In this case we are using CH 1 which is pin 1. The output of that channel on pin 18 connects to the ground wire of the fan assembly. The positive wire from the fan and the COM pin of the ULN2803A connect to 5V or whatever power the fan is running at. This could also be 12V if it is a 12V fan, it does not need to match the MCU power.
In the example here, we are running the fan and ULN2803A COM off the VIN 5V input from the USB.
The example program below simply uses pin 11 or any other PWM capable pin to provide a PWM signal to the ULN2803A chip. Once the program is downloaded and running, open the Serial Monitor window at 9600 baud and type ‘f0‘ thru ‘f255‘ to control the fan speed. Higher numbers cause the fan to spin faster. Typing ‘?‘ will return the current fan speed.
For example, typing f128 will cause the fan to operate at half speed. f255 will cause the fan to operate at full speed and f0 will cause the fan to stop. At low PWM values, the fan may not move because it is not getting enough drive to get it started, though it may hum since it is getting some power, but not enough to make it spin.
ULN2803A Example Program
/* * Controlling fan with ULN2803A * Basic framework to enter command in Serial Monitor Window * and execute some action based on input */ const int FANPIN = 11; // select the pin for FAN int fanSpeed = 0; // Saved PWM value //=============================================================================== // Initialization //=============================================================================== void setup() { pinMode(FANPIN, OUTPUT); Serial.begin(9600); Serial.println("f0-f255 to set fan speed"); Serial.println("? to get current fan spead"); } //=============================================================================== // Main //=============================================================================== void loop() { if (Serial.available()) DoSerial(); } //=============================================================================== // DoSerial Subroutine //=============================================================================== void DoSerial() { char Str[4]; // Char array int index = 0; // Index into Char array int n = 0; // PWM value char ch = Serial.read(); ch = toupper (ch); // Convert to upper case Serial.print(ch); switch (ch) { case 'F': // Fan (format F0 - F255) delay(10); // Let buffer fill while (Serial.available()) { char c = Serial.read(); // Read buffer Str[index] = c; // Add to string index++; // Increment string index delay (5); } Str[index] = '\0'; // Null terminate char array to make string n = atoi(Str); // Convert string to integer if (n > 255) n = 255; // Cap value at 255 Serial.println(n); // Echo what we end up with analogWrite(FANPIN, n); // Set PWM fan speed fanSpeed = n; // Remember current fan speed break; case '?': Serial.println(fanSpeed); break; default: break; } }
Notes:
- For a 7-channel device which can be handy for 7-Seg displays, check out the ULN2003A below.
Technical Specifications
Maximum Ratings | Output Voltage | 50V |
Input Voltage | 30V | |
Collector Current (continuous) | 500mA | |
Base Current (continuous) | 25mA | |
Turn on/off Delay | 0.25uS (typ.) | |
Package | DIP-18 | |
Package Type | Plastic, thru-hole | |
Mfr | Various: Toshiba/ON Semi | |
Datasheet | ULN2803A |