Pages: [1]   Go Down
Author Topic: 10 sec delay  (Read 644 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi
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
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
 
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Red Sea, Saudi Arabia
Offline Offline
God Member
*****
Karma: 12
Posts: 579
..On The Red Sea
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.... 

Logged

Regards, Terry King  ..On the Red Sea at KAUST.edu.sa
terry@yourduino.com  LEARN! DO! (Arduino Boards, Sensors, Parts @ http://yourduino.com

Pages: [1]   Go Up
Jump to: