Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« on: March 19, 2011, 11:40:57 pm » |
In referance to this post, I bought a relay to try. http://arduino.cc/forum/index.php/topic,55492.0.htmlThis one http://www.nteinc.com/relay_web/pdf/R73.pdfI also got a DPDT Switch to replace the single master switch Since the relay is a 5v, can I power it from the 5v arduino pin or do i really need a transistor to turn on the relay? I have a tip120 and tip42 on hand, would they work? Since I am turning a serial motor controller do I need a diode? Found this diagram http://www.arduino.cc/playground/uploads/Learning/relays.pdfHow do I know which pins are - and + on the relay? Does it matter? The datasheet doesn't say much. Thanks!
|
|
|
|
« Last Edit: March 22, 2011, 12:26:25 am by MobileWill »
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 248
Posts: 16535
Available for Design & Build services
|
 |
« Reply #1 on: March 20, 2011, 12:10:38 am » |
See the column that has "Coil Res" in ohms? Anything under 5V/40mA = 125 ohm will smoke the arduino output pin.
As far as the contacts for the power being switched, they do not matter, no more than they do for a manually operated toggle switch.
As you say, the datasheet is light on details. Try some switching with just an ohmmeter across the NO contacts, make sure you have the coil part figured out first.
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #2 on: March 20, 2011, 01:27:01 am » |
Thanks, good thing I asked first.
So will the tip120 work for this? Or the TIP42?
The diagram has diode, do i need it?
Want to make sure before i go out tomorrw in case I need to pick some up.
Thanks again.
Edit: This on says 80 for the C column, but I take it using the transistor is much safer.
I think this will work great in conjuction with the new switch. Can't wait to get started tomorrow.
|
|
|
|
« Last Edit: March 20, 2011, 01:36:04 am by MobileWill »
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 248
Posts: 16535
Available for Design & Build services
|
 |
« Reply #3 on: March 20, 2011, 08:56:27 am » |
Yes, you need the diode. When you stop the current flow in the delay coil, the physics of the coil will try to keep the current flowing, creating a nasty spike of voltage. The diode dissipates that spike within the coil. The TIP120 will work to drive the relay. Use a resistor of around 470 ohm to1K between the arduino pin and the base pin of the transistor.
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #4 on: March 20, 2011, 01:27:06 pm » |
Yes, you need the diode. When you stop the current flow in the delay coil, the physics of the coil will try to keep the current flowing, creating a nasty spike of voltage. The diode dissipates that spike within the coil. The TIP120 will work to drive the relay. Use a resistor of around 470 ohm to1K between the arduino pin and the base pin of the transistor.
Oh yeah! Its like when working with a DC Motor, makes sense. Thanks again. Going out now to get the diodes and hope to try this out this afternoon.
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #5 on: March 20, 2011, 06:47:08 pm » |
This is driving me nuts!!!
So I got it all wired correctly and I can get the relay to turn on using the Arduino pin. I can if test it with a 5v source to the transistor and that works, but not from the 5v on the Arduino pin....
Also what does the resistor do on the Arduino pin to the base of the transistor? What happens if that isn't there? The transistor I am using can handle 5v. I am asking because I didn't use one on my other tip120 that turns a camera on and off.
Any ideas? I have tried everything and it just won't turn on the relay from the Arduino pin. I get 1.1v with a 1k and 1.2v with a 470k. If I connect it to the Arduino 5v rail with the 1k i get 1.3v. Doesn't make sense to me. The difference on output from the rail and the pin is .05v. Shouldn't make a difference.
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #6 on: March 20, 2011, 06:50:32 pm » |
One more question, the relay I bought is a 5/6v and I realized that I will powering it direcly from the battery which is 3.7, is that okay? Should I have gotten a 3v relay? It did work though powering it from the battery which is 4.2v when charged. Should I worry about it or just leave it?
I have to go back to the place anyway to exchange the switch I got, didn't realize it was a momentary switch. Doesn't say on the package or I guess that is what the (on) means instead of without the ().
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 248
Posts: 16535
Available for Design & Build services
|
 |
