6
8/20/2019 Metal Detector by Using Pic Microcontroller Interfacing With Pc http://slidepdf.com/reader/full/metal-detector-by-using-pic-microcontroller-interfacing-with-pc 1/6 INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 06, JUNE 2015 ISSN 2277-8616 306 IJSTR©2015 www.ijstr.org Metal Detector By Using PIC Microcontroller Interfacing With PC Yin Min Theint, Myo Maung Maung, Hla Myo Tun Abstract: This system proposes metal detector by using PIC microcontroller interfacing with PC. The system uses PIC microcontroller as the main controller whether the detected metal is ferrous metal or non-ferrous metal. Among various types of metal sensors and various types of metal detecting technologies, concentric type induction coil sensor and VLF (very low frequency) metal detecting technology are used in this system. This system consists of two configurations_ Hardware configuration and Software configuration. The hardware components include induction coil sensors which senses the frequency changes of metal, a PIC microcontroller, personal computer (PC), buzzer, light emitting diode (LED) and webcam. The software configuration includes a program controller interface. PIC MikroCprogramming language is used to implement the control system. This control system is based on the PIC 16F887 microcontroller.This system is mainly used in mining and high security places such as airport, plaza, shopping mall and governmental buildings. Keywords: Induction coil, very low frequency technology, microcontroller, personal computer (PC), LEDs, Buzzer, webcam —————————— —————————— I. INTRODUCTION Nowadays, Metal detectors have become an essential component in today's society and widely used not only for hobbyists but also for safety purpose. For Safety purpose, Metal detector that used in airport to ensure that there is no dangerous weapon such as knives, guns or any metal objects that could be used as weapons has been brought along by terrorist into the airplane. In technical area, people use metal detector to search for the underground pipe or cable before digging in walls and floors. Besides that, many people enjoy in discovering hidden treasure or valuable metal like gold and silver by using metal detector [1]. Various types of metals Sensing Circuit using induction coil Phase Detection Circuit Microcontro -ller (16F887) Display on Personal Computer (PC) Webcam  Figure1. Overall block diagram of the system In these days, most of metal detectors can only detect metal but not the types of detected metal. And they usually indicate by turning on the alarm or LEDs whenever the metal target is detected. In this system, not only the detected metal target but also the types of metal are indicated on the personal computer (PC) and image records with webcam. The types of non-ferrous metal are copper, aluminium, zinc gold, platinum, bass, bronze and etc... Ferrous metals are al metals which have iron properties. The whole system is controlled by the PIC microcontroller. Figure.1 shows the overall block diagram of the system. II. RELATED TECHNOLOGY Metal detectors’ basic operation depends on Ampere’s and Faraday’s laws. It works on the principle of transmitting a magnetic field and analyzing a return signal from the target and environment. The transmitted magnetic field varies in time. This transmitted magnetic field creates electric current to flow in metal targets. These electric currents are called eddy currents, which in turn generate a weak magnetic field, bu their generated magnetic field is different from the transmitted magnetic field in shape and strength. The regenerated magnetic field from the eddy currents causes an alternating voltage signal at the receive coil. Depending on the alternating voltage signal at the receive coil, we can decide whether the metal target is detected or not [2]. Metal detecting sensor is the most essential component in metal detectors. In this system, induction coil sensor is used. Metal detecting capabilities are vary according to coil sensor shapes, sizes and coil configurations. There are three types of coil shapes – (i) Round shaped coil (ii) Elliptical shaped coil (iii)  Open-web coil The most common types of coil configuration are- (i) Concentric coil (ii) Double-D coil (iii)  Mono loop coil There are different types of metal detecting technologies. They are- 1. Beat Frequency Oscillator (BFO) 2. Pulse Induction (PI) 3. Very Low Frequency (VLF) The Beat Frequency Oscillator (BFO) operates in the range o 100s kHz. The Pulse Induction (PI) operates in the range of 100s Hz and the very low frequency (VLF) operates in the range of 3-30 kHz. Among these technologies, VLF technology is the most popular type of metal detecting technology. In this system, the VLF technology is also used because it has the  ________________________  Yin Min Theint, Myo Maung Maung, Hla Myo Tun  Department of Electronic Engineering  Mandalay Technological University  [email protected] [email protected] 

