How to GND the relay coil using program?

@robotbramhana

you can go on for hours, days weeks with posting short worded postings.
It is unlikely that such short worded postings will solve the problems.

And this is why I recommend that you post a picture of all your wiring.
The picture must be taken from vertical above.

After taking the picture you should do a quality-check of the picture:
a person that can only see the picture:

  • will this person be able to read the letters on the microcontroller-board?
  • will this person be able to follow each wire from one end to the other end?
  • will this person be able to identify: "this wires is plugged into PIN GND without any doubts? (and not into +5V etc.)

best regards Stefan

1 Like

I am using breadboard shield for easier connection during prototyping only
Black DC female jack is the power supply to which I connect 5V power source. I have connected black wire to NC and red wire to NO.
I have connected motor to comm of both relays
In the back side of the board, I have soldered NO to NO and NC to NC

Yes

Where is the separate 5V supply for the JD-VCC?

So that the letters are readable

You should unload the work of drawing the schematic from the shoulders of your potential helpers.

Relays don't switch immediately and that time is sufficient to cause destructive sparks and more.

The power supply - (negative) need to be connected to the relay board GND.

Done. Still no improvement

The code you show in post #1 shows you are controlling pin 5 but your diagram shows pin 3

Sorry, my bad. It is 5. I checked by connecting it to 5 again. The red light in the relay board turns off after a fraction of second and I can hear more one tick from the relay.

So it's working OK now?

Do you have a digital multimeter?

There are a lot of possible reasons that could cause the behaviour that you observed.

To narrow down the possible reasons to find the real reasons a lot of things must be checked.

Polarity of your external powersupply.
If you have a digital multimeter you should check the polarity of your external powersupply.
Did you really connect Plus to plus and ground to ground.

I will write a pure textbased description. If you understand everything very good. If not you make the experience textbased descriptions have their limits.

If you measure polarity directly on the plug.
More often ground is outside.
next test
if you switch your digital multimeter to test conductivity (beeping if there is conductance)
if you connect one probe of the DMM with the outer contact of the power-supply-socket and the other probe with ground on your relay-board does it beep? = there is conductance ?
Or
does it beep if you connect to motor-vcc?

There must be done more tests to get a detailed picture of what are the facts. But I don't have more time at the moment

best regards Stefan
best regards Stefan

@robotbramhana post 27.
Are you very young?

It seems that very young people have no idea how to post an image in the right aspect ratio. The way you posted it will either give me a pain in the neck when viewing on a laptop, or leave you fighting with the auto position corrector on a tablet.

Please there is more to life than portrait mode, like getting it the way you need to view it.

No, it is not working

Go and experience the

additional work

to read this posting

1 Like

Well, we have been at it for 8 hours. I'm done for today.

Hi,
This might help.

Tom... :grinning: :+1: :coffee: :australia:
PS. My bill is in the mail.

1 Like

Thanks. But it would have been good if the OP had done it. But I suspect it is beyond him.

1 Like

I’d buy that driver just to see it ‘reverse the motor forward’ !