0

I have a 4 channel relay for my Arduino. Here's an image:

Relay

From what I can tell, it's rated for 5V direct current because of the big 05VDC at the bottom, but please tell me if I'm wrong? If I'm wrong, then that's the problem here.

I've tested out an LED on 5V DC to work and connected it to output side of the relay.

I've connected my Arduino to the input, programmed with the following code:

const int RELAY_PIN = 3;

void setup() {
  pinMode(RELAY_PIN, OUTPUT);
  Serial.begin(96000);

}

void loop() {
  Serial.println("Relay ON");
  digitalWrite(RELAY_PIN, LOW);
  delay(1000);

  Serial.println("Relay OFF");
  digitalWrite(RELAY_PIN, HIGH);
  delay(1000);
}

I can confirm that the corresponding LED on the relay for channel 4 does blink for 1 second and stay off for 1 second, which I'm expecting it's meant to do. I've never worked with an Arduino or a relay before.

However, the 5V DC LED on the other end never lights up. Why is my relay not switching on?

Edit: About the LED circuit. It is on and fully powered. If I bypass the relay and join the two wires, the LED lights up. If I plug the two wires into the relay, the LED never lights up.

Edit2: About the jumper: I have a secondary 5V power supply connected to the VCC for what I'm told is isolation. I've read a little on the matter, but am not fully aware of how it works.

Edit 3:

Connections

I have the following connections:

  • Output 3 (Arduino) to Input 4 (Relay)
  • 5V (Arduino) to Input VCC (Relay) [The one next to the input pins]
  • Power supply positive/ground to GND (Relay)
  • Power supply negative/live to VCC (the one next to the JD-VCC)

This did not work. What did work was the following configuration:

  • Output 3 (Arduino) to Input 4 (Relay)
  • 5V (Arduino) to Input VCC (Relay) [The one next to the input pins]
  • Jumper across VCC and JD-VCC on the Relay
8
  • Guessing (with out a schematic), you didn't add a power source to the relay to LED circuit? I don't see any wires on that side of the board. So I am not sure where the LED that is not lighting up is located. Let me know here in a follow up comment and I'll post an appropriate answer you can accept so others who find your question with a similar problem will have an appropriate answer.
    – st2000
    Commented Apr 16, 2019 at 0:28
  • @st2000 I did. Sorry, I'm not a hardware person so I don't even know how to make a schematic. But let me edit the question. Commented Apr 16, 2019 at 0:31
  • oh, I see the problem. You are missing the jumper on JD-VCC. So, instead of a jumper - there is a blue wire - where is the blue wire going?
    – st2000
    Commented Apr 16, 2019 at 0:35
  • @st2000 secondary 5V power supply connected to VCC :) sorry, editing the question. Commented Apr 16, 2019 at 0:38
  • So, if the secondary power supply is 5V, then your setup will probably work if you move it to the other side of the pair of pins. Also, you will need to connect the grounds of the 2 power supplies together. See the schematic in my answer below. But I think most people just put a jumper across J5 or JD
    – st2000
    Commented Apr 16, 2019 at 0:40

2 Answers 2

2
  • From the image in the question, the jumper across pins J5 (in the below schematic) or JD as on the silk screen on the PBC is missing. enter image description here

  • Using the above schematic, a choice to power the Ardino and the relays off of one 5V power supply can be made. This appears to be done by connecting the 5V to the VCC pin, Ground to the GND pin & placing a jumper across J5. However, it appears that the relays can be isolated from the Arduino if desired. This appears to be done by connecting the Arduino's 5V to pin 2 of J5. That should be enough to light up the LED indicator and therefor the optical isolator when the Arduino's output to IN1, 2, 3 or 4 is low. Then, connect the 2nd power source 5V to pin 1 of J5 and the ground from the 2nd power source to pin GND. This last step should provide the power to close the relays when the Arduino takes IN1, 2, 3 or 4 low.

  • Lastly, make sure the polarity of the 2nd power supply (if one is used) is correct. The output side of the optical coupler and the transistor driving the relay only work when the current is passing in the proper direction. Not to mention, the reverse bias flyback diode (D1, 2, 3 & 4) would short out the power supply if connected in the reverse direction. However, this catastrophe is avoided here as the transistors (Q1, 2, 3 & 4) would not pass current in the reversed direction.
4
  • Hi, your suggestion to join the grounds and move the pin to the other side did not work. However, something else did, please see Edit 4 for the configuration that did. However, the Arduino is no longer isolated, what do you suggest? Commented Apr 16, 2019 at 0:57
  • (I only see an Edit 3.) The option to drive the relays from a different power source than the Arduino is not necessary. Especially if you are using a good 5V power supply with plenty of current capability. What is important is the isolation the relays provide from what ever you are planning on connecting to the relay contacts. If you want, you can continue using 2 independent power supplies. Actually, looking at the schematic I found, you don't need to connect the grounds together (my bad). I'll amend my question as I'm running out of room here in this comment.
    – st2000
    Commented Apr 16, 2019 at 1:18
  • The error was so dumb, I don't want to admit it. I had the external power supply connected in reverse because "negative ground" did not make sense to me. But I would never have caught it if not for your diagram. Could you please add a suggestion to ensure that the connections are correct, and I'll mark yours as accepted? Thank you for your help. Commented Apr 16, 2019 at 2:06
  • Ah, good to know you've got it working. And that you understand it. I'll see if I can add something.
    – st2000
    Commented Apr 16, 2019 at 2:39
1

A relay is an electromagnet-driven switch. It opens and closes that switch, but doesn't provide power.

Assuming it's like my relays, that relay can either power the relay coils AND the logic inputs, or (if you remove the jumper) use separate power for the relay coils and the logic signals.

Since you've removed the jumper, you need to provide 2 different 5V power sources to drive the relay - one high-current supply to the VCC, which runs the logic circuits and the relay coil. Another to the logic power in. Then you ground the input pin to activate one of the relay channels.

Finally, you need to wire the screw terminals on the left side into a circuit with separate power that controls something. For an LED, you'd need power, the LED, and a current-limiting resistor wired in series with the screw terminals on LED channel 1.

For an LED this is serious overkill. You could drive the LED directly (with a current limiting resistor) from the Arduino logic signal.

5
  • Hi Duncan, I have a secondary power supply on the VCC, and this setup is a test setup to learn how Arduinos and relays work. I plan on connecting replacing the LED with something higher powered later on. Commented Apr 16, 2019 at 0:49
  • In your picture you don't have anything connected to the switched side of the relay (the screw terminals on the left side.)
    – Duncan C
    Commented Apr 16, 2019 at 1:21
  • Yes, when I snapped the photo, I was testing the LED circuit to ensure it was working properly so I took them off. The LED circuit works fine and is inserted properly. I've managed to make the relay finally work with the jumper on. Please see Edit 3. Commented Apr 16, 2019 at 1:27
  • So who down-voted my answer, and why? It's fine if you think my answer is lacking, but please explain.
    – Duncan C
    Commented Sep 20, 2019 at 22:31
  • Have an upvote on me, since I think it's good. :) Commented Sep 21, 2019 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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