Go Down

Topic: 10 sec delay (Read 1 time) previous topic - next topic


i have my arduino controlling a relay what i need is when i arduino turns the relay off to leave the relay on for 10 secs i was thinkof using a 555 timer or a large capactior with transistior just wondering if anyone could give me some advice on this or even a schematic


The simple ways is

digitalWrite (relayPin, LOW);  // assumes a transistor driving the relay and wired in the "normal" fashion
delay (10000);
digitalWrite (relayPin, HIGH);

and if there's nothing else for the program to do that's as good a way as any.

If you want to do other things during the 10 seconds use millis() to check the time in a loop.

Rob Gray aka the GRAYnomad www.robgray.com


If that is the ONLY function you need, a 555 is fine. Run the whole thing from 5V or 9V or 12V whatever the coil voltage of your relay is, use one resistor and transistor to drive relay.

Google "555 Relay" and you'll have an overwhelming amount of information.... 

Go Up