SlideShare a Scribd company logo
1 of 1
Download to read offline
CIRCUIT IDEAS




COMPUTERISED UNIVERSAL TIMER                                                                                       S.C.
                                                                                                                        DWI
                                                                                                                           VED
                                                                                                                              I



D.K. KAUSHIK




T
       his simple and flexible timer is more
       accurate than the real-time clock of
       the computer used for the purpose.
It can be used in laboratories, dark rooms,
kitchens, and for competitions in educa-
tional institutes. The program written in
Q-Basic is self-explanatory.
     Generally, a universal timer provides
the facility for switching on an electrical/
electronic device after elapse of a certain
time period, say, 5 minutes. The software
does the same job here.
     When the program is executed, it dis-
plays 0:0:0 on the monitor, indicating 0 hour,    speak is filled the way it is discussed above.   countdown of the time in the display box
0 minute, and 0 second. The display time          The program may be changed as indicated          starts. The device will remain on until the
0:0:0 is increased by 10 seconds each time        by REM statements and the single quote (‘)       display box shows 0:0:0 and then it will
function key F1 of the computer keyboard is       in the beginning of a program line may be        get switched off. The figure shows the re-
depressed. So by depressing function key          accordingly removed in the program.              lay interface circuit connected between D0
F1 the required time is set for which the             Now, after setting the time in the man-      line (pin 2) and ground line (pin 25) of
electrical or electronic device is to be          ner as discussed above, function key F2 of       378H output port of LPT1 printer port of
switched on. However, in debate competi-          the computer keyboard is depressed to            the computer.
tions the time allowed for a candidate to         switch on any device. Simultaneously, the            This circuit costs around Rs 85.

                                                 COMPUTER PROGRAM IN Q-BASIC
CLS : SCREEN 1: COLOR 3, 10                                                START1:
N1 = 0: N2 = 0: N3 = 0                                                     Z2 = VAL(RIGHT$(TIME$, 2))
LOCATE 4, 10: PRINT “ PROGRAM DEVELOPED BY DR.D.K.KAUSHIK”                 IF Z2 = Z1 THEN GOTO START1 ELSE GOTO START2
LINE (90, 60)-(200, 60), 2: LINE -(200, 75), 2                             START2:
LINE -(90, 75), 2: LINE -(90, 60), 2                                       IF N1 = 0 AND N2 = 0 AND N3 = 0 THEN LOCATE 9, 14
LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1                                   PRINT N3; “:”; N2; “:”; N1: GOTO LAST
LOCATE 13, 9: PRINT “PRESS F1 KEY FOR TIME ADJUSTMENT”                     N1 = N1 - 1
LOCATE 15, 9: PRINT “PRESS F2 KEY FOR START”                               IF N1 < 0 THEN N1 = 59: N2 = N2 - 1
LOCATE 17, 9: PRINT “PRESS F3 KEY TO STOP”                                 IF N2 < 0 THEN N2 = 59: N3 = N3 - 1
KEY(2) ON: ON KEY(2) GOSUB START                                           IF N3 < 0 THEN N3 = 0
KEY(3) ON: ON KEY(3) GOSUB LAST1                                           LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1
PORT% = &H378                                                              Z1 = Z1 + 1
DELAY:                                                                     IF Z1 = 60 THEN Z1 = 0
KEY(1) ON: ON KEY(1) GOSUB SET                                             IF N1 = 0 AND N2 = 0 AND N3 = 0 THEN GOTO LAST ELSE GOTO START1
GOTO DELAY                                                                 LAST:
SET:                                                                       OUT PORT%, 0
SOUND 650, 3                                                               REM FOR DEBATE COMPETITION OUT%,0 SHOULE BE REPLACED
N1 = N1 + 10                                                               BY OUT PORT%,1
IF N1 < 60 THEN LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1: RETURN           FOR T = 1 TO 3
N1 = 0                                                                     SOUND 550, 17
N2 = N2 + 1                                                                NEXT T
IF N2 < 60 THEN LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1: RETURN           ‘ FOR J=1 TO 10
N2 = 0: N3 = N3 + 1                                                        ‘FOR J=1 TO 50000 : NEXT J : NEXT I
LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1                                   ‘OUT PORT%,0
RETURN                                                                     END
START:                                                                     LAST1:
KEY(1) OFF: KEY(2) OFF                                                     OUT PORT%, 0
Z1 = VAL(RIGHT$(TIME$, 2))                                                 END
OUT PORT%, 1
REM FOR DEBATE COMPETITION OUT PORT%,1 SHOULD BE REPLACED                  The author is Head of Electronic Science Department, Dayanand
REM BY OUT PORT%,0                                                                                                  College, Hisar, Haryana

                                                                                                         JANUARY 2003   ELECTRONICS FOR YOU