Metal Detector by Using Pic Microcontroller Interfacing With Pc

Embed Size (px)

Citation preview

Page 1: Metal Detector by Using Pic Microcontroller Interfacing With Pc

8/20/2019 Metal Detector by Using Pic Microcontroller Interfacing With Pc

http://slidepdf.com/reader/full/metal-detector-by-using-pic-microcontroller-interfacing-with-pc 1/6

INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 06, JUNE 2015 ISSN 2277-8616

306IJSTR©2015www.ijstr.org

Metal Detector By Using PIC MicrocontrollerInterfacing With PCYin Min Theint, Myo Maung Maung, Hla Myo Tun

Abstract: This system proposes metal detector by using PIC microcontroller interfacing with PC. The system uses PIC microcontroller as the maincontroller whether the detected metal is ferrous metal or non-ferrous metal. Among various types of metal sensors and various types of metal detectingtechnologies, concentric type induction coil sensor and VLF (very low frequency) metal detecting technology are used in this system. This systemconsists of two configurations_ Hardware configuration and Software configuration. The hardware components include induction coil sensors whichsenses the frequency changes of metal, a PIC microcontroller, personal computer (PC), buzzer, light emitting diode (LED) and webcam. The softwareconfiguration includes a program controller interface. PIC MikroCprogramming language is used to implement the control system. This control system isbased on the PIC 16F887 microcontroller.This system is mainly used in mining and high security places such as airport, plaza, shopping mall andgovernmental buildings.

Keywords: Induction coil, very low frequency technology, microcontroller, personal computer (PC), LEDs, Buzzer, webcam————————————————————

I. INTRODUCTION Nowadays, Metal detectors have become an essentialcomponent in today's society and widely used not only forhobbyists but also for safety purpose. For Safety purpose,

Metal detector that used in airport to ensure that there is nodangerous weapon such as knives, guns or any metal objectsthat could be used as weapons has been brought along byterrorist into the airplane. In technical area, people use metaldetector to search for the underground pipe or cable beforedigging in walls and floors. Besides that, many people enjoy indiscovering hidden treasure or valuable metal like gold andsilver by using metal detector [1].

Varioustypes of

metals

Sensing

Circuitusing

induction

coil

PhaseDetection

Circuit

Microcontro-ller

(16F887)

Display on

PersonalComputer (PC)

Webcam

Figure1. Overall block diagram of the system

In these days, most of metal detectors can only detect metalbut not the types of detected metal. And they usually indicateby turning on the alarm or LEDs whenever the metal target isdetected. In this system, not only the detected metal target but

also the types of metal are indicated on the personal computer(PC) and image records with webcam.

The types of non-ferrous metal are copper, aluminium, zincgold, platinum, bass, bronze and etc... Ferrous metals are almetals which have iron properties. The whole system iscontrolled by the PIC microcontroller. Figure.1 shows the

overall block diagram of the system.

II. RELATED TECHNOLOGY Metal detectors’ basic operation depends on Ampere’s andFaraday’s laws. It works on the principle of transmitting amagnetic field and analyzing a return signal from the targetand environment. The transmitted magnetic field varies intime. This transmitted magnetic field creates electric current toflow in metal targets. These electric currents are called eddycurrents, which in turn generate a weak magnetic field, butheir generated magnetic field is different from the transmittedmagnetic field in shape and strength. The regeneratedmagnetic field from the eddy currents causes an alternatingvoltage signal at the receive coil. Depending on the alternatingvoltage signal at the receive coil, we can decide whether themetal target is detected or not [2]. Metal detecting sensor isthe most essential component in metal detectors. In thissystem, induction coil sensor is used. Metal detectingcapabilities are vary according to coil sensor shapes, sizesand coil configurations. There are three types of coil shapes –

