PIC 16F72 Based Contactless Tachometer: Mudit Aggarwal
PIC 16F72 Based Contactless Tachometer: Mudit Aggarwal
MUDIT AGGARWAL
A tachometer (also called a revolution-counter, IR Transmitter
&MUDIT
Receiver AGARWAL
rev-counter, or RPM gauge) is an instrument that
measures the rotation speed of a shaft or disk, as in
a motor or other machine. The device usually Tachometer
Rota
ting S
haft
ssed
IR Pa
displays the revolutions per minute (RPM). Reflective Disk
2.2K
PIC16F72 bcf STATUS,RP0
22pf Movlw 0x01
9
movwf contor
4MHZ
28
10 call led_ini
8
22pf GND
Count
loop
19 GND
call act
11 movlw 0x74
+ +5 V DC + +5 V DC + +5 V DC call act
movlw 0x40
IR Diode
10K call act
IR LED
5 8 movlw 0xD2
+
1K 10K Lm358
7 4.7K call act
LED
10K
6
- 4 Bc547
movlw 0xD0
call act
2.2K
movlw 0xCD
call act
movlw 0xBA
call act
call pause
call set_timer
12V Transformer
movf contor, W
+5 V DC
D2 D1 7805
+ call halta
1 3
230V 1N4007
2 bcf T1CON,0
A.C. 1000uf
D3 D4
.1uf .1uf movf TMR1L,W
movwf LO_count
movf TMR1H,W
movwf HI_count
bcf blank,0
Fig.2. Circuit diagramPIC16F72 Based Contactless Tachometer movlw 0x27
movwf count3
movlw 0x10
PCB layout of PIC16F72 Based movwf count2
Contactless Tachometer is shown in figure 4. call convb
movlw 0x03
movwf count3
Software movlw 0xE8
list p=16f72 movwf count2
#include pic116f72 call convb
__CONFIG _MCLRE_OFF & _CPD_OFF &_CP_OFF & clrf count3
_PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT & movlw0x64
_BODEN_OFF movwfcount2
cblock 0x20 callconvb
count1 clrfcount3
count2 movlw0x0A
count3 movwfcount2
count4 callconvb
Transo clrfcount3
buff movlw0x01
LO_count movwfcount2
HI_count bsfblank,0
blank callconvb
contor call led_home
endc call timp
CONSTRUCTION
movfcount3,W
2.2k subwfHI_count,W
2.2k btfssSTATUS,C
2.2k gotoconv_end
Count 2.2k btfssSTATUS,Z
2.2k gotoconv_low
2.2k movfcount2,W
2.2k subwfLO_count,W
DIGIT1 DIGIT2 DIGIT3 2.2k btfssSTATUS,C
gotoconv_end
12V AC
2.2k
LED
conv_low:
+
movfcount3,W
4.7k subwfHI_count,F
PIC16f72 movfcount2,W
1000uf/25v 14n007
1 subwfLO_count,F
4mhz btfssSTATUS,C
J1 decfHI_count,F
1n4007
.1uf .1uf
14n007
14n007
incfcount1,F
+
+
J2 bsfblank,0
10k
22pf 22pf gotoconv_high
+
1 23 Ir Diode conv_end:
4.7k 7805 movlw0xB0
10k a addwfcount1,W
a btfssblank,0
Ir LED
A
+
LED1 movlw0xA0
10K movwfbuff
Bc547 Lm358 callpush_led
1k
IR LED
2.2k
return
1 led_home
call act
movlw0x74
Actual size Components layout callact
movlw0x80
callact
movlw0x02
callact
return
push_led:
movlw0x74
callact
movlw0x40callact
movfbuff,W
callact
return
set_timer:
clrfT1CON
clrfTMR1L
clrfTMR1H
clrfINTCON
bsfSTATUS,RP0
clrf PIE1
bcf STATUS,RP0
clrf PIR1
movlw 0x03
movwf T1CON
return
led_ini:
movlw0x74
callact
movlw0x00
callact
movlw0x01
callact
movlw0x21
callact
Actual size PCB layout
movlw0xA0
callact
goto loop
movlw0x07
clrfcount1
callact
CONSTRUCTION