Pages: [1]   Go Down
Author Topic: Arduino + SPDT Relay  (Read 1982 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 28
Sort of...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all, I have a very simple question (im pretty new), I am using an Arduino Duemilanove connected to an spdt relay (thats controlling a 12v motor), turning it on for about 30 second periods or less.  Im not using PWM, just simply turning it on and off.  What components do i need in order to keep it working, but not fry the Arduino, or is it okay by itself?  Also, what would i need to protect it when using LEDs?  Would this be a resistor? If so, what type?

Thanks for the help
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26344
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

You just need some simple things like I show here.
Specific values will depend on the parts you want to use.
For single LEDs, 270 ohm resistors.
For switches, 10K pullup or pull down resistors.
For relay not needing much current, maybe a 2N2222, NPN type transistor.  Can switch 5V or 12V coil in a small relay, bunch are listed here:
http://www.dipmicro.com/store/index.php?searchStr=relay&act=viewCat&Submit=Search
Don't forget a diode across the coil.

If using larger current coil, then find a logic level N-channel MOSFET instead.


* example_hookups.jpg (75.89 KB, 960x720 - viewed 132 times.)
« Last Edit: February 19, 2011, 01:52:03 am by CrossRoads » 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.

0
Offline Offline
Newbie
*
Karma: 1
Posts: 28
Sort of...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wondering if for the relays if any of these would work? http://www.radioshack.com/family/index.jsp?categoryId=2032279, or if there is any alternative which would still be able to protect the arduinos. I am using 30 amp 12v relays (which work w/ 5v).

Thanks
« Last Edit: March 01, 2011, 08:48:00 pm by x11kjm » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 28
Sort of...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Finally!, found out that the transistors can be found in a bundle.  Thanks for the help
Logged

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

To actually give you a detailed useful answer we need to know what coil voltage your relay is designed to use and how much coil current it draws at that rated coil voltage. Do you have a link to a datasheet for the relay?

Lefty

« Last Edit: March 01, 2011, 09:00:25 pm by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 28
Sort of...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well, the coil voltage of the relay is 12v, however it fires with the power the arduino gives out.  How would i be able to find out what the transistors should be?  Heres the part: http://www.radioshack.com/product/index.jsp?productId=2062477
Logged

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

Do you need a 30A switch? If you only need <5A you can just use a small transistor and no need for a SPDT switch.
Logged

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

well, the coil voltage of the relay is 12v, however it fires with the power the arduino gives out.  How would i be able to find out what the transistors should be?  Heres the part: http://www.radioshack.com/product/index.jsp?productId=2062477

You really should be using 12vdc for a 12 relay coil. Here is the classic drawing of how you can drive your relay from an arduino. Just substitute your relay coil terminals where the solenoid coil is shown.

However the simpler method would be to just drive your motor directly using this solenoid circuit, no need for a relay in the middle.

http://arduino.cc/playground/uploads/Learning/solenoid_driver.pdf

Lefty
Logged

Pages: [1]   Go Up
Jump to: