Driving Relay with Darlington (TIP120)

Hello All, I am having a hell of a time trying to switch a small relay (http://www.omron.com/ecb/products/pdf/en-g6s.pdf) with a tip120. Stll new to electronics but I am reasonably sure the transistor is hooked up correctly as no smoke and I am getting a gain of around 16mA, however it is falling short of the 66mA required (I am reading about 56mA from collector to relay coil). I am using a simple analog out to write 5v to pin 12 and I can see the voltage before the transistor and after (was surprised how little voltage drop there was). My circuit as it stands is: pin12 analog output to base of tip120, tip120 collector to positive side of relay coil, tip120 emitter to gnd, and negative side of relay coil to gnd. I have not yet connected it to my 24vac sources as I wanted to test the circuit before hand, my assumption is I should still hear the click of the relay. Other than that I am out of ideas as I've seen this project done many times with similar relays and a TIP120. If anybody can see where I'm inherently wrong I'd appreciate it, I should mention that the TIP120 is from radioshack and i've been burned before but i've tried 3 different TIP120's and 3 different relays. Thank you,

TIP120 is NPN, while you are using it like a PNP. You need to be switching the ground.

coil power---->relay coil---->Collector Emitter----->GND BASE | | Arduino pin

TIP120 is a darlington so it doesn't need a base resistor. You are trying to switch the high side rather than the ground, that's all. Switch that up and you should be good to go.. and add a "reverse" diode across it for the inductive spike. Also, you need to know that writing ANALOG to a pin gives PWM, which means it switches off and on very fast. For a relay, that isn't what you want. The relay can't keep up with PWM and you wouldn't want it to. You just need to digital write the pin either high or low. Do remember to declare the pinMode to OUTPUT...

Friggin Seriously? Wow, alright. I assumed it was PNP for some reason, still learning. Would that not make the tip120 blow up the way I had it possibly? Also thanks and sorry you had to answer that.

Actuall looking at your diagram, that is how I had it hooked up. Do you mean relay coil to Emitter?

zeroprog: Hello All, I am having a hell of a time trying to switch a small relay (http://www.omron.com/ecb/products/pdf/en-g6s.pdf) with a tip120. Stll new to electronics but I am reasonably sure the transistor is hooked up correctly as no smoke and I am getting a gain of around 16mA, however it is falling short of the 66mA required (I am reading about 56mA from collector to relay coil). I am using a simple analog out to write 5v to pin 12 and I can see the voltage before the transistor and after (was surprised how little voltage drop there was). My circuit as it stands is: pin12 analog output to base of tip120, tip120 collector to positive side of relay coil, tip120 emitter to gnd, and negative side of relay coil to gnd. I have not yet connected it to my 24vac sources as I wanted to test the circuit before hand, my assumption is I should still hear the click of the relay. Other than that I am out of ideas as I've seen this project done many times with similar relays and a TIP120. If anybody can see where I'm inherently wrong I'd appreciate it, I should mention that the TIP120 is from radioshack and i've been burned before but i've tried 3 different TIP120's and 3 different relays. Thank you,

Unfortunately that sounds all wrong. Without a schematic drawing to verify what you are saying it sounds like there are many things wrong.

First an arduino has no analog output pins, just digital output pins that can be either set to steady HIGH or LOW output voltage or switched between HIGH and LOW via PWM by using analogWrite() statements which would never be used to control a electromechanical relay.

There must always be a series current limiting resistor used between a arduino output pin and the base of any switching transistor.

You didn't state what coil voltage your specific relay requires as the datasheet shows several options available and you don't tell of using a voltage source for the relay coil in your wiring description.

So tell us what specific relay model you have (the dash option numbers) and show us a drawing of how you are wiring it up or a link to a drawing you are using as a guide and perhaps we can help you.

Lefty

TIP120 is a darlington so it doesn't need a base resistor.

I think you might be confused about that? Have a reference to such a statement?

While it would be hard to distroy the transistor's base junction as it's rated for up to 120ma max, the poor arduino output pin would suffer badly at that level. A base resistor is required.

http://www.adafruit.com/datasheets/TIP120.pdf

Lefty

Here's a tutorial showing exactly what you want to do, except it uses a 122 not a 120: only difference is the voltage afaik.

Don't forget that diode.....

Edit... And it shows a base resistor 8)

3V coil, I understand the arduino doesnt have analog out pins, that's why I stated it in the question, thinking the pwm might be an issue. http://www.instructables.com/id/Make-your-own-programmable-thermostat-with-Arduino/, that guide has a diagram in it that I followed. Thank you!

zeroprog: 3V coil, I understand the arduino doesnt have analog out pins, that's why I stated it in the question, thinking the pwm might be an issue. http://www.instructables.com/id/Make-your-own-programmable-thermostat-with-Arduino/, that guide has a diagram in it that I followed. Thank you!

I see know obvious link to a schematic drawing. Why do you make it so hard to help you? ;)

Lefty

Ah, there is a base resistor built in on ULN2003, just looked at the datasheet. In that case, stick a 1-2k ohm resistor between the pin and the base of the TIP120. That transistor has a HUGE gain, you only need a couple ma at the base to switch the beast on.

Now why did I think Tip120 is okay without a base resistor? And that flyback diode is needed also, to avoid the spike frying your TIP..

Now why did I think Tip120 is okay without a base resistor?

That was simply the East Coast seeing if the West Coast was paying attention?

That's what I used! Here, http://www.instructables.com/file/F9LKDFGGU7FXUMH, replace the motor with a relay in your head, that's the best I can do.

zp you might have missed my post #6 in the clutter....

Jimbo my man, i'll give that a shot now

Thank you to everyone for the help just in case I get wrapped up in this for a while!

zeroprog: That's what I used! Here, http://www.instructables.com/file/F9LKDFGGU7FXUMH, replace the motor with a relay in your head, that's the best I can do.

That does show a base resistor now doesn't it, but you didn't state using one. Also that shows using a 9 volt source, is that what you are using for your 3 volt relay coil? And why pick a 3 volt relay coil in the first place? Also that drawing has the diode in the wrong place. Just because something is published on the web doesn't mean it's error free or even correct.

Lefty

just in case I get wrapped up in this for a while

.... Hell yeah, we understand that, I've been Arduining all day and it's just gone 1900 here.

Just because something is published on the web doesn't mean it's error free or even correct.

WHAT? Are you sure? DAMN!

alright guys im back, still having an issue, ill upload the fritzing diagram of how my circuit is connected, maybe this will clear it up

proto.PNG

zeroprog: alright guys im back, still having an issue, ill upload the fritzing diagram of how my circuit is connected, maybe this will clear it up

Still wrong. I don't see where you are providing any coil voltage for the coil? You have a connection for the output pin to the base resistor, you have a common ground, but where is the voltage to actually power the relay coil on? And are you sure you have correctly identified the emitter, collector, and base leads for your specific transistor. You didn't label them and I'm too lazy to find the datasheet to see if you did identify them correctly, not every transistor has the same lead layout.

And that is not a schematic drawing, just a poor pictorial but I guess better then just english words. ;)

Lefty