1长沙航空职业技术学院2012届毕业设计(论文)基于单片机的智能型金属探测器的设计学院(部):航空电子电气工程系专业:应用电子技术学生姓名:梁艺钟班级:电子0901学号67指导教师姓名:谢佳君职称助教最终评定成绩2012年5月2摘要金属探测器是专门用来探测金属的仪器。广泛应用于工业生产、安检、娱乐等领域。这里我们设计的是一个基于单片机的手持金属探测器。它可以检测到人随身携带的金属物品,如小刀、钢笔甚至可以检测到香烟盒(内部有铝薄膜)。可随身携带,使用方便。金属探测是根据电磁感应原理制成的,将一金属置于变化的磁场当中时,根据电磁感应原理就会在金属内部产生涡流,涡流产生的磁场反过来又影响原磁场,这种变化可以转换为电压幅值的变化,供相关电路进行检测。它也可以表现为振荡电路频率的变化,用检测频率的办法进行检测,这里使用的是后者,振荡部分由电容三点式振荡电路组成,产生的正弦波进行放大和脉冲转换电路,再送入单片机,由单片机探测它频率的变化。当遇见金属时由于电磁感应原理原先建立起来的振荡将受到影响,频率将发生变化,单片机探测到这种变化后进行报警。本次金属探测器的设计还给它添加了接口可以和外围的系统进行通讯,这里实现了与液晶显示,键盘和AT89S52组成的外围数据处理与显示模块的通信,对前端探测到的数据进行再处理和分析,并将结果显示在液晶屏幕上,并可以通过键盘对前端的探测进度进行设置。关键字:金属探测;电磁感应原理;单片机;涡流;振荡电路3ABSTRACTMetaldetectorisaninstrumentwhichusefordetectingmetalspecially.ithasbeenextensivelyusedinproduce,Safetyinspection,entertainmentandsoon.HerewedesignedahandheldmetaldetectorswhichbasedontheMCU.Itcandetectpeoplecarryingmetalitemssuchasknives,pensandevenboxesofcigarettes(withinthealuminumfilm).Portable,easytouse.Itismadeaccordingtoprincipleofelectromagnetisminduction.whenweputanmetalobjectaroundmagneticfieldwithchangingseries.therewillproducevortexinnermetalobject.Thevortexwillcreatemagneticfieldtoo.Thenewmagneticfieldwillaffecttheold.Thechangecanbeconvertintovoltagesignalfordetectingbyrelativeelectrocircuit.Itcanalsoconvertintofrequencysignalandbedetectedbyfrequencydetector.Hereweusethesecondmethod.TheoscillationcircuitpartiscomposedbyCapacitancethree-pointoscillationcircuit.Thesignalcreatedbythepartismagnifiedfirstandthenconvertintoimpulsesignal.ThenitcanbeprocessedbySCM.SCMdetectitsfrequency,comparewiththebasefrequencyandthendeterminewhethertoworn.Weaddaninterfacetothedetector.SoitcancommunicatewithotherSCMsystemwhichcontentalcd,akeyboard,aSCM.TheSCMsystemcanprocessthedatamorepreciselyandthendisplaytheresultthroughlcd.thekeyboardisusedforuserwhowanttosetthedetectingprecision.Keywords:metaldetector;theprincipleofelectromagnetisminduction;SCM;vortex;oscillationcircuit4目录1引言....................................................................................................................................................62综述....................................................................................................................................................83方案论证.............................................................................................................................................103.1基于单片机的金属探测器的设计方案................................................................103.2MD—898K金属探测器....................................................................................................113.3基于霍尔器件的数字金属探测器.............................................错误!未定义书签。4总体设计...........................................................................................................................................114.1硬件电路设计.....................................................................................................................124.2软件结构设计......................................................................................................................154.2.1前端程序结构设计..............................................................................................304.2.2外围数据处理与显示程序结构设计........................................................315单元电路设计................................................................................................................................325.1振荡电路设计.....................................................................................................................325.2放大电路和脉冲变换电路...........................................................................................335.3单片机系统..........................................................................................................................355.4外围设置与显示系统......................................................................................................366软件模块设计.................................................................................................................................376.1前端软件设计.....................................................................................................................386.2外围数据处理与显示模块设计................................................................................427实现与性能分析.............................................................................................错误!未定义书签。57.1硬件电路焊接与调试.......................................................................错误!未定义书签。7.1.1振荡电路的焊接与调试....................................................错误!未定义书签。7.1.2放大电路与脉冲转换电路的焊接与调试...............错误!未定义书签。7.1.3单片机系统的焊接与调试...............................................错误!未定义书签。7.1.4外围数据处理与显示模块的焊接与调试...............错误!未定义书签。7.2软件模块的调试与集成..................................................................错误!未定义书签。7.2.1前端金属探测模块的调试与集成...............................错误!未定义书签。7.2.2外围数据处理与显示模块的调试与集成...............错误!未定义书签。7.3系统性能分析.......................................................................................错误!未定义书签。7.3.1基准频率测定方法的优缺点分析........................