1
\$\begingroup\$

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?

\$\endgroup\$
3
  • \$\begingroup\$ Mechanical relays typically have contact bounce much worse than a tact switch does. Some hefty debouncing might be needed, to avoid detecting a number of switch pushes instead of one. \$\endgroup\$ Commented Nov 2, 2012 at 13:55
  • \$\begingroup\$ Would a solid state relay work better in terms of reducing - eliminating bounce? \$\endgroup\$
    – Piotr Kula
    Commented Nov 2, 2012 at 14:04
  • 1
    \$\begingroup\$ @ppumkin Absolutely. SSRs have no physical vibration on switching, hence no contact bounce. They also have much greater longevity due to not having moving mechanical parts that can get bent, pitted by arcing, or bonded together into a short. \$\endgroup\$ Commented Nov 2, 2012 at 15:20

2 Answers 2

2
\$\begingroup\$

1) The connection between the relay/pushbutton and Arduino ground isn't necessary to make the circuit work at you describe. You don't tell us anything about the PCB that the pushbutton is mounted to, so this ground connection may be required for the rest of your system to work or it may cause undesirable ground loops. Again, you don't share enough to comment, but I'd start without it.

2) The relay wiring may or may not be correct. You're connecting it the same way that the light bulb example uses the relay, so if the light bulb example works, your approach will work. However, the light bulb example is in conflict with the silkscreen on the board, which suggests that the relay contacts that you want (normally open) are the top leftmost terminal and the 3rd from the left (which you're currently using). The silkscreen does not show any connection to the 2nd from the left terminal, which you're currently using.

3) Andino Ghosh is absolutely right that contact bounce will likely be an issue. Depending on the design of the PCB that has the pushbutton on it, a small capacitor in parallel with the relay contacts may help (~1uF), but again without details on this half of your design it is tough to say for sure.

\$\endgroup\$
2
  • \$\begingroup\$ The switch is a wireless switch to my door lock. Its powered by a 3v battery. My goal is to have the relay act as if i pushed the button myself. I took 1 wire lead and touch both pins on the left side of the switch and it worked as if i pushed down the button. Now i am trying to figure out how to replicate that using the relay. \$\endgroup\$
    – StealthRT
    Commented Nov 2, 2012 at 20:43
  • \$\begingroup\$ Then you don't need to connect the Arduino ground to the relay side of the circuit. All of my other comments apply. If you can post a link to the datasheet for the relay board, perhaps we can help you sort out the correct relay connections. \$\endgroup\$
    – HikeOnPast
    Commented Nov 4, 2012 at 2:02
1
\$\begingroup\$

Needed to hook it up like so: relay

That works just as if i were to push the button!

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.