Quantcast
Channel: Seeedstudio Forum
Viewing all articles
Browse latest Browse all 6612

relay shield only works with usb power and not 9v battery

$
0
0
I just recently purchased a relay shield version 2.1 to replace my... erm.. fried relay shield version 1.3. I was happy to find that the new shield was able to handle up to 10 amps, rather than only 3 amps, like the old shield, but I have noticed one small problem. The shield will toggle the relays just fine, as long as I have the arduino plugged into my computer via USB, but after only a few minutes of operation on the 9v battery supply, even with a fresh battery, it stops toggling. Here is my source code:

Code:int controlRelay1 = 7;
int controlRelay2 = 6;

// the setup routine runs once when you press reset:
void setup()  {
  // declare pins 7 and 6 to be outputs:
  pinMode(controlRelay1, OUTPUT);
  pinMode(controlRelay2, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop()  {
 
  digitalWrite(controlRelay1,HIGH);// NO1 and COM1 Connected;
  digitalWrite(controlRelay2,LOW);// NO2 and COM2 Disconnected;
  delay(60000);
  digitalWrite(controlRelay1,LOW);// NO1 and COM1 Disconnected;
  digitalWrite(controlRelay2,HIGH);// NO2 and COM2 Connected;
  delay(60000);
                         
}


Has anyone else encountered this problem? Any solutions?

Statistics : Posted by brandonamito • on Sun Oct 19, 2014 1:20 pm • Replies 0 • Views 14

Viewing all articles
Browse latest Browse all 6612

Trending Articles