当前位置:网站首页>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
边栏推荐
- Date time type in database
- Connect orcale
- 云原生KubeSphere部署Mysql
- Hanlp word splitter (via spark)
- Importerror after tensorflow installation: DLL load failed: the specified module cannot be found, and the domestic installation is slow
- 31. 下一个排列
- Deploying MySQL in cloud native kubesphere
- Remote access to raspberry pie at home (Part 1)
- Byte warehouse intern interview SQL questions
- Introducing vant components on demand
猜你喜欢

SSM框架系列——数据源配置day2-1

Date time type in database

数据库中的日期时间类型

No idle servers? Import OVF image to quickly experience smartx super fusion community version

在线计算过往日期天数,计算活了多少天

Kubernetes 入门教程

如何实现点击一下物体播放一次动画

云原生KubeSphere部署Redis

22. 括号生成

Customize the shortcut options in El date picker, and dynamically set the disabled date
随机推荐
Summary of JVM knowledge points - continuously updated
Object.keys后key值数组乱序的问题
Byte jump 2020 autumn recruitment programming question: quickly find your own ranking according to the job number
Translation of attention in natural language processing
No idle servers? Import OVF image to quickly experience smartx super fusion community version
Use compressorjs to compress pictures, optimize functions, and compress pictures in all formats
pyqt5 将opencv图片存入内置SQLlite数据库,并查询
Jiachen chapter Genesis "inner universe" joint Edition
World Book Day: I'd like to recommend these books
The El table horizontal scroll bar is fixed at the bottom of the visual window
梳理网络IP代理的几大用途
风尚云网学习-h5的input:type属性的image属性
Custom nail robot alarm
MySQL —— 16、索引的数据结构
8 websites that should be known for product development to enhance work experience
98. Error s.e.errormvcautoconfiguration $staticview reported by freemaker framework: cannot render error page for request
Go language mapping operation
Start mqbroker CMD failure resolution
CVPR 2022 & ntire 2022 | the first transformer for hyperspectral image reconstruction
Can I take the CPDA data analyst certificate for 0 foundation