Relay Channel..

Im using arduino NANO, it connected to a 4 push button ,1 pir sensor,1 led matrix max 7219, and 2 relay channel

My problem is that the relay channel won't work if i connect all the components. I tried connecting it to a power source and usb. Still wont work.

Any suggestions, so the relay channel will work? What can i do?

Do the relays work if you disconnect the other components and just write a simple sketch for them? Does anything else work?

Please post the code you have to drive all these components and say exactly what it does and what you want it to do that it doesn't do.

Steve

i upload the code where all the components are being driven.

This is the simple sketch for the 2 channel relay.
it uses Transistor to transistor Logic.

i tried this code upload to the arduino with all of the components connected but still the relay wont work.

void setup () {
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  Serial.begin(9600);
  digitalWrite(8,LOW);
  digitalWrite(9,LOW);
  delay(2000);
  
  digitalWrite(8,HIGH);
  digitalWrite(9,HIGH);
}
void loop () {
  if (Serial.available () > 0) {
    char a = Serial.read ();
    Serial.println(a);
    if (a == '1') {
      digitalWrite(8, LOW);
    } if (a == '2') {
      digitalWrite(8, HIGH);
    } if (a == '3') {
      digitalWrite(9, LOW);
    } if (a == '4') {
      digitalWrite(9, HIGH);
    }
  }
}

Main.zip (2.44 KB)

Hi,
Please do not attach zip files.
Please attach the files you have in them.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Showing how you power the components and pin and component labels.

Please NO fritzy pictures of component layout.

Thanks.. Tom.. :slight_smile: