济南大学泉城学院毕业设计题目基于单片机的路灯控制系统设计学院工学院专业电气工程及其自动化班级1302班学生李学联学号2013010855指导教师张兴达魏志轩二〇一七年五月十六日济南大学泉城学院毕业设计-I-摘要随着科学技术的日益发展,在日常生活中人们对于路灯控制系统的要求越来越高。针对人们的需求功耗大,功能单一的系统已不再满足人们的需求。本设计针对上述问题提出了一种新型的路灯系统,可以解决人们的需求。本设计主要包括硬件系统设计和软件系统设计。其系统硬件是由AT89S52单片机,时钟芯片DS1302,驻极体话筒,LCD1602和光敏电阻等为核心的的路灯低功耗智能控制装置构成。软件部分是以Keil、Proteus等软件为载体,使用C语言对程序进行编写。单片机根据光敏电阻和人体红外感应模块对路边状况的检测和时钟芯片DS1302设置时间来控制电压比较器实现LED路灯亮度的自动调节,通过LCD显示时间和光感度,通过光敏电阻实现故障检测,当路灯出现故障时,蜂鸣器会自动进行报警。通过仿真及实物制作、调试,验证了本设计内容的可行性,为进一步研发推广提供了一定的数据参考。关键词:单片机;传感器;路灯控制济南大学泉城学院毕业设计-II-ABSTRACTWiththedevelopmentofthetechnology,theapplicationofstreetlightcontrolsystemisplayinganincreasinglyimportantroleinourdailylife.Demandforpeople'sneeds,asinglefunctionofthesystemisnolongermeetpeople'sneeds.Thedesignoftheabovementionedanewtypeofstreetlampsystem,cansolvepeople'sneeds.Thedesignincludeshardwaresystemdesignandsoftwaresystemdesign.ThehardwaresystemincludesthesinglechipofAT89S52,theclockchip1302,Analog-to-DigitalConverterandphotosensitiveresistor.ThesoftwaresystemisbasedonKeil,Proteusandothersoftwareasthecarrier,theuseofClanguagetowritetheprogram.Single-chipaccordingtothephotosensitiveresistorandinfraredpyroelectricsensorontheroadsidedetectionandclockchipDS1302setthetimetocontroltheA/DconversionchiptoachieveautomaticadjustmentofLEDstreetlightbrightness.ThroughtheLCDdisplaytimeandlightsensitivity,throughthephotosensitiveresistortoachievefaultdetection,whenthestreetlightsbreakdown,thebuzzerwillautomaticallyalarm.Throughthesimulationandproduction,debugging,verifythefeasibilityofthedesigncontent,tofurtherresearchanddevelopmenttoprovideacertaindatareference.Keywords:MCU;transducer;Streetlightcontrol济南大学泉城学院毕业设计-III-目录摘要........................................................................................................................................IABSTRACT..........................................................................................................................II1前言...................................................................................................................................11.1研究背景与意义.....................................................................................................11.2国内外研究现状.....................................................................................................11.3本设计研究的主要内容.........................................................................................22系统总体设计方案...........................................................................................................32.1硬件部分设计方案.................................................................................................32.2软件部分设计方案.................................................................................................43硬件部分设计...................................................................................................................53.1单片机最小系统.....................................................................................................53.2光线检测电路.........................................................................................................63.2.1双电压比较器...............................................................................................63.2.2光敏电阻.......................................................................................................63.3报警电路.................................................................................................................73.4人体红外感应模块电路.........................................................................................73.5声音检测电路.........................................................................................................83.6时钟电路.................................................................................................................94软件部分设计.................................................................................................................104.1软件介绍...............................................................................................................104.1.1Proteus软件.................................................................................................104.1.2keil软件.......................................................................................................104.2主程序设计...........................................................................................................124.3子程序设计...........................................................................................................134.3.1人体检测子程序.........................................................................................134.3.2时钟子程序.................................................................................................134.3.3报警子程序.................................................................................................144.3.4光线检测子程序.........................................................................................154.3.5中断子程序.................................................................................................165系统仿