RC time delay Circuit

Hi All,

I am trying to make a ~1 second delay using RC Circuit to delay power delivering to a strip of LEDs (12v), when testing the RC Circuit without load it works fine but when i attach the load the voltage drops significantly from 12v to 4.5v.

I think that the LED strip is discharging the capacitor in a very fast manner, So how can i fix this?

I am connecting a resistor and a cap in series with the voltage supply and the load is parallel with the cap.

Regards,

Schematic that is readable please

That also puts the resistor in series with the leds, and as always, ohm's law is strictly enforced. What is the value of the resistor? how many leds?

This is an XY problem and RC circuit is unable to solve it. Describe what you need a we may help you to find a solution. But we need to know why you need the delay.

I think you will find a 1 second delay using just R & C is not practical. The capacitor you would need is the size of a 1 Liter soda bottle and would for a short time draw over 10x the LED current from you supply.

Basically you are asking the capacitor to almost short out the input supply to ground (through the series resistor) for nearly a second.

I'm afraid you will need some active components (mosfet) to get your delay.

Thanks ALL,

The problem is little weird…but after some tests I got the cause of it,however didnt figure out a solution for it.

In my Hydroponic system I’m using arduino MEGA with a big AC pump,three small DC pumps and the Light System.
I am implementing two external interrupts (two buttons) in my code that stops the operation and return back to Menu when they get pressed.

In those two ISRs, I’m just setting a global flag(no other way to set the flag except through the ISRs).

Now the problem is (may be one of the problems) when the AC Pump is switched from ON to OFF position while the Light System is ON, the whole System stops (giving me a Stop Screen) it’s neither hanging nor restarting.

This scenario cannot be happened unless the global flags are set (Stop_Flag=1) and the global flags are set only in the two ISRs (external buttons).

In a nutshell, the cause of the problem is due to some sort of electrical noise that makes the arduino execute the two ISRs without pressing the buttons OR may be i miss the right implementation of the External Interrupt driver.

I’m driving both the AC Pump(220v) and the Light System(220v) using two relays controlled by arduino MEGA
and here’s the code for the external intterrupts:

Initialization:

void INT5_init(){
  DDRE &= ~(1<<5);
  EICRB |= (1<<ISC51);
  EIMSK |= (1<<INT5);
}

void INT4_init(){
  DDRE &= ~(1<<4);
  EICRB |= (1<<ISC41);
  EIMSK |= (1<<INT4);
}

ISRs:

ISR(INT5_vect){
  Menu_Flag = 1;
}

ISR(INT4_vect){
  Stop_Flag = 1;
}

Hi,

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

If you have switching noise causing noise to inputs of the Mega then you may need to lay your project out to minimize this.

Can you post some pictures of your project so we can see your component layout?

Can you post your complete code please? Using code tags.

How have you got your buttons wired?

Thanks.. Tom.. :)

Hi Tom,

my buttons are wired through a pull-down resistor.

The Complete Code is really big and consists of several files.

The electrical Connections are little close to the MEGA and its connection, and as i said the AC Pump and the Light are relay-driven.

Currently I solved the problem by editing the ISRs to be like this:

ISR(INT5_vect){
  if(PINE&(1<<5)){
    delay(30);
    if(PINE&(1<<5)){
      Menu_Flag = 1;
    }
  }
}

ISR(INT4_vect){
  if(PINE&(1<<4)){
    delay(30);
    if(PINE&(1<<4)){
     Stop_Flag = 1; 
    }
  } 
}

I did several tests and the error did not occur, but i’d prefer that i could eliminate that electrical noise specifically there’s not any physical connection between the Loads (AC Pump and Lights) and the MEGA.

False triggering of interrupts ia quite common in noise environments, I was once dealing with a similar situation where my self built smps was just way to noisy for the interrupts and would false trigger every now and then, to counter this I tried a combination of ceramic caps between my interrupts and ground and that basically did the trick for me. Secondly a schematic would be good, do you have free wheeling diodes across the relay coil?

Korawy:
Hi Tom,

my buttons are wired through a pull-down resistor.

The Complete Code is really big and consists of several files.

The electrical Connections are little close to the MEGA and its connection, and as i said the AC Pump and the Light are relay-driven.

Currently I solved the problem by editing the ISRs to be like this:

ISR(INT5_vect){

if(PINE&(1<<5)){
    delay(30);
    if(PINE&(1<<5)){
      Menu_Flag = 1;
    }
  }
}

ISR(INT4_vect){
  if(PINE&(1<<4)){
    delay(30);
    if(PINE&(1<<4)){
    Stop_Flag = 1;
    }
  }
}




I did several tests and the error did not occur, but i'd prefer that i could eliminate that electrical noise specifically there's not any physical connection between the Loads (AC Pump and Lights) and the MEGA.

I am quite sure this is not the solution. delay does not work inside an ISR. Your are only hiding another problem with your “bug fix”

waqaszahid: False triggering of interrupts ia quite common in noise environments, I was once dealing with a similar situation where my self built smps was just way to noisy for the interrupts and would false trigger every now and then, to counter this I tried a combination of ceramic caps between my interrupts and ground and that basically did the trick for me. Secondly a schematic would be good, do you have free wheeling diodes across the relay coil?

Hi,

Yes there are Fly wheel diodes across the relays, By the way i am using smps to power on my led system(220v ac to 12v dc), So here's the sequence MEGA --> Relay --> SMPS --> Led System

How was the Combination u use ?