gordon77
Posts: 4634
Joined: Sun Aug 05, 2012 3:12 pm

Modifying the sainsmart 4 relay module

Wed Dec 18, 2013 9:50 am

I bought one of these but seeing they appear to be inverted to what I wanted, eg 0 to power the relay, which means they all power at boot up, I decided to modify it.

I removed diodes IN1,2,3 & 4 and resistors R1,4,5 & 8 (I note in the documents these can have different numbers).

I then connected 4 x 300ohms resistors to the right hand pads where the diodes were and connected the other ends to the right hand pads where R1,4,5 & 8 were.

I then linked all the left hand pads where the diodes were together and to GND.

Put the Vcc - JD-Vcc link in.

The module doesn't now need 3.3v from the RPi, connect the Vcc connection on the module to 5v on the RPi.

This requires some level of skill at soldering, and obviously at your own risk.

Gordon77
Attachments
relay mod.jpg
schematic
relay mod.jpg (13.78 KiB) Viewed 5092 times
relay_back.jpg
back
relay_back.jpg (43.56 KiB) Viewed 5092 times
relay_front.jpg
front
relay_front.jpg (62.41 KiB) Viewed 5092 times

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: Modifying the sainsmart 4 relay module

Sun Aug 10, 2014 4:44 pm

Hello!
On the 2nd image, did you highlighted two real wiring, right?
Is the same kind of conjunction visible on the 3rd image, between IN2 and IN3?

Thanks.
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

gordon77
Posts: 4634
Joined: Sun Aug 05, 2012 3:12 pm

Re: Modifying the sainsmart 4 relay module

Sun Aug 10, 2014 5:06 pm

yes , do these pics help ?
Attachments
back2.jpg
back wires
back2.jpg (28.04 KiB) Viewed 4620 times
front2.jpg
front wire
front2.jpg (29.16 KiB) Viewed 4620 times

proggod
Posts: 6
Joined: Wed Aug 06, 2014 1:53 am

Re: Modifying the sainsmart 4 relay module

Sun Aug 10, 2014 8:03 pm

What did you do exactly? The relay lets you connect for power on at boot or power off at boot that's why it has 3 pins. What does your mod do if not that?

gordon77
Posts: 4634
Joined: Sun Aug 05, 2012 3:12 pm

Re: Modifying the sainsmart 4 relay module

Sun Aug 10, 2014 8:20 pm

Which 3 pins? It has connections for gnd, 4 inputs and Vcc, and a link where you can connect an external supply for the relays.
No means of choosing powered on /off that l can see.

The mod means an active high from the Pi will activate the relays

Gordon77

User avatar
Shoka
Posts: 145
Joined: Sat Jul 12, 2014 8:35 pm
Location: Manchester, UK

Re: Modifying the sainsmart 4 relay module

Sun Aug 10, 2014 10:01 pm

What the poster upstream was pointing out I think is that the output relays are change over.

So whatever state the relays are by default you can select the output state you want...

However that ignores the problem that the outputs state will change if the Pi powers up or down, which may well not be desirable, so at least for some applications I think your mod is valid.
Cheers Harry

gordon77
Posts: 4634
Joined: Sun Aug 05, 2012 3:12 pm

Re: Modifying the sainsmart 4 relay module

Mon Aug 11, 2014 2:20 am

I agree you can choose the output state, N/c or N/o, but not if the relays are powered by a gnd or a high.

I should have also mentioned...

People have also struggled to drive this type of board with 3.3v, the output of gpios, when its designed for 5v from an arduino, this also solves that issue.

And also avoids needing both 3.3v and 5v supplies from the Pi, which can be a risk if you connect them together, possibly with the link on the board!!. 3.3v would be needed for Vcc and 5v to power the relays.

If you don't think you need the mod then don't use it but other users have done similar mods, and many have built inverting circuits to drive it, this avoids needing that.

Gordon77

User avatar
dentex
Posts: 180
Joined: Sun May 20, 2012 7:58 am
Location: Italy
Contact: Website

Re: Modifying the sainsmart 4 relay module

Mon Aug 11, 2014 10:50 am

gordon77 wrote:yes , do these pics help ?
gordon77 wrote:I agree you can choose the output state, N/c or N/o, but not if the relays are powered by a gnd or a high.

I should have also mentioned...

People have also struggled to drive this type of board with 3.3v, the output of gpios, when its designed for 5v from an arduino, this also solves that issue.

And also avoids needing both 3.3v and 5v supplies from the Pi, which can be a risk if you connect them together, possibly with the link on the board!!. 3.3v would be needed for Vcc and 5v to power the relays.

If you don't think you need the mod then don't use it but other users have done similar mods, and many have built inverting circuits to drive it, this avoids needing that.

Gordon77
Thank you very much, because this mod totally rocks. I hope I will able to implement it on the similar board I'm waiting for.
:D
One of my projects with the Raspberry Pi:
--------------------------------------------------------
(Raspberry) Pi Aquarium Controller: https://github.com/dentex/piac

justdoug
Posts: 1
Joined: Tue Sep 26, 2017 5:14 pm

Re: Modifying the sainsmart 4 relay module

Tue Sep 26, 2017 5:18 pm

Has anyone tried this mod to the 16 relay module? The resistors are very small but do-able with a magnifying glass and a fine tip soldering iron.

Thanks.

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

Re: Modifying the sainsmart 4 relay module

Wed Sep 27, 2017 10:00 am

justdoug wrote:
Tue Sep 26, 2017 5:18 pm
Has anyone tried this mod to the 16 relay module? The resistors are very small but do-able with a magnifying glass and a fine tip soldering iron.

Thanks.
Why go to the trouble of modifying a working relay board and risk damaging it when you can just use 2 x ULN2083A chips to act as an interface between the gpio and the relay board , it will isolated the pi from 5v that most of these boards work at and make the board operate with the correct logic.

Edit.... see here for example of how to do it. viewtopic.php?f=63&t=190608
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Automation, sensing and robotics”