Arduino Due relay module

Hi guys,

I am trying to move from an arduino Mega to a Due because of the lack of global memory.

I am using 3x SainSmart 16-Channel 12V Relay Module which is 48 relays and a couple of nextion touchscreens.

My code is working perfectly on the arduino Mega, the relays are on/off when commanded by the touchscreens but when I wire everyrhing on the Due as I had on the Mega, the relays are all ON and will not turn OFF.

I know each output of the Mega is 5V out and the Due is 3.3V, could this be the problem?

Any suggestions how to make this work?

Thanks.
Filipe

I know each output of the Mega is 5V out and the Due is 3.3V, could this be the problem?

The problem is that the 16-channel relay module has issues on the PCB that prevent configuring it to use opto-isolation. With opto-isolation, the opto's IRLED driver side could then be powered with 3.3V and controlled by 3.3V logic. Here's a forum thread where the PCB modifications were made.

Note that the SainSmart 8-Channel relay modules can easily be configured for opto-isolation and be used on a 3.3V Arduino board.

1 Like

Hello Dlloyd

thanks for your post. I read the thread about the mod on the 16 relay but it apparently was not working for an Arduino Mega, not a Due.

Unfortunately I cannot use 8 relay modules because the relays are already installed and we talking about 3 bords, lots of relays.

I just tried an 8 relay module as your sent on your picture and apparently it does not work either....

Could it be the arduino due is dead beucause I am also having problems with the SERIAL communications, nothing seems to work on this due and when I plug my Mega with same configurations it works pretty fine. Any thoughts?

Thanks Filipe.

A modified board as per the link should work OK with a 3.3V system such as the Due.

To see if the Due is at least operable, try the "Blink" sketch. Note that many of the I/O pins are only rated for 3mA, some can handle higher current.

EDIT: Note that on newer IDE versions, you'll need to use "Tools" then "Board Manager..." then install "Arduino SAM Boards (32-bits ARM Cortex-M3)".

EDIT: Note that the relays on both boards are"low level trigger" (LOW energizes the relay coil).

Thanks for the reply, the BLINK worked perfectly. Even on the 16 relays :slight_smile:

Now, I just opened a new topic because I noticed that my code did not work before because of this line code:

Nextion myNextion(Serial3, 9600);

Maybe you have some ideas why it is not working?

If I uncomment this line and the ones referring to the touch display the relays blink, if I uncomment nothing works on the due and when switching to the Mega it works perfectly.

here is the new thread i opened:

http://forum.arduino.cc/index.php?topic=425947.0

On that really bored, the opto couplings are set up for 12V, when they are pulled low. which means that the current is limited for 12V, not 3.3V. The current going through the opto couplers is approximately 27% what it should be. If you apply 12 V to the opto coupler the clamping diodes may keep the relays from turning off. Note: 12V may damage your Due board. You may need to use a transistor, or Darlington driver chip to correct the problem. Another solution is to Re-bias each of the Opto couplers so that it can be used with 3.3V. Not the best solution. You probably would not of had a problem if the relay board was set up for 5V relays.

Joe.

On that really bored, the opto couplings are set up for 12V, when they are pulled low. which means that the current is limited for 12V, not 3.3V.

The 16 channel board has the same limiting resistors for the 12V and 5V relay versions. The resistors are connected to the on-board 5V regulator. I have not seen any reports of the 16, 8 or 4 channel relay boards not working when the opto is controlled with 3.3V source voltage. The opto current at 3.3V would be about 55% of what it is at 5V (allowing for the 1.2V IRLED drop).

if that is the case, Placing a jumper between VCC and JD VCC, might damage the Opto couplers. The manufacturer should not only remove this jumper, but they should have removed the pin as well. the relay board I have will work with 5V, it will not work with 3.3 V. and as I said, if the relay board was set up for 5V, it should work fine with 3.3 V.

in any case, if the board has to be powered with anything but 3.3 V, you should use something to buffer the input/output pins. A transistor or Darlington driver chip is recommended.

Joe.