(i) Round shaped coil(ii) Elliptical shaped coil(iii) Open-web coil

The most common types of coil configuration are-(i) Concentric coil(ii) Double-D coil(iii) Mono loop coil

There are different types of metal detecting technologies. Theyare-

1. Beat Frequency Oscillator (BFO)

2. Pulse Induction (PI)

3. Very Low Frequency (VLF)

The Beat Frequency Oscillator (BFO) operates in the range o100s kHz. The Pulse Induction (PI) operates in the range of100s Hz and the very low frequency (VLF) operates in therange of 3-30 kHz. Among these technologies, VLF technologyis the most popular type of metal detecting technology. In thissystem, the VLF technology is also used because it has the

________________________

Yin Min Theint, Myo Maung Maung, Hla Myo Tun

Department of Electronic Engineering

Mandalay Technological University

[email protected], [email protected]

Page 2: Metal Detector by Using Pic Microcontroller Interfacing With Pc

8/20/2019 Metal Detector by Using Pic Microcontroller Interfacing With Pc

http://slidepdf.com/reader/full/metal-detector-by-using-pic-microcontroller-interfacing-with-pc 2/6

INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 06, JUNE 2015 ISSN 2277-8616

307IJSTR©2015www.ijstr.org

ability to discriminate different metals according to their phaseshifting.

III. SOFTWARE CONFIGURATION

A. Microcontroller program implementationIn this implementation, it is important to assign the referencevalue. This reference value is the input voltage of the

microcontroller and it is the output of the phase detectioncircuit when there is no metal detected. And then, it is to getthe input voltage value from the phase detection circuit. If theinput voltage changes, the metal is detected and the alarmsystem will be ON. If the input voltage increases whencompared to the reference voltage, this metal is non-ferrousmetal. If the input voltage decreases when compared to thereference voltage, this metal is ferrous metal. And it will bedisplayed on the personal computer (PC) using C# GUI. Theoverall program is implemented by the mikroC language.Figure.2shows the flowchart of microcontroller program.

Start

Senses

Metal

Metal

Detected?

Ferrous Metal or

Not?

No

Yes

Yes

End

Function of

Microcontroller

No

Display

on PC

Alarm

Unwanted metal

or Not?

webcamUnwanted metal

or Not?

YesYes

Figure2. Flowchart of the microcontroller program

B.

Simulation resultsMetal type discriminating system is simulated using PROTEUSSOFTWARE and their results are presented in this system. Insimulation software, instead of induction coil sensor, two pulsegenerators is used to input the frequency to the phasedetection circuit. One of these pulse generators is used as thetransmitted coil sensor and the other one is used as thereceived coil sensor. Phase detection circuit determines phaselead or phase lag by comparing two incoming frequencies fromtwo pulse generators. And then phase lead or phase lag valueis converted to the appropriate voltage by using active lowpass filters. Phase lead means increasing voltage and phaselag means decreasing voltage. A reference voltage is assigned

in the PIC microcontroller program when there is no phaselead or phase lag i.e. there is no output voltage change in thephase detection circuit. The PIC microcontroller discriminatesferrous metal or non-ferrous metal depending on the voltagefrom the phase detection circuit. Control system for PICmicrocontroller is implemented by MikroC program. Table.1shows defined voltage ranges of different metals.

Table I

Defined voltage ranges of different metals

Types of metal

No Metal

Ferrous Metal

Non-Ferrous Metal

Disallowable for Non-Ferrous Metal

Defined voltage ranges

1.90<Vref<1.95

V<Vref

V>Vref

2.10<V<2.15

Figure3. Simulation result when searching the metal target

Figure 4. C# GUI result when searching the metal target

Figure.3and Figure.4 show the simulation result and C# GUresult when there is no metal. When no metal detecting, thereis no increasing voltage or decreasing voltage but still thereference voltage. So, the PIC microcontroller is informed on

