Relay sometimes failed to close

I got a project using arduino and 8 channels relay to switch on lights, now I got a problem of some channels can switch on all the time, but sometimes fail to switch off. If I repeat the process of switch on and off, sometimes it will switch off successfully. No ‘click’ sound is heard while I try to switch off but the led on the relay is off. Any idea on this? Thanks.

Attached is the way how I connect the arduino and relay:

8 relays board, you should power it with an extra supply. It needs more current than Arduino board can give or take without damage.
Do you have instructions for the relay board with specs? What does it need? Get more power capable supply so it is not running max.

If the relays are optical-isolated do not connect relay board ground to Arduino ground. If they are not isolated relays then you must connect the grounds. Isolated is better, less chance of relay switchings resetting the Arduino.

Will provide external power to arduino via 9v adapter help?

ahjin:
Will provide external power to arduino via 9v adapter help?

The controller board can only handle limited total current and that only for so long.
All those relays together need more than you should run through that board. The voltage dropped until reset, if you add more power then when there is enough to burn parts up you can get that smoke.

You power the relays external to protect the controller from overload and heat. And you make sure about if they are isolated or not!

I found the diagram above somewhere else in this forum, is the diagram good to go? I got a spare power adapter rated 5v 3.5amp, ok to use?

I don't know that relay to say what happens. Why is that GND not connected yet the Arduino 5V is? It don't look right to me.

Disconnect Arduino 5V, then connect GND to Arduino board, is this correct?

The diagram in post #4 works as shown.

This shows the current flow:

OP’s wiring.

larryd:
The diagram in post #4 works as shown.

This shows the current flow:

OP’s wiring.

May I know what is OP's wiring?

You are the OP, Original Poster.

ok, thanks.