winston65
Posts: 3
Joined: Thu May 23, 2019 6:35 pm

raspberry pi 3b+ connect to sainsmart 8 relay board

Thu May 23, 2019 6:47 pm

total noobie here. I want to connect my pi board to a sainsmart 8 relay board. I've got the jumper wires. I cannot find(or don't know where to look for)the rest of the wiring diagram
I need to know which pins on my pi connect to which pins on the relay boards. I've got the 5v and ground worked out, but have no idea about the rest. If someone could point me in the right direction, I would be grateful.

pcmanbob
Posts: 5968
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: raspberry pi 3b+ connect to sainsmart 8 relay board

Fri May 24, 2019 9:10 am

Hi.

Is the broad you have a genuine sainsmart 8 way relay board ?

If so you might be able to drive it directly from the pi gpio but you will need an external power supply to power the relay board this will need to match the operating voltage of the relay board 5V or 12V are common voltages.

If however your relay board is one of the copies then you will probably need to use an interfacing circuit between the relay board and the pi gpio and you will still need an external power supply to power the relay board.

If you post a link to the board you have we can probably provide you with the correct guidance.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported


pcmanbob
Posts: 5968
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: raspberry pi 3b+ connect to sainsmart 8 relay board

Fri May 24, 2019 7:09 pm

OK so this may work , some people have success doing it this way , but some don't.

If you find your relay board does not work then come back and I will show you the other way to do it.

First you need to remove the jumpr betwen the VCC and JD-VCC pins

Then you need to connect 5V power supply to the ground and JD-VCC pins its not recommended to connect these pin to the pi gpio, as switching relays can cause the pi to crash and reboot due to the voltage spikes so use a separate 5V power supply.

Then you need to connect the pi gpio to the Gnd, In1-8 and VCC pins as shown, you don't have to use the numbered gpio pins I have used they were chosen because it was easy to draw.

Image

note the relay board is active low to turn relay on you have to set the gpio pin to output low.
Last edited by pcmanbob on Fri May 24, 2019 8:02 pm, edited 2 times in total.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

winston65
Posts: 3
Joined: Thu May 23, 2019 6:35 pm

Re: raspberry pi 3b+ connect to sainsmart 8 relay board

Fri May 24, 2019 8:01 pm

thank you very much. This will certainly get me started.

Return to “Beginners”