Page 3: Metal Detector by Using Pic Microcontroller Interfacing With Pc

8/20/2019 Metal Detector by Using Pic Microcontroller Interfacing With Pc

http://slidepdf.com/reader/full/metal-detector-by-using-pic-microcontroller-interfacing-with-pc 3/6

INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 06, JUNE 2015 ISSN 2277-8616

308IJSTR©2015www.ijstr.org

personal computer (PC) that there is no metal. Figure.5 andFigure. 6 show the simulation result and C# GUI result whennon-ferrous metal is detected. In this case, pulse width of thepulse generator as the receive coil sensor is greater than thepulse width of the pulse generator as the transmit coil sensor.So, the phase difference between these two signals is phaselead. And then, the increasing voltage is inputted to the PICmicrocontroller. PIC microcontroller determines that it is non-

ferrous metal and informs this message on personal computer(PC). At the same time, buzzer is activated and the green LEDis ON.

Figure5. Simulation result when the detected metal is non-ferrous metal

Figure 6. C# GUI result when the detected metal is non-ferrous metal

Figure.7 and Figure.8 show the simulation result and C# GUIresult when ferrous metal is detected. In this case, pulse widthof the pulse generator as the receive coil sensor is less thanthe pulse width of the pulse generator as the transmit coilsensor. So, the phase difference between these two signals isphase lag. And then, the decreasing voltage is inputted to thePIC microcontroller. PIC microcontroller determines that it isferrous metal and informs this message on the personalcomputer (PC). At the same time, buzzer is activated and thered led is ON.

Figure7. Simulation result when the detected metal is ferrousmetal

Figur e 8. C# GUI result when the detected metal is ferrousmetal

Figure.9 and Figure.10 show the simulation result and C# GUresult when disallowable non-ferrous metal is detected. In thiscase, pulse width of the pulse generator as the receive coisensor is greater than the pulse width of the pulse generatoras the transmit coil sensor. So, the phase difference betweenthese two signals is phase lead. And then, the increasingvoltage is inputted to the PIC microcontroller. PICmicrocontroller determines that it is non-ferrous metal and thisnon-ferrous metal is disallowable metal according to thedefined voltage ranges and then informs this message onpersonal computer (PC) and captures the object by usingwebcam. At the same time, buzzer is activated and the greenLED is ON.

Figure 9. Simulation result when the detected metal isdisallowable non-ferrous metal

Page 4: Metal Detector by Using Pic Microcontroller Interfacing With Pc

8/20/2019 Metal Detector by Using Pic Microcontroller Interfacing With Pc

http://slidepdf.com/reader/full/metal-detector-by-using-pic-microcontroller-interfacing-with-pc 4/6

INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 06, JUNE 2015 ISSN 2277-8616

309IJSTR©2015www.ijstr.org

Figur e 10. C# GUI result when the detected metal isdisallowable non-ferrous metal

IV. HARDWARE CONFIGURATION

A.

Oscillator Circuit Design4.86 kHz frequency range is designed to operate the

transmitter circuit. For low frequency, oscillator based R-Ccircuit can be used. In this system, Wien Bridge Oscillator, oneof R-C oscillator circuit is used. The dual power supply for thiscircuit is designed as ±9V. Figure. 11(a) and Figure. 11(b)show Wien Bridge Oscillator circuit.

Figure11(a) . Wien Bridge Oscillator circuit diagram

Figure11(b). Wien Bridge Oscillator circuit

B.

PIC microcontrollerPORTC pin 25 is connected to the personal computer (PC) viaRS232 PIC to PC serial cable cord on which is informed thatthe target metal is detected and the detected metal is ferrous

or non-ferrous. PORTD pin 5 is connected to buzzer andPORTD pins 19 and 20 are connected to LEDs. PORTA pin 1is connected to the phase detection circuit which is inputtedthe voltage level as the signal from the induction coil sensor.Pin 11 and pin 32 are power supply pins and the supplyvoltage is +5V. The ground pins are 12 and 31. Figure.12shows PIC16F887 microcontroller pins assign.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

