Switch hookup with relay (arduino)

Discussion in 'The Projects Forum' started by StealthRT, Nov 2, 2012.

  1. StealthRT

    Thread Starter Active Member

    Mar 20, 2009
    223
    0
    Hey all i have the following 5v relay board:

    [​IMG]
    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:

    [​IMG]

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

    [​IMG]

    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: Nov 2, 2012
  2. panic mode

    Senior Member

    Oct 10, 2011
    1,320
    304
    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)
     
  3. StealthRT

    Thread Starter Active Member

    Mar 20, 2009
    223
    0
    So are you saying the 3rd drawing i have in my OP is correct?
     
  4. panic mode

    Senior Member

    Oct 10, 2011
    1,320
    304
    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:
     
  5. StealthRT

    Thread Starter Active Member

    Mar 20, 2009
    223
    0
    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?
     
  6. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    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?
     
  7. StealthRT

    Thread Starter Active Member

    Mar 20, 2009
    223
    0
    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 :)
     
  8. StealthRT

    Thread Starter Active Member

    Mar 20, 2009
    223
    0
    To control it via my ardunio/PC.
     
  9. panic mode

    Senior Member

    Oct 10, 2011
    1,320
    304
    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.
     
    Last edited: Nov 2, 2012
  10. StealthRT

    Thread Starter Active Member

    Mar 20, 2009
    223
    0
    Got it working by hooking it up via the common/normally open connections.
     
Loading...