8 relay module not working on Arduino Mega and Uno but on Raspberry pi works without problems :(( Any ideas what could be wrong? I tried with external power, different codes and nothing.. While on raspberry pi it works only with USB power Thanks
Perhaps if you provided some details, people might be able to help.
Hey, thanks for reply.. I have provided all info because my problem is very basic... Wired similar like image below, used this code and nothing happened... i thought it was module problem so i ask friend to try with his Raspberry and it worked.
#define RELAY1 6
#define RELAY2 7
#define RELAY3 8
#define RELAY4 9
void setup()
{
// Initialise the Arduino data pins for OUTPUT
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);
pinMode(RELAY3, OUTPUT);
pinMode(RELAY4, OUTPUT);
}
void loop()
{
digitalWrite(RELAY1,LOW);
delay(100);
digitalWrite(RELAY1,HIGH);
digitalWrite(RELAY2,LOW);
delay(100);
digitalWrite(RELAY2,HIGH);
digitalWrite(RELAY3,LOW);
delay(100);
digitalWrite(RELAY3,HIGH);
digitalWrite(RELAY4,LOW);
delay(100);
digitalWrite(RELAY4,HIGH);
}
My module have 8 relays this image is only for demonstration purposes.
SOLVED***
it needs to be plugged on 12v
...but still not clear how the hell it worked with Raspberry ONLY with USB power... perhaps some current limitations..