« Reply #7 on: March 20, 2011, 08:09:49 pm » |
The relay needs current flow to turn on. With 3V you won't get that current flow, so its not likely to work. The resistor between arduino & base limits the current flow out of the arduino - try a lower value.
"I can if test it with a 5v source to the transistor and that works, but not from the 5v on the Arduino pin...." What does this mean?
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #8 on: March 20, 2011, 08:44:08 pm » |
The relay needs current flow to turn on. With 3V you won't get that current flow, so its not likely to work. The resistor between arduino & base limits the current flow out of the arduino - try a lower value.
"I can if test it with a 5v source to the transistor and that works, but not from the 5v on the Arduino pin...." What does this mean?
If the transistor is 5v I could just not use a resistor? If I can get the relay to "click" on with the battery then that should be fine? Since the 5v rating is nominal voltage, it will work under 5v? If I get a 3v relay, so I can use direct to the battery would that be better? Will it be okay to be over 3v when the battery is charged at 4.2? Thanks, just trying to get this all straight in my head.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 248
Posts: 16535
Available for Design & Build services
|
 |
« Reply #9 on: March 20, 2011, 09:17:42 pm » |
The data sheet says the turn-on voltage is 75% of rated - so the 6Vpart should turn on with 4.5V. But you want to limit the power thru the coil to 450mW. The 3V relay has coil resitance of 20 ohm, running it at 5V would dissipate (V^2)/R watts, = 25/20 = 1.25W. The Transistor would drop 0.7V, so (4.3^2)/20 = 0.9W.
The 3V part running off 3.7V battery would be fine - (3^2)/20 = 450mW.
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #10 on: March 20, 2011, 09:23:35 pm » |
So when the battery is fully charged (4.2v) that is why the 5/6v relay will work, but low battery it probably won't. Well I have to go exchange the switch anyway, might as well exchange the relay.
So I tired lower resistance resistors but it still won't turn on with the Arduino pin. Even without a resistor it won't turn on from the pin.
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #11 on: March 22, 2011, 12:26:10 am » |
So I have tired lots of things and get this relay to work right.
I tired with a tip120/tip42/s9013 and the pin can't control the relay.
I was thinking that the Arduino can't supply enough power to turn on the relay. So that it why I tired the tip42, but when I set it to LOW it doesn't go completely low, I can still measure 3.6v. What am I missing? Or can I not use the tip42. I figured if I switched power to the relay coil then I wouldn't need to draw anything from the Arduino pin.
????
Thanks again.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 248
Posts: 16535
Available for Design & Build services
|
 |
« Reply #12 on: March 22, 2011, 12:47:08 am » |
So you're saying you're wired up like this and you can't get the motor control voltage to turn off? And if you're not wired like that, then how are you wired? I want to see a real schematic - go to www.expresspcb.com, download the software, spend a couple of minutes figuring out how to right-click to open the component manager, find a couple of basic parts like I did and show us what you have. The PNP TIP42 won't work here. 
|
|
|
|
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #13 on: March 22, 2011, 01:32:03 am » |
I'll do that tomorrow, in the meant time,
I was going to order some TIP102's?
In your diagram you used 2 TIP120's? What does that do?
|
|
|
|
« Last Edit: March 22, 2011, 02:04:28 am by MobileWill »
|
Logged
|
|
|
|
|
Monterey CA
Offline
Sr. Member
Karma: 0
Posts: 286
Addicted to Arduino
|
 |
« Reply #14 on: March 22, 2011, 02:01:03 am » |
I meant the relay won't turn on when using the pin. So no voltage to the motor controller. For testing I don't have it connected yet.
|
|
|
|
|
Logged
|
|
|
|
|
|