40

39

38

37

36

35

34

33

32

31

30

29

28

27

26

25

24

23

22

21

PIC16F887

+5V

+5V

Input from phase

detection circuit

RC0

RC1

RC2

RC3

RC6

VDD

Vss

VDD

Vss

RD0

RD1

Vpp

RA0

To BuzzerRD2To LEDs

RA1

To PC

Figure12. PIC16F887 microcontroller pins assign

C. Phase Detection Circuit Design

+5V

+5V

XOR

Tx Coil

Rx Coil

22pF

1kΩ 1kΩ

1kΩ

18kΩ

1µF

18kΩ

1µF

+5V+5V

Figure13(a) . Phase detection circuit diagram

Figure13(b) . Phase detection circuit

Figure. 13(a) and Figure. 13(b) show Phase Detection CircuitDiagram and Phase Detection Circuit respectively. A phase

+9V

-9V

R3=10kΩ

R4=5kΩ

C2=10nFC1=10nF

R2=5kΩ

R1=5kΩ

Wien Bridge Oscillator circuit

Phase Detection Circuit

Page 5: Metal Detector by Using Pic Microcontroller Interfacing With Pc

8/20/2019 Metal Detector by Using Pic Microcontroller Interfacing With Pc

http://slidepdf.com/reader/full/metal-detector-by-using-pic-microcontroller-interfacing-with-pc 5/6

INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 06, JUNE 2015 ISSN 2277-8616

310IJSTR©2015www.ijstr.org

detector generates a voltage proportional to the difference inphase between two signals. In this circuit design, phasedetection circuit is designed by the Exclusive OR: HEF4030. 0˚and 180˚ are the two extreme values of an XOR gate basedphase detector. If the phase difference of the input signalsdecreases, the average voltage of the output signal alsodecreases. If the phase difference of the input signalsincreases, the average voltage of the output signal also

increases. On the other hand, the width of the positive pulse ofthe output signal changes proportionally to the phasedifference of the input signal. So, the average output voltage isdirectly proportional to the phase difference of the input signalif the phase difference is between 0˚ and 180˚. Then, to getthe average voltage without noise, the output voltage ispassed through the active low pass filter. The formula for theoutput voltage is

Vout = (Vdd/180) *∆Φ

Where,Vout= Average output voltageVdd = Supply voltage of the XOR gate

∆Φ = Phase difference in degrees ( ˚ )

D. Induction Coil Sensor DesignIn this system, concentric coil design is used to sense themetal target. It has transmit coil, receive coil and feedback coil.Transmit coil and receive coil are wound in the same directionbut the bucking coil is in the reverse direction of these twocoils and wound over the receive coil to cancel the externalnoise of the transmit coil. An AWG 28 is used for the transmitcoil and feedback coil. An AWG 30 is used for the receive coil.Figure.14 shows the induction coil sensor. To calculate the coilinductance, the following equation is used in this system.

L = 0.8R2

× N2

6R + 9l + 10D

µH

Where,R= radius (in inches)N= turnsL= length (in inches)D= Depth (in inches)

Figure14. Induction coil sensor

E.

Circuit Description

+9V

-9V

+5V

+5V

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

40

39

38

37

36

35

34

33

32

31

30

29

28

27

26

25

24

23

22

21

PIC16F887+5V

+5V

RC0

RC1

RC2

RC3

RC6/TX/CK

VDD

Vss

VDD

Vss

RD0

RD1

Vpp

RA0

RD2

XOR

TxCoil

BxCoil

RxCoil

0.33µF

100nF

22pF

1kΩ 1kΩ

1kΩ

18kΩ

1µF

18kΩ

1µF

+5V+5V

R3=10kΩ

R4=5kΩ

C2=10nFC1=10nF

R2=5kΩ

