Pages: [1] 2 3   Go Down
Author Topic: [Q] Robot with dual batteries and relay for 2nd battery  (Read 1798 times)
0 Members and 1 Guest are viewing this topic.
Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In referance to this post, I bought a relay to try.
http://arduino.cc/forum/index.php/topic,55492.0.html

This one
http://www.nteinc.com/relay_web/pdf/R73.pdf

I 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.pdf

How 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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23607
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

Monterey CA
Offline Offline
Sr. Member
****
Karma: 0
Posts: 321
Addicted to Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Current Projects:                    Arduinos:
Security Robot Tank               Uno
Security Robot II 4WD            Mega2560

http://mobilewill.blogspot.com

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