Connecting arduino to relay?

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
capo12
 
Posts: 6
Joined: Thu Apr 26, 2012 1:04 pm

Connecting arduino to relay?

Post by capo12 »

I would like to make a simple LED to turn on and off using a relay that is controlled by the arduino. I have a relay (G2VN-234PH-US - http://www.datasheetarchive.com/G2VN-23 ... sheet.html) but it has so many pins that I am confused on how to connect it.

Can anyone tell me specifically how to wire up this relay so that it would take the LED circuit and turn it on & off based on the command from the arduino digital pin?

Below is the wiring details of the relay (with numbered pins) and the "general" wiring. Specifically... which cables go to which pin in the relay?

Thanks!!!
Attachments
2. general wiring.jpg
2. general wiring.jpg (30.87 KiB) Viewed 1611 times
Relay circuit
Relay circuit
1. relay_circuit.jpg (26.44 KiB) Viewed 1611 times

User avatar
Franklin97355
 
Posts: 23939
Joined: Mon Apr 21, 2008 2:33 pm

Re: Connecting arduino to relay?

Post by Franklin97355 »

Pins 1 and 16 is the relay coil and the rest are what is called a dual pole dual throw switch. When the relay energizes the wiper moves to the other set of contacts so you can make it normally open or normally closed by choosing the pins.

capo12
 
Posts: 6
Joined: Thu Apr 26, 2012 1:04 pm

Re: Connecting arduino to relay?

Post by capo12 »

thanks franklin!

ok... I am still a bit confused. Let's use this picture as a reference. Say that I wanted to use the arduino digital pin to turn "on" or "off" (basically, pass or not-pass 5v through that cable) to the digital switch. The switch itself would control if a LED running on 3.3v would be on or off.

So, using the picture below as a reference, iI wanted to have the LED turn ON whenever I send a signal (5v) through the arduino digital pin, would I install the positive leg of the LED on the relay's pin #13 and the other end to the +3.3v?? For the negative leg, would I then connect it to relay pin #8 and to ground? Is this correct?

Thanks... sorry for the confusion
Attachments
3 circuit.jpg
3 circuit.jpg (45.01 KiB) Viewed 1599 times

User avatar
john444
 
Posts: 443
Joined: Sun Mar 04, 2012 2:42 pm

Re: Connecting arduino to relay?

Post by john444 »

Hi Capo,
From the schematic it appears that you determined that 1 & 16 are each side of the coil.
Pin #4 is a moving contact that connects to pin #6 when the coil is not energized .
Pin #4 connects to pin #8 when the coil is energized.
There is another set of contacts that are isolated for the others;
pin #13 is the moving contact that connects to pin #11 when the coil is not energized.
Pin #13 connects to pin #9 when the coil is energized.

You have many options to connect external circuitry to the relay’s contacts.
Pins 4, 6, & 8 work together as do pins 13, 11 & 9.
If you want to use pin 13 with 9 then - ground pin 9, LED to pin 13, positive of LED to resistor,
Resistor to +V. (3.3v is kind of low.)
The resistor is used to limit current through the LED from a voltage source.
Lady Ada has a good tutorial on LEDs if you have questions about them.

capo12
 
Posts: 6
Joined: Thu Apr 26, 2012 1:04 pm

Re: Connecting arduino to relay?

Post by capo12 »

Hi John et al.

thanks for the responses. I am still a bit confused, so I've prepared a diagram of the circuit I'm trying to put together (sorry - it is rather crude). Please see attached.

So, basically, I have a Logomatic V2 data logger that I want to be able to switch on and off by means of a digital pin. Since it uses up to 80mA, I cannot connect the datalogger's X1 directly to an arduino digital pin, so I have to use a relay that keeps the data logger's circuit separate from that of the arduino. In this way, I can have the relay serve as a switch that completes the connection between X1 and X2 (to turn on the logger while keeping this circuit separate from the arduino) based on a signal from the arduino.

In the diagram, I am using pin 8 as the digital output pin to control the relay. Although I am starting to better understand how this works, I am still confused on a few things (sorry for the many questions... thank you for your patience & guidance!!):

a. where do I connect the "relay power V+"to?
b. where do I connect the "relay power GND" to?
c. can I connect the "GND" (bottom of sketch) to the arduino GND?
d. would X1 be connected to relay pin 13?
e. would X2 be connected to relay pin 9? (this way, would the logger turn on when the arduino pin is set to OUTPUT?)

Any advice & suggestions would be great... Thank you SOOOO much!!! :-)
Attachments
draft_circuit1.jpg
draft_circuit1.jpg (78.82 KiB) Viewed 1591 times

User avatar
john444
 
Posts: 443
Joined: Sun Mar 04, 2012 2:42 pm

Re: Connecting arduino to relay?

Post by john444 »

Your question makes more sense to me seeing your schematic.
The relay is just a switch that changes position when the coil is energized.
You got it - connect X1 to 13 and X2 to 9.

You may use the other set of contacts for something else or just ignore them.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”