R1=5kΩ

Buzzer

E R R O R

D C D

D S R

R X D

R T S

T X D

C T S

D T R

R I

RC7/RX/DT

1 6 2 7 3 8 4 9

C

L

Figure15. Overall circuit diagram of the system

Figure.15 shows the overall circuit diagram of the metadiscriminating system by using PIC 16F887 microcontroller. Inthis system, there are three parts: the input, the processingand the output. It is composed of power supply, sensingcircuit, phase detecting circuit, microcontroller, persona

computer (PC), light emitting diode (LED) and buzzer. PIC16F887 microcontroller is used to control the overall systemThe sensing value from the sensing circuit is inputted to thephase detection circuit. The sensing value is the frequencycoming from the metal. The frequency changes are dependedon the various types of metals. And then, the frequencychanges is inputted to the phase detection circuit. Dependingon the output voltage from the phase detection circuit, themicrocontroller determines whether the detected metal isferrous metal or non-ferrous metal and it is displayed on thepersonal computer (PC). In this system, buzzer is used toalarm that the metal is detected. In the case of LEDs, twoLEDs: green and red are used to notify that the metal isferrous or non-ferrous. If the discriminated metal is prohibited

metal, the webcam will capture this type of metal.

F.

Hardware Results

Figur e 16(a). System model for walkthrough metal detector

Page 6: Metal Detector by Using Pic Microcontroller Interfacing With Pc

8/20/2019 Metal Detector by Using Pic Microcontroller Interfacing With Pc

http://slidepdf.com/reader/full/metal-detector-by-using-pic-microcontroller-interfacing-with-pc 6/6

INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 06, JUNE 2015 ISSN 2277-8616

311IJSTR©2015www ijstr org

Figure 16(b).C# GUI of personal computer (PC) for thewalkthrough metal detector

Figure 16(c). System model for walkthrough metal detectorwith personal computer (PC)

Figure.16 (a), Figure.16 (b) and Figure. 16(c) show thesystemmodel for the walkthrough metal detector with personalcomputer. In this system, various types of metal such as iron,copper, aluminum, gold and platinum can be sensed by theinduction coil sensing circuit. And the maximum distance thatthe coil sensor can sense is about 8cm to 9cm. The buzzer isactivated whenever the metal is detected. When the ferrous

metal is detected, the red LED is ON. In the case of non-ferrous metal, the green LED is ON. And this message is alsodisplayed on the personal computer (PC). Moreover, if thedetected metal is disallowable metal, the webcam will capturethis object. By this way, the security personal can get thephoto records from this type of metal detector.

V. CONCLUSIONS In this paper, this system is implemented by the VLFtechnology. And the induction sensor is designed by theconcentric design. It is mainly used in airports, shopping mall,plaza and governmental buildings. It offers an effective way toimprove the security of citizens and government. And metal

detector using metal-type discriminating system can find theprohibited metal easier than other metal detectors. Thissystem also supports the security personnel to find thedangerous metals more easily.

ACKNOWLEDGEMENTThe author would like to thank to Dr. HlaMyoTun, AssociateProfessor and Head of the Department of Electronic

Engineering, Mandalay Technological University for his helpAnd thanks to all teachers from Department of ElectronicEngineering, Mandalay Technological University for theirguidance, support and encouragement.

REFERENCES [1] http://www.engineering.com/the smart Metal Detecto

Engineering

[2] http://www. The basic theory of metal detector.com

[3] Mohammad S. Sharawi and Mohammad I.Sharaw―Design and implementation of a low cost VLF metadetector with metal- type discrimination capabilities‖

2007 IEEE international conference on SignaProcessing and Communications (ICSPC- 2007)

[4] http://homepage.ntlworld.com/moonshadowNew_Folder/metal_detectors.htm

[5] http:// Geotech- Projects/Coils coils and coils.htm

[6] http://en.m.wikipedia.org/wiki/Phase_detector

[7] http://www.ebinger.org/metal