Upload
yuliyan-topalov
View
31
Download
0
Embed Size (px)
Citation preview
Cable Tracer MT2202
1
This project used PIC24FJ64A004 and Bonus Part MCP6S26. The Cable Tracer is a device to detect underground cables. It was designed and tested on un-energized electric power cables but could be used on any underground cable. A 125 Khz signal is injected into the underground cable. A pickup coil receives a sample of this field. The strength of this field will indicate the presence and direction of the cable. The Receiver consists of a PreAmp and Detector made from an RFID Chip (MCP2030). The RSSI signal strength output is amplified by a Variable Gain Amplifier (MCP6S26). The amplified output feeds an Analog Meter to provide a visual indication of the signal strength. The meter also has a sensitivity control which allows the meter to have enough sensitivity to indicate the direction of the cable by slightly rotating the pickup coil. The RSSI signal is fed to an A/D input on the PIC24FJ64GA004. It also feeds a Comparator input. The A/D channel is used to drive an audio Variable Frequency Oscillator based on a Timer Output to provide an audio indication of the signal strength similar to a Metal Locator. The Comparator is used to indicate a course signal strength that is used in conjunction with the A/D value to determine if the VGA should change the strength of the signal. A 7 Segment LCD display is used to indicate the amplification factor of the VGA. An LCD is used to conserve battery power. The AC drive to the display is provided by an output port in conjunction with the firmware. This indication is used to determine if the signal source is at an appropriate level. With some operator practice it will also help indicate relative depth changes and/or cable breaks. There is also a Auto/Manual switch, Up, and Down buttons. In some cases Manual Operation of the amplification factor is useful. Another comparator is used to monitor Battery voltage. An LED is used to indicate a Low Battery condition. The battery is four AA batteries to provide 6 volts. The 6 volt battery supplies the power to a 3.3V Low Drop Out regulator (MCP1700). The power consumption of the Cable Tracer is low enough to not cause heating of the LDO. The 6 volt source and LDO provide a reasonable amount of operational time before the battery discharges to an unusable level. The Peripheral Pin Select was particularly useful in selecting the desired features of the microcontroller for this application.
MCP2030
RCVR VGAMCP6S26
3.3V REGMCP1700
24FJ64GA004
METER
Cable Tracer MT2202
2
Title
Size Document Number Rev
Date: Sheet of
MT2202 0
ANALOG
A
1 3Wednesday , October 10, 2007
GN
D1
CS 2
SCLK/ALERT 3
RSSI 4
LFDATA/CCLK/SDIO 6
VDD
17
VDD
28
LCZ9
LCY10
LCX11
LCCOM13
U1
MCP2030L12MHY
C562PF
C2.1UF
C1.1UF
+3.3V
R1100K
SDIRCVR
SCKRCVR
RCVRCS#
RSSI
PGACS#
PGADI
PGACLK
C4.1UF
+ C310UF
D11N4001
D21N4001
C13.1UF
I
M1
500 uA
R3 150
OUT 1CH02
Vref 8
GN
D9
CS10SI11SCK13
VCC
14
CH13
CH24
CH35
CH46
CH57
SO 12
U2
MCP6S26
R210K
Cable Tracer MT2202
3
Title
Size Document Number Rev
Date: Sheet of
MT2202 0
PROCESSOR
A
2 3Thursday , October 04, 2007
C810UF
SEGB
C7.1UF
C6.1UF
123456
J1
CON6
+3.3V
SEGC
R4
47K
SDIRCVR
CSRCVR#
SCKRCVR
SEGDRSSI
PGADI
PGACS#
PGACLK
VBAT
AOUT
R7 27K
R5330
D3LED
SEGE
R610K
R910K
SEGFSEGG
UPAUTO/MAN
R815K
AUTO/MANLED
RP9/SDA1/CN21/PMD3/RB9 1
RP22/CN18/PMA1/RC6 2RP23/CN17/PMA0/RC7 3RP24/CN20/PMA5/RC8 4RP25/CN19/PMA6/RC9 5
DISVREG6
Vcap/Vddcore 7
PGD2/EMUD2/RP10/CN16/PMD2/RB10 8PGC2/EMUC2/RP11/CN15/PMD1/RB11 9AN11/RP13/CN13/PMRD/RB13 11
AN12/RP12/CN14/PMD0/RB12 10
RA10/PMA10/TMS12
RA7/PMA7/TCK13
AN10/CVref /RTCC/RP14/CN12/PMWR/RB14 14AN9/RP15/CN11/PMCS1/RB15 15
AGN
D16
AVD
D17
MCLR18
RA0/CN2/Vref +/AN019 RA1/CN3/Vref -/AN120
PGD1/EMUD1/AN2/C2IN-/RP0/CN4/RB0 21PGC1/EMUC1/AN3/C2IN+/RP1/CN5/RB1 22AN4/C1IN-/RP2/SDA2/CN6/RB2 23AN5/C1IN+/RP3/SCL2/CN7/RB3 24
AN6/RP16/CN8/RC0 25AN7/RP17/CN9/RC1 26AN8/RP18/CN10/PMA2/RC2 27
VDD
128
GN
D1
29
RA2/CN30/CLKI/OSCI30
RA3/CN29/CLKO/OSCO31
RA8/PMA8/TDO32
SOSCI/RP4/CN1/RB4 33
RA4/CN0/T1CK/SOSCO34
RA9/PMA9/TDI35
RP19/CN28/PMBE/RC3 36RP20/CN25/PMA4/RC4 37RP21/CN26/PMA3/RC5 38
GN
D2
39VD
D2
40
PGD3/EMUD3/RP5/SDA1/CN27/PMD7/RB5 41PGC3/EMUC3/RP6/SCL1/CN24/PMD6/RB6 42RP7/INT0/CN23/PMD5/RB7 43RP8/SCL1/CN22/PMD4/RB8 44
U3
PIC24FJXXGA004
SEGDPSEGCOM
DWN
LOW BAT
SEGA
Title
Size Document Number Rev
Date: Sheet of
MT2202 0
MISC
A
3 3Thursday , October 04, 2007
SW2
SW3
SW4
R12100
D4LED
Q12N3904
Q22N3906
R10100
+ C9100UF
+
C10
100UF LS1
SPEAKER
AOUT
+3.3V
AUTO/MANLED
+3.3V
BT16V
CO
M1
A115
B114
C1
5
D1
4
E13
F116
DP2
6
A211
B210
C2
9
D2
8
E27
F212
G2
13
G1
17
DP1
2
A A
B B
C C
D D
E E
F F
G G
. .DP1 DP2
U4
2DIGITLCD
SEGA
SEGC
SEGGSEGFSEGESEGD
SEGB
GN
D1
OUT 2IN3U5
MCP1700C111UF
C121UF
R134.7K
R144.7K
R154.7K
SW1POWER
SEGCOM
SEGDP
+3.3V
VBAT
UP
DWN
AUTO/MAN
R11100
Cable Tracer MT2202
4
while(1) { ADConvert(); //Get RSSI Value loopct++; for (x=0; x < 0x7FFF;x++); //Delay if(AUTOMANSW == 0) //Push Button Pressed { while(AUTOMANSW == 0); //wait for release AUTOLED = ~AUTOLED; //Toggle Mode } if(AUTOLED == 1) //If MANUAL Mode { if(UPSW == 0) { while(UPSW == 0); if(gain < 0x4007) { gain++; //Boost Gain PGACS = 0; //Select PGA SPI1BUF = gain; while(SPITBF == 1); //Wait for empty for (x=0; x<= 10;x++); //Delay PGACS = 1; LCDout(gain & 0x0007); //Out gain setting }//end gain < 4007 }//end UPSW if(DWNSW == 0) { while (DWNSW == 0); if(gain > 0x4000) { gain--; //Drop Gain PGACS = 0; //Select PGA SPI1BUF = gain; while(SPITBF == 1); //Wait for empty for (x=0; x<= 10;x++); //Delay PGACS = 1; c2flag = 0; LCDout(gain & 0x0007); }//end gain > 4000 }//end DWNSW }//end AUTOLED == 1 else _C2EN = 1; //Enable for AUTO Mode if(loopct >= LOOP) { if((c2flag == 1)&(AUTOLED == 0)) //Gain too high { if(gain > 0x4000) { gain--; //Drop Gain
Cable Tracer MT2202
5
PGACS = 0; //Select PGA SPI1BUF = gain; while(SPITBF == 1); //Wait for empty for (x=0; x<= 10;x++); //Delay PGACS = 1; c2flag = 0; LCDout(gain & 0x0007); _C2EN = 1; //Re Enable after GAIN drop }//end gain>0x4000 }//end c2flag == 1 if((ADValue < GAIN_TRIP)&(AUTOLED == 0)) //Gain too low { if(gain < 0x4007) { gain++; //Boost Gain PGACS = 0; //Select PGA SPI1BUF = gain; while(SPITBF == 1); //Wait for empty for (x=0; x<= 10;x++); //Delay PGACS = 1; LCDout(gain & 0x0007); //Out gain setting }//end gain < 4007 }//end ADValue < GAIN_TRIP loopct = 0; }//end loopct >= LOOP ADValue = ADValue & 0x03FF; //10 bits //Oscillator PR4 = 1 = 32Khz
// PR4 = 03FF = 60 Hz //Divide value by 2 for 120 to 15Khz ADValue = 0x03FF - ADValue; //Get as low to high on pitch if(ADValue > 2) ADValue = ADValue / 2; else ADValue = 1; TMR4 = 0x0000; //Clear Reg, Otherwise might miss compare PR4 = ADValue; //Load Oscillator //0x3FF 16 mS 60Hz //0x001 31.2Khz 32 uS
Cable Tracer MT2202
6