当前位置:网站首页>Temperature and humidity monitoring + timing alarm system based on 51 single chip microcomputer (C51 source code)
Temperature and humidity monitoring + timing alarm system based on 51 single chip microcomputer (C51 source code)
2022-04-23 13:00:00 【Outside Jinguan City】
Functional specifications :
1.DS1302 Module real-time display time ( The display time can be initialized through the program )
2.DHT11 Temperature and humidity measurement
3. Press the key to set the timing alarm time , And store the set value in 24C02 in ( After power failure, the previous setting data can be restored )
4.LCD1602 Display relevant information
matters needing attention :
processor :STC89C51/STC89C52
display :LCD1602
ROM Storage :24C02
Time to show :DS1302
Temperature and humidity measurement :DHT11
Press the key to adjust the alarm time
Chinese notes of relevant pin connection
//--- Definition lcd1602 The use of IO mouth ---//
#define LCD_DATA P0
sbit RS=P2^7;
sbit RW=P2^6;
sbit EN=P2^5;
//--- Definition Key The use of IO mouth ---//
sbit key1=P1^5;
sbit key2=P1^6;
sbit key3=P1^7;
//--- Definition ds1302 The use of IO mouth ---//
sbit SCLK=P1^2;
sbit DSIO=P1^3;
sbit RST=P1^4;
//---DS1302 Address commands for writing and reading hours, minutes and seconds ---//
//--- Second minute hour Sun Moon anniversary Lowest read / write bit ;-------//
uchar code READ_RTC_ADDR[7] = {
0x81, 0x83, 0x85, 0x87, 0x89, 0x8b, 0x8d};
uchar code WRITE_RTC_ADDR[7] = {
0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c};
//--- DS1302 Clock initialization 2021 year 3 month 8 Japan 16 spot 46 branch 00 second ---//
//--- second branch when Japan month Zhou year ---//
uchar TIME[7] = {
0, 0x46, 0x16, 0x08, 0x03, 0x01, 0x21};
uchar warn_hour,real_hour;// Alarm time , By reading the flash obtain
//--- Definition dh11 The use of IO mouth ---//
sbit dat=P2^2;
uchar DHT11[5],RTflag=0;
uchar FLAG;
//--- Definition 2402 The use of IO mouth ---//
sbit SDA=P1^1;
sbit SCL=P1^0;
//--- Definition beep The use of IO mouth ---//
sbit beep=P2^0;
uchar beep_state=1;
//--- Definition led The use of IO mouth ---//
sbit led=P2^1;
Main function code
void
main()
{
lcd_init(); //1602 initialization
init_2402(); //2402 initialization
warn_hour =read_data(0); // read out 24c02 The saved value is assigned to the alarm time
// Ds1302Init(); // Turn on when time needs to be set , By default, there is no need to set the time
while(1) // Cyclic reading And update the data display
{
Ds1302ReadTime(); // Read time
LcdDisplay(); // Display time
key_scan(); // Scan button
DHT11_5(); // Reading data
dis_str(12,0,"H:");dis_shu(14,0,warn_hour); // Display alarm time
dis_str(9,1,"S");dis_shu(10,1,DHT11[0]); // humidity
dis_str(13,1,"T");dis_shu(14,1,DHT11[2]); // temperature
warn(); // Call the police
}
}
See the comments section for links to all the information , Please leave a message if you have any questions ~
author :amusen
Time :2022.4
I wish good !
版权声明
本文为[Outside Jinguan City]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230613382659.html
边栏推荐
- Timing role in the project
- Use of Presto date function
- The El table horizontal scroll bar is fixed at the bottom of the visual window
- Luogu p3236 [hnoi2014] picture frame solution
- 风尚云网学习-h5的input:type属性的image属性
- Read the data in Presto through sparksql and save it to Clickhouse
- Packet capturing and sorting -- TCP protocol [8]
- If you were a golang interviewer, what questions would you ask?
- 21 天学习MongoDB笔记
- 1130 - host XXX is not allowed to connect to this MySQL server error in Navicat remote connection database
猜你喜欢

Softbank vision fund entered the Web3 security industry and led a new round of investment of US $60 million in certik

1130 - host XXX is not allowed to connect to this MySQL server error in Navicat remote connection database

Mysql8 installation

Homomorphic encryption technology learning
![[csnote] ER diagram](/img/97/82e8c2183fcafda50950a953ca0955.png)
[csnote] ER diagram

Customize classloader and implement hot deployment - use loadclass

Date time type in database

Introduction to servlet listener & filter

Introduction to kubernetes

Important knowledge of network layer (interview, reexamination, term end)
随机推荐
Introducing vant components on demand
安装nngraph
Deploying MySQL in cloud native kubesphere
Synchronously update the newly added and edited data to the list
Softbank vision fund entered the Web3 security industry and led a new round of investment of US $60 million in certik
世界读书日:我想推荐这几本书
SSM框架系列——注解开发day2-2
Common problems of unity (1)
Hanlp word splitter (via spark)
只是不断地建构平台,不断地收拢流量,并不能够做好产业互联网
Teach you to quickly develop a werewolf killing wechat applet (with source code)
mysql支持ip访问
Jupiter notebook installation
Record the problems encountered in using v-print
leetcode-791. Custom string sorting
three.js文字模糊问题
4.DRF 权限&访问频率&过滤&排序
MySQL —— 16、索引的数据结构
The El table horizontal scroll bar is fixed at the bottom of the visual window
Packet capturing and sorting -- TCP protocol [8]