基于单片机的智能家居控制系统设计
摘要
“智能家居控制系统”是以单片机为控制核心,通过红外遥控模块遥控单片机实现室温实时测量、时间日期显示、以及控制家庭用电器开关通断来实现家用电器自动控制的功能。其中温度测量是通过DS18B20芯片实现,日期时间是通过DS1302实现,家用电器开关通断是通过继电器实现,各项数据通过LCD1602液晶显示屏显示。该系统可以远程方便地控制家用电器的工作状况,既可以提升家居安全性、便利性、舒适性,又能实现环保节能的居住环境。是未来家电控制发展的主要趋势。
本文首先针对课题背景设计了一套总体的系统框图与方案,然后根据系统框图将系统分为控制、红外、时钟、温度、继电器和显示六个模块。分别针对后五个模块进行电路介绍、原理分析及软件设计,并用控制模块将这五个模块整理、整合到一个系统中成为最终的智能家居控制系统。本课题借助Proteus软件进行电路仿真,Keil软件进行程序设计编译,使用STCISP软件将程序烧录至单片机中,最终成果是使用MX51开发板,外加SRD05VDC型号继电器实现的。
最终成果现象为开机后液晶显示屏上显示当前日期、时间、环境温度以及当前工作的继电器编号,遥控器按“1”、“2”、“3”键分别控制继电器1、2、3的通断,按奇数次为通电,按偶数次为断电,继电器之间工作独立。关键词:STC89C52单片机;继电器;DS18B20;DS1302;红外模块;LCD1602
1
fAbstract
Theker
elco
trolofIHCSI
tellige
tHomeCo
trolSystemisSTC89C52Itca
measurethecurre
ttemperaturecalculateDatea
dTimeco
trolelectricalcompo
e
ts’switchi
gtorealizelo
gdista
cedomi
ati
gtheelectricalcompo
e
tsbyusi
gthei
fraredmoduleco
trolli
gtheSTC89C52Curre
ttemperaturemeasuri
gisrealizedbyDS18B20whiledatea
dtimedisplayi
gisrealizedbyDS1302Electricalcompo
e
ts’switchi
gisdecidedbyelectromag
eticrelaywhe
allofthei
formatio
a
ddataisdisplayedbyLCD1602Thesystemmayhavealo
gdista
ceco
trolofelectricalcompo
e
tsIt
oto
lywillimprovethesafetyco
ve
ie
cecomfortofourlivi
gco
ditio
butalsoca
itsavethee
ergytobea
e
viro
me
talfrie
dlylivi
gstyleItisthemai
te
de
cyofthefutureelectricityco
trol
Itwasfirstlyi
troducedi
thisessaythattheIHCSblockdiagrama
dprogramItdividi
gthesystemi
toco
trolli
gmodulei
fraredtimi
gtemperatureelectromag
eticrelaya
ddisplaymoduleA
di
troduci
gthecircuita
alyzi
gthetheorydesig
i
gthesoftwareofthemexceptco
trolli
gmoduleo
ebyo
eAfterthatco
trolli
gmoduleco
ectsthisfivemodulesi
toasystemthe
birthstheIHCSI
thisessayitprojectbackgrou
doftheproductir