Loading...
Pages: [1] 2   Go Down
Author Topic: Driving Relay with Darlington (TIP120)  (Read 959 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,
Logged

Boston Suburbs
Offline Offline
God Member
*****
Karma: 14
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: March 16, 2013, 11:56:45 am by focalist » Logged

When the testing is complete there will be... cake.

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actuall looking at your diagram, that is how I had it hooked up. Do you mean relay coil to Emitter?
« Last Edit: March 16, 2013, 11:34:56 am by zeroprog » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 282
Posts: 15443
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 282
Posts: 15443
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
« Last Edit: March 16, 2013, 11:43:44 am by retrolefty » Logged

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-cool
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 282
Posts: 15443
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?  smiley-wink


Lefty
Logged

Boston Suburbs
Offline Offline
God Member
*****
Karma: 14
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
« Last Edit: March 16, 2013, 11:52:40 am by focalist » Logged

When the testing is complete there will be... cake.

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1] 2   Go Up
Print
 
Jump to: