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?
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:
Don't forget a diode across the coil.
If using larger current coil, then find a logic level N-channel MOSFET instead.
I was wondering if for the relays if any of these would work? RadioShack.com Official Site - America's Technology Store, 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).
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?
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: RadioShack.com Official Site - America's Technology Store
x11kjm:
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.