Relay problem

I am using sainsmart 12v 16 channel relay with raspberry pi 3 model b+. I m connecting two 5v and ground from rpi to relay board, powering telay board with 12v adapter and connecting gpio pin 4 to relay input.

Plz any one confirm, this is correct wiring?

I’m not sure if +5V is necessary, but please remove the antistatic shielding bag as it conducts the current.

Thank you for a quick response… removed bag :stuck_out_tongue_winking_eye:

I have connected 5v and tested it but relay automatically get started when starting openhab and stops only when stopping openhab…

In between if i switch it on/off through web or phone, then also it is in ON state. Plz help me…

My understanding you don’t need to connect 5V from outside source to the board - it has it’s own regulator which produces 5V from 12V source.
Also check what is the right initial input state (Low vs. High) for the board and configure your RPi outputs accordingly. I would suggest to first shutdown the OH then play with the port states from the command line.

Thank you sir,
I succeed in controlling relay board from raspberry pi.

Sorry if I am bringing this old thread back. Mitesh. I am having the same issue as you. Can you share how you resolved yours? Thanks