Switch hookup with relay (arduino)

Thread Starter

StealthRT

Joined Mar 20, 2009
303
Hey all i have the following 5v relay board:


Please ignore the light bulb hook up. That was an example on the website that had the same relay :)

And i am looking to hook one of the relays up to a monetary switch:



Now this is what i am guessing is the way i connect the switch to the relay board:



Connecting the ground to both the left connector pads on the switch and shorting them together "presses" the button. I just want to make sure the hookup i have drawn there is the way it should be connected to that relay board?

So when i apply 5v to the pin 1 on the relay board (Arduino Digital pin 3 goes high) it will close the circuit in relay 1 which will act as if i "pressed" the button?
 
Last edited:

panic mode

Joined Oct 10, 2011
2,746
yes, top side terminals on the relays board PCB going from left side are:

1. normally closed contact Relay1 (not used)
2. common contact Relay1 (one side of PB)
3. normally open contact Relay1 (other side of PB)
4. normally closed contact Relay2
5. common contact Relay2
6. normally open contact Relay2
7. normally closed contact Relay3
8. common contact Relay3
9. normally open contact Relay3
etc

relays are common type, everyone makes relays in this formfactor (like Tyco T7..., ). note that the silkscreen drawing of a switch is not correct, probably due space restriction (very close to edge of PCB). it should show something like here.

if you want the opposite relay action, just move wire from 3 (NO contact) to 1 (NC contact)
 

Attachments

Thread Starter

StealthRT

Joined Mar 20, 2009
303
yes, top side terminals on the relays board PCB going from left side are:

1. normally closed contact Relay1 (not used)
2. common contact Relay1 (one side of PB)
3. normally open contact Relay1 (other side of PB)
4. normally closed contact Relay2
5. common contact Relay2
6. normally open contact Relay2
7. normally closed contact Relay3
8. common contact Relay3
9. normally open contact Relay3
etc

relays are common type, everyone makes relays in this formfactor (like Tyco T7..., ). note that the silkscreen drawing of a switch is not correct, probably due space restriction (very close to edge of PCB). it should show something like here.

if you want the opposite relay action, just move wire from 3 (NO contact) to 1 (NC contact)
So are you saying the 3rd drawing i have in my OP is correct?
 

panic mode

Joined Oct 10, 2011
2,746
almost, if you want relay contact to be in parallel with the button so that relay can simulate button press, just connect relay contact to the switch, but do not introduce any new potential by connecting other signals (GND or whatever).

your button already has bias on the board. by connecting external signals you are likely to ruin something. all you need is a switch (or equivalent) to replace or work as the one that is already there.

here is what you should have:
 

Attachments

Thread Starter

StealthRT

Joined Mar 20, 2009
303
almost, if you want relay contact to be in parallel with the button so that relay can simulate button press, just connect relay contact to the switch, but do not introduce any new potential by connecting other signals (GND or whatever).

your button already has bias on the board. by connecting external signals you are likely to ruin something. all you need is a switch (or equivalent) to replace or work as the one that is already there.

here is what you should have:
Thanks for the image there but i have a question about that. Where does the 0v (ground) come from since the relay is being triggered by 5v? Wont 5v come out of the common output?
 

mcgyvr

Joined Oct 15, 2009
5,394
Just so its clear.. You want the switch to bypass the relay contacts right.. So you can either press the switch or switch pin 1 high to power your device..right?
 

Thread Starter

StealthRT

Joined Mar 20, 2009
303
Just so its clear.. You want the switch to bypass the relay contacts right.. So you can either press the switch or switch pin 1 high to power your device..right?
I wont need to push the switch after i connect it to the relay. That's the point of the relay to do it for me :)
 

panic mode

Joined Oct 10, 2011
2,746
then use circuit that i posted above (post #4). it does not get any simpler.

do you understand what a relay is and how it works?
it has contacts that are basically same thing as button. you connect those in parallel to your button. that's it. NOTHING else connects to board with button, specially not something that has potential or it may interfere with the circuit with button.

using relays accomplishes just that, contacts are ISOLATED from relay COIL. this means that relay coil can safely be part of the arduino circuitry. the dashed blue line show invisible link from coil to contacts (it is magnetic field produced by coil that moves relay armature).

the point i'm trying to make is that you don't know for sure what button circuit is and where exactly 'a' and 'b' are connected, you don't know which of them is positive or if the loop is continuous or multiplexed.

the things is - you don't need to!

all you care is that this thing has two wires and that button is open circuit unless it is pressed. if you wire relay as i have shown, the relay contact is across the button. follow circuit from a to b and you will see that either button (when pressed) or relay (when activated by arduino) will enable circuit to close from a to b. THAT'S IT..! the rest of the "one circuit" has no way to tell which of them was active, it will do the same thing regardless is button is pressed or relay is energized. the way i understand, this is what you want.

if you connect something else from arduino or relay board to your "Device with button", you are risking short circuit in case there is already galvanic connection between two circuits. I imagine that you would not like that. So DON'T do it. connect ONLY relay contact (and ONLY contact) to your "device with button". also you will not have to worry if one or the other use 1.8V or 3.3V or 5V or 12V or 100V or something else.

arduino and relay board need to share common or GND because your relay board expects "wet" signal (potential) from arduino. this connection is not isolated because you need to complete circuit.
 

Attachments

Last edited:
Top