基于GSM的煤气表采集系统的设计作者姓名李朋朋专业电子信息工程指导教师姓名郭俊美专业技术职务讲师_目录摘要...............................................1第一章绪论...................................31.1课题意义.............................................31.2本系统完成的功能.....................................3第二章各模块方案选择...........................32.1电源模块.............................................32.2单片机控制模块.......................................42.3煤气流量传感器的选择.................................42.4键盘模块.............................................42.5显示模块.............................................52.6数字时钟电路.........................................52.7串口解决方案.........................................62.8GSM模块选择.........................................62.9数据存储器...........................................6第三章系统硬件设计.............................73.1硬件总体结构.........................................73.2PIC18F458单片机简介................................73.2.1高性能RISCCPU.....................................73.2.2外围功能模块特性...................................73.2.3高级的模/数转换特性................................83.2.4CAN总线模块特性....................................83.2.5特殊的单片机特性...................................93.2.6FLASH技术.........................................93.3.煤气流量传感器电路的设计.............................93.4漏气检测电路的设计..................................103.5开阀熄火检测电路的设计..............................103.6通风扇控制电路......................................113.7电磁气阀控制电路....................................113.8红外键盘模块设计....................................123.9电源电路的设计......................................153.10时钟电路的设计.....................................163.10.1时钟芯片DS1302简介..............................163.10.2DS1302硬件连接..................................173.11LCD液晶显示电路....................................173.12打印机模块.........................................183.13通过串口收发短消息.................................193.13.1GSM短消息技术简介................................193.13.2短消息特点.......................................203.13.3收发短消息方式...................................213.13.4PDU编码.........................................213.13.5AT指令..........................................213.13.6发短消息.........................................223.13.7接收短消息.......................................24第四章软件设计................................254.1软件设计的主要步骤..................................254.2主函数流程图........................................274.3数据采集,存储,查询软件设计........................284.4红外健盘软件设计....................................304.5GSM模块短信接收发送设计.............................31第五章实物效果................................335.1本系统的控制按键说明................................335.2各功能详细介绍......................................34第六章结束语..................................40参考文献............................................41附录..............................................42附录一:总原理图........................................42附录二:主程序清单......................................43致谢.............................................116山东轻工业学院2009届本科生毕业设计(论文)1摘要采用传统的人工抄取煤气表数据的方式,不可避免地存在耗费人工、效率低、误差大,时间长等缺点。无线抄表系统可以摆脱人工抄表的办法,利用GSM进行远程数据传输。具有计量准确、通信可靠、抄表方便、功耗低等优点,以及节省人力、远程监控、远程维护的功能。本系统设计的GSM抄表系统是由单片机控制模块、流量计数模块、电源模块、显示模块、GSM通信模块、时钟模块、红外线键盘模块、打印模块、漏气检测模块、开阀熄火检测模块和存储模块等组成。本系统实现了用量计数、计价、用量查询、GSM远程无线抄表、打印、存储、液晶显示、红外键盘控制、号码更改、价格更改、闹钟设置、时间设置、手动止闹、漏气检测、开阀熄火检测、报警等功能。最终完成一个多功能家庭煤气表的设计。虽然现在只有部分城市采用了远程抄表,但全国全面建设的号角已经吹响,很多的大中型城市已经开始全面部署。相关的电子科技企业也都快速的跟进,加紧远程无线抄表的研发和生产步伐。相信在几年之内,原始的人工抄表系统将会被现代化的无线抄表系统所全面取代。关键词:GSM无线抄表煤气表单片机山东轻工业学院2009届本科生毕业设计(论文)2ABSTRACTUsingthetraditionalartificiallyreadingdatafromthegasmeter,inevitablyexistconsumingmanual,inefficientanderror,timetolong,andothershortcomings.TheadvantageofGSMwirelessmeterreadingsystemisaccuratemetering,reliablecommunication,meter-readingconvenience,lowpowerconsumptionandthelabour-saving,remotemonitoring,remotemaintenancefunctions.Thewirelessmeter-readingsystemisconsistofMCUmodule,flownumberofmodules,powermodule,displayingmodule,GSMcommunicationmodule,clockmodule,infraredkeyboardmodules,printmodules,leakdetectionmodule,Extinguishedthefiredetectionmoduleandmemorymodule.Thesystemtoachievetheamountofcounting,pricing,theamountofinquiries,GSMwirelessremotemeter-reading,printing,storage,liquidcrystaldisplay,infra-redkeyboardcontrol,thenumberchanges,pricechanges,thealarmsettings,timesettings,Manuallystoptheclock,leakdetection,Extinguishedthefiredetection,alarmandotherfunctions.Finalcompletionofamulti-purposehouseholdgasmeterdesign.Althoughonlyahandfulofcitiesusingthewirelessmeterreadingsystem,butthecomprehensivebuildingoftheNationalbuglecallissounded.Manyofthelargeandmedium-sizedcitieshavestartedfulldeployment.Elec-tronictechnologyrelatedenterprisesarequickfollow-up.Believethatwithinafewyears,thetraditionalartificiallyreadingdatafromthegasmeterwillbereplacedbythewirelessmeterreadingsystem.Keywords:GSMwirelessmeterreadingsystem;Gasmeter;MCU山东轻工业学院2009届本科生毕业设计(论文)3第一章绪论1.1课题意义目前市场上销售的煤气表一般来说有机械式和数字式两大类。机械式历史悠久,技术成熟,价格低廉,但功能单一,目前占有较大的市场份额;数字式显示直观,功能多,价格高。机械式只能由人工抄表,这种落后的抄表方式,消耗大量的人力、物力,而且采集数据的时间跨度大、采集数据的准确度低。抄煤气表一向是燃气部门一项复杂而重要的工作,而市民交费同样是件繁琐的事情,给居民带来很多的不便。因此,国家有关部门规定以