Combining Ethernet and Relay shields

I am working on a project where I need an ethernet connection and some relays.

I currently have the following hardware:

  • Arduino R3
  • Arduino 4 Relays Shield
  • Arduino Ethernet 2 Shield

Now I saw (too late) in the docs for the ethernet shield that it uses pin 4 for the SD connection. This clashes with the pins used for one of the four relays on the other shield.

So I am wondering if there are some ways around this? I don't need the SD functionality, but it doesn't seem like there is a straightforward way to accomplish that. My other idea was to mutilate the relay pins in such a way to connect the 4 pin from the relay shield to another free pin.

Another alternative would be to get additional relays to use separately, but I only need the four :confused:

Does anyone have any tips?

Look at the schematic. Does pin 4 connect to anything on the Ethernet board when there is no card inserted? I see it go to pin 2 of IC3, it's always an input so I don't think it would interfere with a relay output.

The signal is called D4/SD_CS.

I initially tested it as follows:

  pinMode(PIN_RELAY_1, OUTPUT); // PIN_RELAY_1 = 4

  // Setup Ethernet connection

which failed with the following:

Ethernet.hardwareStatus() == EthernetNoHardware

If I reverse the operations, so first initialize the Ethernet connection, then setup the pinMode, it does seem to work, but requests made have no contents and receiving doesn't seem to work either. So I assume there is some dependency also for the Ethernet functionality somewhere on pin 4.

I just now realised there is also a clash on pin 12 :confused:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.