# ULN2803 How does it work?

Discussion in 'General Electronics Chat' started by theavi, Jan 2, 2010.

1. ### theavi Thread Starter New Member

Dec 19, 2009
9
0
Hey everyone. I know this is a wall of text but I put my actual question at the bottom and this first part is just to help understand what level of electronics I'm at and my background understanding of this circuit. I could be wrong about some of it. If so, please correct me. I'm relatively new to electronics but I'm studying for an associates in electronics technology at a local tech school and they really skimped over Transistors and Thyristors so I've purchased a bunch of books and have been playing catch up over Christmas break. All of this information below is still somewhat new to me as I've learned it over the past week or so through teaching myself.

Right now I'm in the process of trying to understand how I can use a TRIAC to switch on an off AC line voltage for lightbulbs, household appliances, etc. I've come across a circuit that has really answered that question for me at this website: http://computerchristmas.com/christmas/link-how_to/HowToId-7/LowLimit-0

Here is where the ULN2803 comes in. I get that it uses TTL to switch its outputs on (at least I think thats right) and if I'm not mistaken that means it uses a +5V Pulse or Square-Wave to switch them on. In doing so it turns on the Optoisolated TRIAC (used to isolate the AC line voltage from the rest of the circuit) which triggers the gate of another TRIAC which actually switches on the AC to whatever load you have connected.

I pulled up the datasheet for the ULN2803 because I wanted to understand how a +5V pulse on its input could switch on the Optoisolated TRIAC. In the following image I added in RED example pins for how I understand it to be connected. I don't know if they are right or not.

My actual question: I'm not sure how the circuit on the right actually works. I believe the triangle is an Invert or a NOT gate but I haven't taken digital electronics yet just read about it on my own. Can someone please help me understand how the circuit on the right operates so that when you have a +5V input it switches on the output and what the purpose of Example Pin 18 and Pin 10 is. Thanks!

Jan 11, 2009
820
47
3. ### SgtWookie Expert

Jul 17, 2007
22,183
1,729
First, pin 9, the ground pin, needs to be connected to the same ground reference that the TTL input is using.
Pin 10 is the "snubber diode" connection aka clamping aka protection diodes that Russ was talking about. This connects to the +V supply of the output.

These Darlington drivers are "open collector"; they can sink current, but they cannot source current. They're used as a ground-side switch for all kinds of things; very popular with hobbyists to control stepper motors and relays - basically, higher current loads than standard TTL levels support.

The 7.2k and 3k resistors keep the Darlington pair turned off when there is no current flowing into the base. When the transistors are off, there is no current being sunk from pin 18.
When a logic "1" (5v) is placed on pin 1, current flows through the 2.7k resistor to the base of the 1st transistor, turning it on. The 1st transistor in the pair is now supplying current to the 2nd transistor's base, turning it on, and it begins to sink current from the load connected to the output.

Darlington transistors are used because the gains of the two transistors are multiplied. If both transistors have a gain of 20, 20*20=400, so an input current of 1mA can control a load current of 400mA.

4. ### theavi Thread Starter New Member

Dec 19, 2009
9
0
Excellent I had some things wrong where I had drawn out my schematic in a notebook. Thanks for both of your help. However, I'm still not sure I understand how Pin 10 of the ULN2803 plays into this. See below:

Say I had this connected to an optoisolated triac such as the MOC3010 as in the example link I had in my first post:

If I'm understanding this correctly I would connect Pin 18 of the ULN2803 to Pin 2 of the MOC3010. Pin 1 of the MOC3010 would be connected to the +V supply. That way when a logic 1 was sent to Pin 1 of the ULN2803 it would switch on the darlington transistors. Current would flow from the +V Supply through Pin 1 of the MOC3010 and back out Pin 2 of the MOC3010 through Pin 18 of the ULN2803 and the now switched on Darlington paired transistors into ground thus completing the circuit.

Let me know if that is correct. SgtWookie you said that Pin 10 of the ULN2803 would be connected to the +V Supply of the output. Would this be the same +V Supply that would be connected to pin 1 of the MOC3010 in the above example? If so, how does this afford anymore protection to the circuit since connecting Pin 10 to the +V supply would in effect reverse bias the diode on Pin 10 and not let any current flow through it anyway? (It seems I still have alot more reading to do )

5. ### hgmjr Moderator

Jan 28, 2005
9,030
214
These devices were used as pin drivers for dot-matrix printers. The inductors associated with dot matrix print pins needed protection diodes to prevent damage to the driver in the event of flyback. Pin 10 is the common bus for the flyback protection diodes. Whether it is used or not it should be tied to your positive power supply.

hgmjr

6. ### theavi Thread Starter New Member

Dec 19, 2009
9
0
That makes sense. Flyback from the collapsing magnetic field of an inductor. In which case the diode on pin 10 would be forward biased and go to ground. Very slick. I love electronics. Thanks again guys, now I can scribble more notes in my notebook and keep on truckin'!

7. ### russ_hensel Distinguished Member

Jan 11, 2009
820
47
The chip is good, I think for 500ma, it is overkill for driving an optical isolator ( but probably will work ) I think the uc output direct to the optical isolator would be fine.

8. ### theavi Thread Starter New Member

Dec 19, 2009
9
0
I see what you are saying and agree. For instance, in this Christmas lights to music circuit on instructables: http://www.instructables.com/id/Christmas-Lights-to-Music-Using-Arduino/step2/SSR-Board/. They have an arduino switching on and off several Optoisolator Triacs directly.

I don't have any immediate projects planned using the principles I've learned from these questions. I'm just trying to learn as much as I can for now and I'm taking down notes as I go along for future reference. Beforehand, I didn't recognize the diode on Pin 10 as a snubber diode or how it could be connected to a MOC3010 nor did I understand what the other resistors were for on the ULN2803, but now I feel like I have a good grasp on how this circuit works and will go wade through the internets for more circuits to figure out.

Thanks again.