More Related Content

More from viv3ksharma

Friendly charger for mobile phones
Friendly charger for mobile phonesFriendly charger for mobile phones
Friendly charger for mobile phonesviv3ksharma
 
Flashing cum running light
Flashing cum running lightFlashing cum running light
Flashing cum running lightviv3ksharma
 
Fire alarm using thermistor
Fire alarm using thermistorFire alarm using thermistor
Fire alarm using thermistorviv3ksharma
 
Electronic watchdog
Electronic watchdogElectronic watchdog
Electronic watchdogviv3ksharma
 
Electronic security system
Electronic security systemElectronic security system
Electronic security systemviv3ksharma
 
Electronic bicycle lock
Electronic bicycle lockElectronic bicycle lock
Electronic bicycle lockviv3ksharma
 
Dtmf reciever ic mt 8870 tester
Dtmf reciever ic mt 8870 testerDtmf reciever ic mt 8870 tester
Dtmf reciever ic mt 8870 testerviv3ksharma
 
Electric window fence charger
Electric window fence chargerElectric window fence charger
Electric window fence chargerviv3ksharma
 
Drinking water alarm
Drinking water alarmDrinking water alarm
Drinking water alarmviv3ksharma
 
Digital stop watch
Digital stop watchDigital stop watch
Digital stop watchviv3ksharma
 
Dice with 7 segment display
Dice with 7 segment displayDice with 7 segment display
Dice with 7 segment displayviv3ksharma
 
Desktop power supply
Desktop power supplyDesktop power supply
Desktop power supplyviv3ksharma
 
College quiz buzzer
College quiz buzzerCollege quiz buzzer
College quiz buzzerviv3ksharma
 

More from viv3ksharma (20)

Friendly charger for mobile phones
Friendly charger for mobile phonesFriendly charger for mobile phones
Friendly charger for mobile phones
 
Flying saucer
Flying saucerFlying saucer
Flying saucer
 
Flashing cum running light
Flashing cum running lightFlashing cum running light
Flashing cum running light
 
Flashing beacon
Flashing beaconFlashing beacon
Flashing beacon
 
Fire alarm using thermistor
Fire alarm using thermistorFire alarm using thermistor
Fire alarm using thermistor
 
Electronic watchdog
Electronic watchdogElectronic watchdog
Electronic watchdog
 
Electronic security system
Electronic security systemElectronic security system
Electronic security system
 
Electronic horn
Electronic hornElectronic horn
Electronic horn
 
Electronic bicycle lock
Electronic bicycle lockElectronic bicycle lock
Electronic bicycle lock
 
Dtmf reciever ic mt 8870 tester
Dtmf reciever ic mt 8870 testerDtmf reciever ic mt 8870 tester
Dtmf reciever ic mt 8870 tester
 
Electric window fence charger
Electric window fence chargerElectric window fence charger
Electric window fence charger
 
Drinking water alarm
Drinking water alarmDrinking water alarm
Drinking water alarm
 
Digital stop watch
Digital stop watchDigital stop watch
Digital stop watch
 
Digital dice
Digital diceDigital dice
Digital dice
 
Dice with 7 segment display
Dice with 7 segment displayDice with 7 segment display
Dice with 7 segment display
 
Desktop power supply
Desktop power supplyDesktop power supply
Desktop power supply
 
Current sensor
Current sensorCurrent sensor
Current sensor
 
College quiz buzzer
College quiz buzzerCollege quiz buzzer
College quiz buzzer
 
Clock timer
Clock timerClock timer
Clock timer
 
Clap switch
Clap switchClap switch
Clap switch
 

