[SOLVED] Wiring of a dual channel relay: HL-52S question

How would one wire this so that it works off of the JD-VCC? I can only get the relays to cycle with the jumper in place and the IN1, GND, and +5v connection to the Arduino. With +5v external, supply GND, Arduino +5v, and IN1 the LED lights but the relay doesn't engage.

I've read similar threads regarding this topic/ relay configuration but none of the explanations provided a straightforward answer.

Thank you :smiley:

//the relays connect to
int IN1 = 4;
int IN2 = 5;
#define ON 0
#define OFF 1
void setup()
{
 relay_init();//initialize the relay
}
void loop() {
 relay_SetStatus(ON, OFF);//turn on RELAY_1
 delay(2000);//delay 2s
 relay_SetStatus(OFF, ON);//turn on RELAY_2
 delay(2000);//delay 2s
}
void relay_init(void)//initialize the relay
{
 //set all the relays OUTPUT
 pinMode(IN1, OUTPUT);
 pinMode(IN2, OUTPUT);
 relay_SetStatus(OFF, OFF); //turn off all the relay
}
//set the status of relays
void relay_SetStatus( unsigned char status_1, unsigned char status_2)
{
 digitalWrite(IN1, status_1);
 digitalWrite(IN2, status_2);

Subtract 2 relays for your module. :slight_smile: NOTE: No ground from module to Arduino:
OptoRelay4X_Wiring.png
Or 6 for this one:
D0upWXs_d.jpg

OptoRelay4X_Wiring.png

D0upWXs_d.jpg

In that configuration the LED blinks but the coils don't engage. The only way they work is with the jumper. Is there something else I'm missing?

What 5V power supply are you using for JD-VCC? It must be able to supply enough current for 2 relays (150mA).
Post a picture of your setup.

Using a 5V 1A supply for JD-VCC and -5v GND. Arduino is being powered from a bench PSU at 9v. The LED cycles but coils don't move.

Are you, by chance, using a 3.3 volt Arduino or Node-MCU or ? ?

So far this is the only configuration that works. Trying to power this unit separately to make this project stable with the MFRC522.

JD-VCC - VCC jumper
GND - Arduino GND
IN1 - Arduino pin 7
VCC - Arduino +5v

81828513_859763374472286_1600877329335189504_n.jpg

81828513_859763374472286_1600877329335189504_n.jpg

Looks like that yellow wire is going to Arduino GND pin instead of 5V pin. Check it.

Correctly connected to 5V. (sorry, better photo) -

I appreciate the effort! Like I said I've read almost every thread on powering relays externally and I'm still left scratching my head.

Well it’s beginning to look like you might have a bad external supply, turn off all power, remove the JD-VCC jumper, remove GND wire from Arduino, connect external +5V wire (RED?) to JD-VCC pin, connect external GND (BLACK ?) to GND (-) on left terminal strip. Do you have a DMM to check voltage on JD-VCC pin?

Can also confirm the +5v is there.

You need to test it while connected to the module. Look at the connectors, there's a silver clip on one side, turn the connector so the clip is accessible to the meter probes.

Aha! had it backwards. Working now. Thank you tons, the power supply was reverse polarity.

wow, all I can say is thank you JCA34F

OK, good luck and have fun, Karma point for persistance. :slight_smile: