Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC Microcontrollers & TIP120

Status
Not open for further replies.

halloween_man

New Member
Hi,

I am learning about PIC microcontrollers and want to drive a 12VDC (9 - 14VDC) pneumatic solenoid Valve (inductive load). The valve is 12VDC and draws 500mA.

I have found the TIP120 darlington transistor and would like to use it as it is inexpensive AND easily replaced if I damage it.

Depending on what web site you find you get many different views on how to implement the use of the TIP120.

The controller output is 5VDC, I want to drive 12VDC with a max of 1 AMP. It appears this can be determined by the resistor that is connected to the base of the TIP120, so many site imply. I often see a 1K resistor in series between the PIC output pin and the base on the TIP120.

First, is a resistor between the PIC pin and the base required, many sites do not show one.

Second, if it is, how do I calculate the proper resistance (ohms) value and power (watts) rating for the resistor?

I have even seen sites that says you need an optoisolator between the PIC pin and TIP120 base.

Third, the TIP120 has a built in "kickback" diode. Many sites still show an external diode - 1N400x across the coil of the inductive load. Is this second diode really necessary?


Please help out a newbie....

Thank you for your time, it is greatly appreciated.
 
Uln2003

If your max is only 500 MA, take a look at the ULN2003 or 2004 Driver chips, they have a max of 500, but i use them to run all of my 24 volt 500ma pneumatic vales and led lights, they can be driven directly from the micrconotroller, and they are less then a dollar each and allow for 7 controls
 
The datasheet for the TIP120 shows it saturating well at 500mA with a base current of only 2mA.
The datasheet for a PIC says its max output current is 25mA.
So why not feed the TIP120 base 10ma?
The output of the PIC is about 4.0V with a 10mA load.
The input of the TIP120 is about 1.3V at our currents.
So the current -limiting resistor is (4V - 1.3V)/10mA= 270 ohms.
 
halloween_man said:
Third, the TIP120 has a built in "kickback" diode. Many sites still show an external diode - 1N400x across the coil of the inductive load. Is this second diode really necessary?
Only if you want to save the transistor. This "kickback" diode polarity is opposite the diode across the solenoid and will not diminish the inductive transient.

When the transistor shuts off, the solenoid current will attempt to keep flowing due to its inductance. This will cause the voltage to increase on the transistor collector (and the transistor diode cathode) until the transistor breaks down or avalanches. The diode does not conduct under these conditions, so will not protect the transistor.

You need a separate diode connected across the solenoid, cathode to the + supply and anode to the transistor collector. That way as soon as the collector voltage rises above the supply voltage the inductive current has a path through the diode to the power supply, protecting the transistor.
 
I'd go with the ULN2003 :eek:


There is only one power connection, a common ground. Here's an example of driving two lamps with logic voltages via the ULN2003;

**broken link removed**

Note that the Lamps are not inductive, hence Pin 9 is not connected. For inductive loads, Pin 9 is connected to the loads +V to shunt back EMF safely.

Using the same analogy, this chip is my primary choice to controlling external components, its cheap, effective, and requires no operating voltages, simply a common ground.
 
Hi,

I want to thank everyone that has responded, ths is great.

I have looked at the ULN2803A, it has a different pinout than what is posted.

Pin 1 IN1 to Pin 18 OUT1
Pin 2 IN2 to Pin 17 OUT2
Pin 3 IN3 to Pin 16 OUT3
Pin 4 IN4 to Pin 15 OUT4
Pin 5 IN5 to Pin 14 OUT5
Pin 6 IN6 to Pin 13 OUT6
Pin 7 IN7 to Pin 12 OUT7
Pin 8 IN8 to Pin 11 OUT8
Pin 9 GND
Pin 10 + Supply

Can the ULN2803A handle 2 AMPS all at the same time? The worst case situation would be 4 solenoid valves on at the same time, at 500mA each would be 2 AMPS.

This is why I started looking at the TIP120, it can handle 500mA easily, and with 8 TIP120's total current draw is not an issue from what my limited knowlege tells me.

Thanks...
 
Last edited:
hi,
If you relook at the datasheet it will show what the maximum individual driver power can be and also the total power the ULN can handle..

Added ULN28xxxx graph
 
Last edited:
audioguru said:
The datasheet for the TIP120 shows it saturating well at 500mA with a base current of only 2mA.
The datasheet for a PIC says its max output current is 25mA.
So why not feed the TIP120 base 10ma?
The output of the PIC is about 4.0V with a 10mA load.
The input of the TIP120 is about 1.3V at our currents.
So the current -limiting resistor is (4V - 1.3V)/10mA= 270 ohms.

I have been unable to locate the pic output voltage/current relationship in the PIC data sheet. Audioguru states 4.0V at 10mA, where do I look in the pic Data Sheet to find this information?

If I understand the gain of the TIP120 = 1000, if the base current is set to 10mA, then .01A * 1000 would mean I could drive a theoretical load of 10 amps, is this correct?

1.3 or 1.4VDCVDC I believe is the voltage drop across the darlington pair, is this correct?



ULN2803A

I also want to to layout a prototype board with the ULN2803A (8 outputs). If I understand the ULN2803A the +12VDC is pulled to ground through the darlington pair. Is this ground connection the actual ground pin (9) on the IC itself? The reason I ask is that I would like to socket the ULN2803A, but most DIP socket pins have a maximum current ratings of 1 Amp. If 4 solenoids are ON at the same time then this would be 2AMPS of current through the ground pin, not good.


I have been using another formula for my calculations, which produces the same result.

((Drive Voltage - 1.4) / Current Required) * 1000

The main issues for me right now is where do I find the TIP120 information "saturates well at 500mA with base current of 2mA" and the "output Voltage/current relationship" for the PIC. The TIP120 data sheet I found has no graphs in it, and I looked in the PIC data sheet but could not locate the output voltage/current relationship.

Thank you for the learning experience!
 
Last edited:
I have been unable to locate the pic output voltage/current relationship in the PIC data sheet. Audioguru states 4.0V at 10mA, where do I look in the pic Data Sheet to find this information?
The PIC is made with the same Mosfets as 74HCxx logic gates. Texas Instruments shows the voltage vs current on their 74HCxx datasheets.

If I understand the gain of the TIP120 = 1000, if the base current is set to 10mA, then .01A * 1000 would mean I could drive a theoretical load of 10 amps, is this correct?
The current gain is spec'd for a linear amplifier when its collector voltage is not less than 3V. The datasheet spec's a max saturation voltage when its base current is 1/250th its collector current when it is turned on hard as a switch.

1.3 or 1.4VDCVDC I believe is the voltage drop across the darlington pair, is this correct?
The datasheet shows a max saturation voltage of 3V when its base current is 12mA and its collector current is 3A. The max saturation voltage is 4V when its base current is 20mA and its collector current is 5A.

You can't use a socket if the current is too high for it.
 
As convenient as a ULN2803A or a serial-to-parallel MIC5841 might be it seems you might be pushing the limits with your 2 amp requirement and if it did work I suspect those chips would get pretty darned hot.

Have you considered using an N-channel MOSFET in a TO-220 package with logic level gate control and low Rds(on) (drain-source resistance when 'on') specification? An inexpensive IRL520 for example has an Rds(on) of something like 0.27 to 0.38 ohms with 4 to 5 volts applied to the gate.

Mike
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top