Computerised universal timer

  • 1. CIRCUIT IDEAS COMPUTERISED UNIVERSAL TIMER S.C. DWI VED I D.K. KAUSHIK T his simple and flexible timer is more accurate than the real-time clock of the computer used for the purpose. It can be used in laboratories, dark rooms, kitchens, and for competitions in educa- tional institutes. The program written in Q-Basic is self-explanatory. Generally, a universal timer provides the facility for switching on an electrical/ electronic device after elapse of a certain time period, say, 5 minutes. The software does the same job here. When the program is executed, it dis- plays 0:0:0 on the monitor, indicating 0 hour, speak is filled the way it is discussed above. countdown of the time in the display box 0 minute, and 0 second. The display time The program may be changed as indicated starts. The device will remain on until the 0:0:0 is increased by 10 seconds each time by REM statements and the single quote (‘) display box shows 0:0:0 and then it will function key F1 of the computer keyboard is in the beginning of a program line may be get switched off. The figure shows the re- depressed. So by depressing function key accordingly removed in the program. lay interface circuit connected between D0 F1 the required time is set for which the Now, after setting the time in the man- line (pin 2) and ground line (pin 25) of electrical or electronic device is to be ner as discussed above, function key F2 of 378H output port of LPT1 printer port of switched on. However, in debate competi- the computer keyboard is depressed to the computer. tions the time allowed for a candidate to switch on any device. Simultaneously, the This circuit costs around Rs 85. COMPUTER PROGRAM IN Q-BASIC CLS : SCREEN 1: COLOR 3, 10 START1: N1 = 0: N2 = 0: N3 = 0 Z2 = VAL(RIGHT$(TIME$, 2)) LOCATE 4, 10: PRINT “ PROGRAM DEVELOPED BY DR.D.K.KAUSHIK” IF Z2 = Z1 THEN GOTO START1 ELSE GOTO START2 LINE (90, 60)-(200, 60), 2: LINE -(200, 75), 2 START2: LINE -(90, 75), 2: LINE -(90, 60), 2 IF N1 = 0 AND N2 = 0 AND N3 = 0 THEN LOCATE 9, 14 LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1 PRINT N3; “:”; N2; “:”; N1: GOTO LAST LOCATE 13, 9: PRINT “PRESS F1 KEY FOR TIME ADJUSTMENT” N1 = N1 - 1 LOCATE 15, 9: PRINT “PRESS F2 KEY FOR START” IF N1 < 0 THEN N1 = 59: N2 = N2 - 1 LOCATE 17, 9: PRINT “PRESS F3 KEY TO STOP” IF N2 < 0 THEN N2 = 59: N3 = N3 - 1 KEY(2) ON: ON KEY(2) GOSUB START IF N3 < 0 THEN N3 = 0 KEY(3) ON: ON KEY(3) GOSUB LAST1 LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1 PORT% = &H378 Z1 = Z1 + 1 DELAY: IF Z1 = 60 THEN Z1 = 0 KEY(1) ON: ON KEY(1) GOSUB SET IF N1 = 0 AND N2 = 0 AND N3 = 0 THEN GOTO LAST ELSE GOTO START1 GOTO DELAY LAST: SET: OUT PORT%, 0 SOUND 650, 3 REM FOR DEBATE COMPETITION OUT%,0 SHOULE BE REPLACED N1 = N1 + 10 BY OUT PORT%,1 IF N1 < 60 THEN LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1: RETURN FOR T = 1 TO 3 N1 = 0 SOUND 550, 17 N2 = N2 + 1 NEXT T IF N2 < 60 THEN LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1: RETURN ‘ FOR J=1 TO 10 N2 = 0: N3 = N3 + 1 ‘FOR J=1 TO 50000 : NEXT J : NEXT I LOCATE 9, 14: PRINT N3; “:”; N2; “:”; N1 ‘OUT PORT%,0 RETURN END START: LAST1: KEY(1) OFF: KEY(2) OFF OUT PORT%, 0 Z1 = VAL(RIGHT$(TIME$, 2)) END OUT PORT%, 1 REM FOR DEBATE COMPETITION OUT PORT%,1 SHOULD BE REPLACED The author is Head of Electronic Science Department, Dayanand REM BY OUT PORT%,0 College, Hisar, Haryana JANUARY 2003 ELECTRONICS FOR YOU