Problem in interfacing relay board with arduino

Hello friends, I am using a 8-relay board to control certain electrical gadgets.And I am controlling it with a custom made arduino compatible board. Once I get an input in pin 12, it will turn on all the relays connected right from pin 2 to 10.

A strange problem which i am facing is that, when ever I connect a relay through the ULN2803 ic, the relay is continuously turning on and turning off. But when I touch the usbport on the arduino board or connect the ground pin to earth, there is no such problem. More over when I connected a LED between the respective output pin and ground, I was able to see the LED glow with mild flickering.

Am I having any unnecessary noise in my circuit, if so please can any one explain me what is happening and what should I do to fix this problem.

When using the ULN 2803, do you have the input tied to 5v with a 10k resistor or using the internal pull up?

Weekend

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Can you please post a copy of your sketch, using code tags? Please use code tags.. See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Also a picture of your project please.

Tom...... :)

No I have not tied the inputs to 5V. I rather used a set of pull down resistors on the input pins of ULN2803, which I dont think are making any impact.

This is the schematic

This is my code

int r1 = 2; int r2 = 3; int r3 = 4; int r4 = 5; 
int r5 = 6; int r6 = 7; int r7 = 8; int r8 = 9;
int p1 = 11; int p2 = 12; int p5 = 13;

void setup()
{
  pinMode(r1, OUTPUT); pinMode(r2, OUTPUT); pinMode(r3, OUTPUT); pinMode(r4, OUTPUT);
  pinMode(r5, OUTPUT); pinMode(r6, OUTPUT); pinMode(r7, OUTPUT); pinMode(r8, OUTPUT);
  pinMode(p1, INPUT); pinMode(p2, INPUT); pinMode(p5, INPUT);
  digitalWrite(r1, LOW); digitalWrite(r2, LOW); digitalWrite(r3, LOW); digitalWrite(r4, LOW);
  digitalWrite(r5, LOW); digitalWrite(r6, LOW); digitalWrite(r7, LOW); digitalWrite(r8, LOW);
}

void loop()
{
  if ((digitalRead(p1)) == HIGH)
  {
    digitalWrite(r1, HIGH); digitalWrite(r2, HIGH);
  }

  else if ((digitalRead(p2)) == HIGH)
  {
    digitalWrite(r3, HIGH); digitalWrite(r4, HIGH);
  }

  else if ((digitalRead(p5)) == HIGH)
  {
    digitalWrite(r1, HIGH); digitalWrite(r2, HIGH); digitalWrite(r3, HIGH); digitalWrite(r4, HIGH);
    digitalWrite(r5, HIGH); digitalWrite(r6, HIGH); digitalWrite(r7, HIGH); digitalWrite(r8, HIGH);
  }

  else
  {
    digitalWrite(r1, LOW); digitalWrite(r2, LOW); digitalWrite(r3, LOW); digitalWrite(r4, LOW);
    digitalWrite(r5, LOW); digitalWrite(r6, LOW); digitalWrite(r7, LOW); digitalWrite(r8, LOW);
  }

}

Hi, Sorry schematic did not take, attach it..

Tom..... :)