Friday, March 29, 2024

PC Based Timer

Akshay Mathur

Timers are very useful both for industrial applications and household appliances. Here is a PC based timer that can be used for controlling the appliances for up to 18 hours. For control, the timer uses a simple program and interface circuit. It is very cost-effective and efficient for those who have a PC at workplace or home. The tolerance is ±1 second.

PC based timer circuit

PC based timer circuit
PC based timer circuit

The circuit for interfacing the PC’s parallel port with the load is very simple. It uses only one IC MCT2E, which isolates the PC and the relay driver circuits. The IC prevents the PC from any short circuit that may occur in the relay driver circuit or appliance. The glowing of LED1 indicates that the appliance is turned on. Transistor BC548 is used as the relay driver.

The program code is written in ‘C’ language and compiled using ‘Turbo C’ compiler. When the program is run, it prompts the user to input the time duration in seconds or minutes to control the appliance. After entering the required timing, press any key from the keyboard.

Suppose you input the total duration as ‘x’ minutes, of which ‘on’ and ‘off’ durations are ‘y’ and ‘z’ minutes, respectively. The program will repeat the on-off cycle for x/(y+z) number of times. After completion of the total time, to repeat the cycle, you will have to reset the time in the program to activate the circuit.

The program uses two bytes for storing integer type data. So when input is given in terms of seconds or minutes, it can hold 216–1=65,535 seconds or 18 hours at the maximum. The sleep() function in the program is used to hold the appliance in ‘on’ or ‘off’ condition for the ‘on’ and ‘off’ periods as entered by the user against prompts. The sound() function is used to give a beep during ‘on’ condition of the appliance.

- Advertisement -

Download source code: click here

86A_TIMER

 

- Advertisement -

More interesting projects available here.

1 COMMENT

SHARE YOUR THOUGHTS & COMMENTS

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators