1
\$\begingroup\$

I seems that my 4 channel relay module is acting the opposite of how I thought it should act. When I do use the Arduino "digitalWrite(relay, HIGH);" essentially turning power on to the relay, the relay switch is open. When I write "digitalWrite(relay, LOW);", it closes. How is that correct? I thought when you energized the coil, the switched closed to complete the circuit, not the other way around.

\$\endgroup\$
  • 1
    \$\begingroup\$ I'm not too knowledgeable on the Arduino, so please excuse me if this sounds odd: Are you maybe connecting to the NO terminal of the relay instead of the NC terminal? Is there anything in the documentation that suggests that the switch is inverted or if it sinks currents rather than source it? \$\endgroup\$ – Shabab Nov 15 '13 at 17:19
5
\$\begingroup\$

The relay module inputs are active low. They are designed to work that way.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ So I didn't connect it backwards or anything? Doesn't low mean no voltage? How will the coil energize without voltage? \$\endgroup\$ – Matthew Berman Nov 15 '13 at 18:37
  • 1
    \$\begingroup\$ The input is the low side of a optocoupler and led. Low means close to Ground Potential or Voltage. Since the high side of the optocoupler and led is connected to VCC, setting the pin High means both sides of the circuit are at the same High/VCC potential. Setting it low means there is a difference in voltage. By setting the pin low, you create the ground for the optocoupler, allowing current to pass, turning it on. Look for information on Arduino LEDs with Common Anode and Common Cathode for more information on how it works. \$\endgroup\$ – Passerby Nov 15 '13 at 18:56
  • 1
    \$\begingroup\$ @MatthewBerman basically, by setting the pin high, you have 5v on both sides of the module input circuit, which means no current passes. When you set the pin low, you have 5v on one side, and 0v at the arduino pin, so current passes, turning the optocoupler on, which turns the relay on. \$\endgroup\$ – Passerby Nov 15 '13 at 18:59
  • \$\begingroup\$ @Passerby I see now where you got that schematic. You're right, +1. \$\endgroup\$ – Samuel Nov 15 '13 at 19:03
  • \$\begingroup\$ @passerby +1 I have the Keyes version of this (dx.com/p/…) and it requires a write high to turn on. Good catch- I would not have thought about it being active low. \$\endgroup\$ – mikeY Nov 15 '13 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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