0-9999 seconds count down timer using PIC12F683 microcontroller

The goal of this project is to construct a simple 0-9999 seconds count down timer with an alarm and a display. The time is set through two tact switches and the count down seconds are displayed on a 4-digit seven segment LED display. The project uses PIC12F683 microcontroller for all I/O and timing operations and MAX7219 IC for driving the seven segment LED module. The time out condition is indicated by an audible alarm from a buzzer.
0-9999 seconds count down timer using PIC12F683 microcontrollerCircuit diagram

The complete circuit diagram of this project is shown below. Two tact switches (named INC and TSET) are used for setting time and turning the timer on. These switches are connected in parallel and their inputs are read through the AN3 ADC channel of PIC12F683 microcontroller. You can see from the circuit diagram how these two tact switches give rise to different analog voltages when pressed. When INC is pressed, the input voltage to AN3 pin is 0. But if TSET is pressed, the input to AN3 ADC channel would be around 2.5V (two 4.7K resistors make a voltage divider network). And if none of them are pressed the ADC input is pulled up close to 5V. Therefore, based on the value of 10-bit ADC count, it is possible to detect and identify if any of the two switches is pressed. The buzzer is driven by a PWM signal generated at the GP2 output pin of PIC12F683. The display part uses a 4-digit seven segment (common cathode type) LED module which is driven by the MAX7219 IC. If you are not familiar with MAX7219 device, please read my earlier project Serial four digit 7-segment LED display module for further detail on that.

0-9999 seconds count down timer using PIC12F683 microcontroller

Software

The firmware is developed in C and compiled with mikroC Pro for PIC compiler. The driver routine for MAX7219 is taken from my previous project Serial four digit 7-segment LED display module. A 5KHz PWM signal is generated at the CCP1 output pin for the audible alarm when the timer is out. The overall operation of this timer project is described in the next section. That will help you to understand how the firmware for this project works. Here’s the complete source code for this project.

 

For more detail: 0-9999 seconds count down timer using PIC12F683 microcontroller

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation and engineering. My writing style is clear and simple, and I am skilled in using infographics and diagrams. I am a great researcher and am able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter