Offline
Newbie
Karma: 0
Posts: 14
|
 |
« on: March 16, 2013, 11:23:03 am » |
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
God Member
Karma: 14
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
|
 |
« Reply #1 on: March 16, 2013, 11:28:23 am » |
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
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #2 on: March 16, 2013, 11:30:28 am » |
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
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #3 on: March 16, 2013, 11:33:21 am » |
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
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #4 on: March 16, 2013, 11:34:48 am » |
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
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #5 on: March 16, 2013, 11:36:07 am » |
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.pdfLefty
|
|
|
|
« Last Edit: March 16, 2013, 11:43:44 am by retrolefty »
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #6 on: March 16, 2013, 11:38:15 am » |
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 
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #8 on: March 16, 2013, 11:48:04 am » |
I see know obvious link to a schematic drawing. Why do you make it so hard to help you?  Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Boston Suburbs
Offline
God Member
Karma: 14
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
|
 |
« Reply #9 on: March 16, 2013, 11:49:41 am » |
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
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #10 on: March 16, 2013, 11:52:16 am » |
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?"
|
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #12 on: March 16, 2013, 11:53:23 am » |
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
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #13 on: March 16, 2013, 11:57:10 am » |
Jimbo my man, i'll give that a shot now
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 14
|
 |
« Reply #14 on: March 16, 2013, 12:00:49 pm » |
Thank you to everyone for the help just in case I get wrapped up in this for a while!
|
|
|
|
|
Logged
|
|
|
|
|
|