About PIC

Thread Starter

Lanz

Joined Oct 30, 2008
153
I want to built a timer circuit using PIC.
The timer functions like egg timer(countdown).
It will countdown till zero and will denergize a relay.
What i want is...so that the timer to be OFF after 10 sec of the countdown finish and to be ON once triggered by a sensor or switch.
I dont know what is the term called for this kind of features.
I want to know abt this features and how it works in PIC.
 

Thread Starter

Lanz

Joined Oct 30, 2008
153
Thanks for the info Markd77.
But i think maybe i didnt describe well abt the situation.
Let me clear it.
The timer has 7 segment display to show the countdown and to set the time.
Let say..a switch trigger the timer.The timer will energize the relay.When zero...the timer will denergize the relay.But the 7 segment will dislay zero till its triggered again(It will always ON).So..i dont want the display to be always ON.I want the display to OFF after a few seconds the task finish(countdown) and to be ON when triggered.It can save the power used and the lifetime of the display.
 

retched

Joined Dec 5, 2009
5,208
Oh. You will want to save battery life by shutting the 7seg off a few seconds after the 0 mark is reached and the relay is de-energized.

In your code, set a 3 second timer to start when the countdown reaches 0.
After the 3 seconds pass, logical low to the 7seg anode

If the 7seg is common anode,logical 0 will cut power to it
If its common cathode, logical 1 will cut power.
 

Thread Starter

Lanz

Joined Oct 30, 2008
153
Oh. You will want to save battery life by shutting the 7seg off a few seconds after the 0 mark is reached and the relay is de-energized.
Yup.I got saw this in some devices also.If im not wrong...i think its called as "sleep".
 

Thread Starter

Lanz

Joined Oct 30, 2008
153
What are you using for the 7seg driver? Are you just using the PIC? or are you using a 7seg display IC?
I havent think abt that.I dont have any idea.I think i should do some survey n research b4 i move on to the circuit.Thats y asking some ideas n opinions here
.
 

retched

Joined Dec 5, 2009
5,208
Ok. good to do.

If you use a common anode 7seg, you can switch it on and off using the PIC. The anode pin will allow the segments to light when the segment cathodes get a logical low(0).

So in your code, you can have a function to power on or power off the 7seg by changing the state of the pin. easy.

In the timing part of your code, after 'zero' is reached, go to a few second delay that will cut power to the 7seg. When ever your countdown is reset, change the pin back to high(1) and it will work again.
 

BMorse

Joined Sep 26, 2009
2,675
here is a very simple pic based Timer/Counter Circuit..... to save on battery power, this circuit multiplexes the display to make it seem as if all digits are all on at the same time, but in reality they are switched on 1 at a time....

4 digit counter_timer.png

B. Morse
 
Top