8 relay module seems dead

Hi I am new to this and trying to build a pedal switcher for my guitar pedals. I have followed the instructables guidance which was very good, but the relay I received does not seem to be switching on or off.

I have tried powering the relay from a power adaptor (5v 2A) without any luck.

I just watched a youtube video where someone was testing his relay module. The lights work on his one, but when I copy the exact same code he used, my relay does not show any lights at all. Does that mean it is dead?

Regards

kaborex

(deleted)

I would presume you have given the relays thier very own power as it is highly doubtful the Arduino can supply the amount of current required for 8 relays.

And if you did supply them with thier own power I would assume you also included a common ground back to the Arduino.

This is the relay board I purchased

and this is the mega I also purchased

https://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=eloogoo+mega

I have also sent a ground back to the mega controller and still nothing. During testing just now with a multi meter, i accidentally shorted the ground on the relay board to IN1 and the rtelay came on on that IN1 Channel.

I tried shorting other channels ie IN2, IN£ etc .. and they all came on.

However, running this short code nothing happens. You can see the mega controller load up but nothing happens:

int relayPin1 = 40

void setup() {
pinMode(relayPin, OUTPUT);

}
void loop() {
digitalWrite(relayPin, LOW);

delay(500);

}

Help please. I am now not sure if the relay board is faulty or not? It clearly works when ground is shorted to any of the channels. I also tested with a multimeter and the mega is indeed sending 5v to the relay board.

Hi just an update.

When I run the code on the software installed directly to my PC version 1.8.5 everything works. So the relay board is fine and everything works.

However, can anyone explain as to why when I run the same code, same setup and same wiring on the online version of the software (web editor), nothing works?

Regards

Kaborex

Because the code you posted is wrong and probably NOT the same as you used in the desktop IDE ?
You didn’t define the pin correctly.

A quick read of this page may help you

You might also want to read this page too as it explains how to post code.

I have used this code and it only works on Arduino 1.8.5!!

int relayPin1 = 33;
int relayPin2 = 34;
int relayPin3 = 35;
int relayPin4 = 36;
int relayPin5 = 37;
int relayPin6 = 38;
int relayPin7 = 39;
int relayPin8 = 40;

void setup() {
  pinMode(relayPin1, OUTPUT);
  pinMode(relayPin2, OUTPUT);
  pinMode(relayPin3, OUTPUT);
  pinMode(relayPin4, OUTPUT);
  pinMode(relayPin5, OUTPUT);
  pinMode(relayPin6, OUTPUT);
  pinMode(relayPin7, OUTPUT);
  pinMode(relayPin8, OUTPUT);
  
}
void loop() {
  digitalWrite(relayPin1, LOW);
  
  delay(500);
  digitalWrite(relayPin1, HIGH);
  
  delay(500);
  
  digitalWrite(relayPin2, LOW);
  
  delay(500);
  digitalWrite(relayPin2, HIGH);
  
  delay(500);
  
  digitalWrite(relayPin3, LOW);
  
  delay(500);
  digitalWrite(relayPin3, HIGH);
  
  delay(500);
  
  digitalWrite(relayPin4, LOW);
  
  delay(500);
  digitalWrite(relayPin4, HIGH);
  
  delay(500);
  
  digitalWrite(relayPin5, LOW);
  
  delay(500);
  digitalWrite(relayPin5, HIGH);
  
  delay(500);
  
  digitalWrite(relayPin6, LOW);
  
  delay(500);
  digitalWrite(relayPin6, HIGH);
  
  delay(500);
  
  digitalWrite(relayPin7, LOW);
  
  delay(500);
  digitalWrite(relayPin7, HIGH);
  
  delay(500);
  
  digitalWrite(relayPin8, LOW);
  
  delay(500);
  digitalWrite(relayPin8, HIGH);
  
  delay(500);
  
  
}

Something is going wrong here but I have no clue as I am new to all this coding business.

That code verifies and uploads just fine on the web editor.

From that I can only presume it is something local to your computer.
As it works fine on the regular desktop IDE it might be better to have this moved to the WED EDITOR section.
There is more specific advice in there as to some of the minor issues people face that might be worth your reading up on.

I am using a Microsoft surface pro. Maybe it is the computer not sure. Surface pro 3

OK thats not a real computer per-se...

Which browser did you install CREATE for.
EDGE works but I found it to be a little slow.
Chrome or Firefox work much better with Chrome being my preferred option.

Also do not forget to say YES to any of the CREATE boxes that will pop up as without them the CREATE AGENT just becomes a pretty Arduino icon doing nothing.

Hi I used Chrome. Not sure why you say it is not a real computer.

It has an i5 processor, 64bit and running windows 10 Professional and also has 4gb Ram.

It may have what you say but in real terms its not a full blown laptop or computer.

It is more within the "tablet" realms.
I was not disparaging the surface but it does have limits and drawbacks.

Ok. I understand. I will have to try on a full blown laptop and see. I like the web version better.
Truth be told it can only be the laptop.

Thanks for your help. No doubt I will have further queries with the coding side as I have no experience and the project is a bit on the advanced side.