Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

on & off dellay timer 1to300 sec

Status
Not open for further replies.

eng-bm

New Member
hi every one
am looking for the simplest way to make tow type of timers (on dellay and off dellay) using pic
can any one help me
thank you
 
eng-bm said:
hi every one
am looking for the simplest way to make tow type of timers (on dellay and off dellay) using pic
can any one help me
thank you

It's very easy really, the simplest way is probably just software loops. If you check my tutorials you will see that many of them use delay routines, based on a 1mS delay - then called by a loop to give up to 255mS. If you set that loop at 250mS, and call it 4 times, that gives you a 1 second delay. Or you could use the delay generator on the PICList to generate code for a one second delay.

Then simply call the one second delay as many times as you need to give your required delay, using a single loop counter will give you a maximum of 255 seconds, by using two loop counters this increases to 65,535 seconds.
 
eng-bm said:
i want to control the time by a linear variable resistor

Easy! - simply read the pot and adjust the time delay accordingly, you can either read the pot with an A2D or capacitor charging method. Both are covered in my tutorials!.
 
thank u mr.nigel, but could u make me a favore and send me a practical circut with a working program for it
 
eng-bm said:
thank u mr.nigel, but could u make me a favore and send me a practical circut with a working program for it

Sorry, I don't have much time available for designing circuits and writing software for people, if I manage to find time I'll do it for you.

But everything you need is in the tutorials, I would suggest you get a PIC and have a play.

For a nice simple timer, here's a (very) simple way to write the program:

1: Read A2D to get pot position.
2: Display pot value (optional).
3: Check if start button pressed.
4: Button not pressed, goto 1:
5: Delay 'pot value' number of seconds.
6: Do what ever you need to at the end of the timed period, turn an LED on, switch a relay - anything you want.
7: Goto back to 1:

Hardware wise I would suggest something like a 16F818/9 or 16F876, an LCD display (to show what the time is set to, and you could make the display count down as well), a Start button, probably a Stop button, and some output device - an LED would do for testing.
 
Status
Not open for further replies.

Latest threads

Back
Top