I am trying to control a number of relays using Uno+Ethernet shield. I have this little test sketch that runs after connection to the router is established (I removed all the Ethernet connection stuff for clarity).
int rel[]={0,1,2,3,4,5,6,7,8,9,10,11,12};
int i;
void setup() {
for (i=1;i<13;i++)
{
pinMode(rel[i], OUTPUT);
}
}
void loop() {
for (i=1;i<13;i++)
{
digitalWrite(rel[i],HIGH);
delay(1000);
digitalWrite(rel[i],LOW);
delay(1000);
}
}
However when I connect my relay board to Ethernet shield's pins 1 to 12, four LEDs of the four corresponding relays are half lit although the relays switch on and off as instructed by the code above. What I also don't like is this trebling sound during relay switching on. If I detach the shield and connect the same relay board to the corresponding Uno's pins and load my sketch onto Uno rather than Arduino Ethernet board, none of the LEDs are lit (as expected) and I can hear a very clear relay switching sound.
I thought Ethernet board's digital pins are just replicated from the Uno but it looks like this is not the case. Or am I missing something? Would be grateful for any hints.