基于单片机的智能鞋柜的设计与实现
鞋柜设计的实用与美观并存 #生活技巧# #家居装饰技巧# #软装搭配建议#
功能介绍 以51单片机作为主控系统;通过DHT11温湿度采集;通过按键设置逻辑处理;通过LED紫外线消毒;通过继电器控制风扇进行换气除湿;通过继电器控制加热片进行加热;整个电路以5v供电; 电路图PCB
源代码
#include <reg52.h>
#include <intrins.h>
#include <stdio.h>
#define uchar unsigned char
#define ushort unsigned int
#define uint unsigned long
#include "lcd1602.h"
#include "uart_trx.h"
#include "eeprom52.h"
#define RATIO 800
sbit key1 = P1^0;
sbit key2 = P1^1;
sbit beep = P2^0;
sbit Fan = P1^3;
unsigned char pmBuf[7] = 0;
uint PM25_Value = 0;
uint PM25_ValueMax = 200;
void EEPROM_WRITE()
{
SectorErase(0x2000);
byte_write(0x2001, (PM25_ValueMax>>8)&0xFF);
byte_write(0x2002, (PM25_ValueMax>>0)&0xFF);
byte_write(0x2009, 111);
}
void EEPROM_READ()
{
if(byte_read(0x2009)!=111)
{
EEPROM_WRITE();
delay_ms(100);
}
PM25_ValueMax = byte_read(0x2001)<<8 | byte_read(0x2002);
}
void Get_PM(void)
{
char i = 0;
char j = 0;
char k = 0;
COM.RX_Cnt = 0;
if(COM.B_RX_OK == 1)
{
for(i = 0; i<8; i++)
{
if((RX_Buffer[i] == 0xAA)&&(RX_Buffer[i+6]==0xFF))
{
goto find2;
}
}
goto end2;
find2:
for(j = 0; j<7; j++)
{
pmBuf[j] = RX_Buffer[i+j];
}
PM25_Value = (unsigned int)((pmBuf[1]*256)+pmBuf[2])*5/2048.0*RATIO;
COM.B_RX_OK = 0;
}
end2:
return;
}
void main(void)
{
unsigned int test;
EEPROM_READ();
LCD_init();
Uart_Init(2400);
LCD_write_string(0,0,"Pm2.5: ug/m3 ");
LCD_write_string(0,1,"PmMax: ug/m3 ");
LCD_write_char(7, 1, PM25_ValueMax % 1000 / 100 + 0x30);
LCD_write_char(8, 1, PM25_ValueMax % 100 / 10 + 0x30);
LCD_write_char(9, 1, PM25_ValueMax % 10 + 0x30);
while(1)
{
if (test ++ > 250)
{
test = 0 ;
Get_PM();
if(PM25_Value > 999)
PM25_Value = 999;
LCD_write_char(7, 0, PM25_Value % 1000 / 100 + 0x30);
LCD_write_char(8, 0, PM25_Value % 100 / 10 + 0x30);
LCD_write_char(9, 0, PM25_Value % 10 + 0x30);
if(PM25_Value >= PM25_ValueMax)
{
beep = ~beep;
Fan = 0;
delay_ms(100);
}
else
{
beep = 1;
Fan = 1;
}
}
if(key1 == 0)
{
delay_ms(10);
if(key1 == 0)
{
beep = 0;
delay_ms(100);
beep = 1;
while(key1 == 0);
if(PM25_ValueMax<999)PM25_ValueMax+=10;
LCD_write_char(7, 1, PM25_ValueMax % 1000 / 100 + 0x30);
LCD_write_char(8, 1, PM25_ValueMax % 100 / 10 + 0x30);
LCD_write_char(9, 1, PM25_ValueMax % 10 + 0x30);
EEPROM_WRITE();
}
}
if(key2 == 0)
{
delay_ms(10);
if(key2 == 0)
{
beep = 0;
delay_ms(100);
beep = 1;
while(key2 == 0);
if(PM25_ValueMax>=10)PM25_ValueMax-=10;
LCD_write_char(7, 1, PM25_ValueMax % 1000 / 100 + 0x30);
LCD_write_char(8, 1, PM25_ValueMax % 100 / 10 + 0x30);
LCD_write_char(9, 1, PM25_ValueMax % 10 + 0x30);
EEPROM_WRITE();
}
}
delay_ms(1);
}
}
元器件清单 基于单片机的智能鞋柜的设计与实现名称型号数量单片机STC89C521IC座DIP401万能板9*15cm1晶振11.0592M1电解电容10uF1电解电容1000uf1瓷片电容22pF2电阻10K3电阻1K4电阻2K1LED红5MM1LED绿5MM1蜂鸣器有源1三极管S90121按键5显示屏LCD16021排针16P1排母16P1人体红外模块HC-SR5011排母3P1温度传感器DS18B201烟雾传感器MQ-21模数转换器ADC08321IC座8P1GSM模块SIM800c1电源座5MM1电源线5V2A1自锁开关1继电器1小水泵1导线若干焊锡丝若干 参考文献参考文献
[1]王德保.GPS在城市控制网中的应用研究[D].山东:山东科技大学,2005.
[2]何立民.从现代计算机视角看嵌入式系统(4)嵌入式系统40年发展史[J].单片机与嵌入式系统应用,2016,16(04):77-79.
[3]康桂霞,刘达.FPGA应用技术教程[M].北京:人民邮电出版社:201306.229.
[4]朴德慧,衣英刚.液晶显示器驱动板MCU电路介绍(上)[J].家电检修技术,2012(11):53.
[5]段廷魁.全球卫星定位系统(GNSS)在工程测量中的实践运用探索0[J].科技创新与应用,2021(05):182-184.
[6]宋戈,黄鹤松.51单片机应用开发范例大全[M].北京:人民邮电出版社:国家信息技术紧缺人才培养工程系列丛书,201206.558.
[7]罗小青.单片机原理及应用教程[M].北京:人民邮电出版社,201409.180.
[8]沈庆阳.单片机实践与应用[M].北京:清华大学出版社,2002.
[9]杜深慧.温湿度检测装置的设计与实现[M].北京:机械工业出版社,2004.
[10]林嘉.基于89S52的LCD1602程序设计[J].电脑知识与技术,2012(26):6376-6378.
[11]刘光伟.基于单片机的温室温湿度监测系统设计与实现[D].秦皇岛市:燕山大学,2012.
[12]褚福强,董学仁.单片机的网络接入技术研究[J].仪器仪表用户,2006(05):4-5.
[13]陈英俊.基于单片机的温湿度监测和报警系统设计[J].广东石油化工学院学报,2013(04):42-46.
[14]廖丽媛.基于应变式扭矩传感器的测量系统的设计[D].上海市:东华大学,2013.
[15]刘九庆.温室环境工程技术[M].吉林:东北林业大学出版社,2002.
[16]王明喜,崔世茂.大棚型日光温室光照、温度及湿度等性能的初步研究[J].农业工程技术(温室园艺),2008(05):19-21.
[17]张迎辉.单片微型计算机键盘接口设计[J].信息技术,2004(07):68-69+91.
[18]张友德,赵志英.单片微型机原理应用与实验[M].上海市:复旦大学出版社,2003.
[19]赵芝芸.温室智能监控系统[D].江苏:江苏科技大学,2010.
[20]张宏伟.基于STM32的智能环境监测系统设计与实现[J].大庆师范学院学报,2020(05):32-35.
[21]王世伟,杨越.基于STM32的多型号舵机调试器设计[J].九江学院学报(自然科学版),2020,35(02):33-36.
[22]Pengcheng Zhao,Meijun Ni,Chao Chen,Chenxi Wang,PingpingYang,Xiahui Wang,Chunyan Li,Yixi Xie,Junjie Fei. A Novel Self-protection Hydroquinone Electrochemical Sensor Based on Thermo -sensitive Triblock Polymer PS-PNIPAm-PS[J].
[23]Jian Wang,Jing Chen,Xiaofu Xiong,Xiaofeng Lu,ZhengLiao,Xiaobo Chen.Temperature safety analysis and backup protectionscheme improvement for overhead transmission line in poweroscillation condition[T].Electric Power Systems Research,2019,166.
[24]Fuji Electric Co.Ltd.;Patent Issued for SeiconductorDevice And Method Of Outputting Temperature Alarm (USPTO10,164,626)[J].Electronics Newsweekly,2019.
[25]VERSID,INC;Patent Issued for Refrigeration UnitTemperature Alarm Using Thermal Properties of Food to Eliminate FalseAlarms (USPTO 9752810)[J].Computers,Networks &Communications,2017.
[26]Fuji Electric Co.Ltd;Patent Application Titled"Semiconductor Device and Method of Outputting Teperature Alarm"Published Online (USPTO 20170077919)[J]. Technology & BusinessJournal,2017.
[27]su Yuanping,Xu Lihong,Goodman Erik D.Multi-layerhierarchical optimisation of greenhouse climate setpoints for energyconservation and improvement of crop yield[J].Biosystems
[28]黄松茂.基于STM32的家庭环境监测系统的设计与实现[D].甘肃兰州.西北师范大学,2018.:23-30.
[29]李大琳.智能车内温度监测系统设计[J].山东工业技术,2014(12):80-81.
[30]郭雯,王海涛. 智能输液系统的发展与应用.医疗卫生装备,2012
网址:基于单片机的智能鞋柜的设计与实现 https://www.yuejiaxmz.com/news/view/145150
相关内容
基于物联网的智能鞋柜系统设计智能鞋柜设计研究
基于单片机的智能宠物喂食系统设计
【特纳斯电子】基于单片机的智能洗衣机系统设计
基于单片机的智能健康监测手环的设计
基于STM32的智能节能风扇的设计与实现
基于单片机的智能家庭安防报警系统设计研究
【DIY】基于STM32智能家居系统的设计与实现
【本科毕业设计】基于单片机的智能家居防火防盗报警系统
基于Android平台Camera的设计与实现