Pages: [1]   Go Down
Author Topic: controlling a relay  (Read 3610 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry to start a new topic as my first post, but in my defense, I did do some searching.

Has anybody found a easy relay that can be driven by the arduino?  All the ones I found at radio shack seem to need greater than 5V to light up.  I need both 12VDC and 120VAC relays.

Thanks for your help.  I love my arduino, but I am new to electronics.
Logged

London
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Gold Merc Taxi Service
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

(I think/hope this is correct...)

One way to control a relay from the arduino board is to use a transistor inbetween. As follows...



the input goes to the arduino output pin. When the pin goes high (or low - depending on the type of transistor) the transistor allows current to flow and activate the relay. The plus is 12V. I believe you can use a standard darlington transistor array.

You could also use a optoisolator IC, instead of the transistor.

Regards // Jonathan
Logged

my hobby --  www.jonathanbryan.com

my life --  www.ifranks.com  [link]www.silver-collector.com[/link] [link]www.da

Forum Administrator
Offline Offline
Newbie
*****
Karma: 3
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the circuit is correct
the transistor can be a bc547 for smallish relays
while the resistor could be a 2.2k

don't use optocouplers here as they're redundant and the relay is a mechanical coupler anyway:)

for big relays (coil current more that say 100mA) you need to use a darlington or an Mosfet like the IRF520. in that case you can get rid
of the resistor!

have fun

massimo
Logged

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

Moderator: Could we post this circuit somewhere permanent? It could be very handy to have around. smiley-grin
Logged

Sydney, AUS
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm looking for a tid bit more help regarding this. I am an electronics nub basically, but I've done some research.

I want to throw a 12V DC Avionics battery using the arduino.

If I were to use a relay such as this one:
http://tinyurl.com/64jpjn

Control voltage range: 4 - 6VDC
Max. input current: 20mA
Load voltage: 3 - 52.8VDC
Load current: 0.01 - 2

Would I need to modify the R1,D1, or others in this diagram?
http://www.arduino.cc/playground/uploads/Learning/relays.pdf
Also, I just wanted to clarify, can the Relay Power V+ on the right in the diagram come from the Arduino?


Edit: I should explain what I'm attempting.
I have a 12V battery powering a regulator which powers sensors. I want to have a tri-state switch - with states: Off, On, and Computer Controlled. When switched "On" the relay should switch the sensors on. When switched to "Computer Control" an event trigger on a computer (which is on a different power ciruit altogether) will decide the state of the sensors. The "On" state of the switch will be powered via the  12V of the battery, I suppose, whilst I'm unsure of how the arduino "Computer Controlled" will power the relay.

Just for the record, it wasn't my idea. I want a simple on-off switch NOT connected to the arduino. Don't ask me why I want a "Computer Control" setting, because it doesn't make sense to me either.
« Last Edit: April 22, 2008, 02:54:23 am by tchiseen » Logged

What goes up doesn't necessarily have to come down.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just kinda curious, i bought this relay today http://www.radioshack.com/product/index.jsp?productId=2062480 and i was kinda curious how would i get this to work with arduino? could i use the motorshield, or is that not necessary?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 28
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If I were to use a relay such as this one:
http://tinyurl.com/64jpjn

Hm, They are the same as I am planning on using. They seem to work fine but I have only done basic testing. They have a built in LED on the input side so it is easy to see when they are triggered.

They can be triggered directly by the Arduino but observe polarity and note the Pin numbering at the Pins not on the top.

Here, I am using 4 x SY4092's as outputs and 4 x SY4093's as inputs.


So the 4092's can be triggered by The Arduino's 5 volts and switch 3-50 volts at 2 amps.

The 4093's handle 12 volts on the input side so I will use these to switch power from the 5 volt Arduio rail to the input pins.

Jaycar also have 4090 http://jaycar.com.au/productView.asp?ID=SY4090&CATID=28&form=CAT&SUBCATID=754

Which I am using here




I have found you need to be realy careful with these. Connect PIN 1 to your output pin via a 220 ohm resistor, Pin 2 to GND and switch DC on pins 4 (negative) & 5 (positive). Forget the resistor and you smoke the chip...

Pressing the button here will trigger a pattern on the LED's which are being driven by the 3.3 Volt supply on the output side. The LED's represent buttons on my car PC monitor I will be pressing with the Arduino eventually when a voltage on the reverse lights is seen on one of the SY4093's. The result will be that the monitor will select the reversing camera input and return to the VGA input when the reversing lights go out.

Logged

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey DaveD, it's been in the playground forever:
http://www.arduino.cc/playground/uploads/Main/relays.pdf

PS This post made me a "full member" now smiley

« Last Edit: March 19, 2009, 12:16:38 pm by florinc » Logged

Pages: [1]   Go Up
Jump to: