当前位置:网站首页>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
边栏推荐
- 1130 - host XXX is not allowed to connect to this MySQL server error in Navicat remote connection database
- STM32 project transplantation: transplantation between chip projects of different models: Ze to C8
- HQL find the maximum value in a range
- Try the server for one month for free, and attach the tutorial
- The accuracy and speed are perfectly balanced, and the latest image segmentation SOTA model is released!!!
- Timing role in the project
- Hanlp word splitter (via spark)
- Navicat远程连接数据库 出现 1130- Host xxx is not allowed to connect to this MySQL server错误
- leetcode:437. 路径总和 III【dfs 选还是不选?】
- JMeter operation redis
猜你喜欢
If you were a golang interviewer, what questions would you ask?
STM32 project transplantation: transplantation between chip projects of different models: Ze to C8
风尚云网学习-input属性总结
Kubernets Getting started tutoriel
拥抱机器视觉新蓝海,冀为好望开启数字经济发展新“冀”遇
NPDP | how can product managers not be excluded by programmers?
8 websites that should be known for product development to enhance work experience
ZigBee CC2530 minimum system and register configuration (1)
Introduction to kubernetes
leetcode:437. 路径总和 III【dfs 选还是不选?】
随机推荐
If you were a golang interviewer, what questions would you ask?
How to click an object to play an animation
5 free audio material websites, recommended collection
Customize the shortcut options in El date picker, and dynamically set the disabled date
Timing role in the project
内核错误: No rule to make target ‘debian/canonical-certs.pem‘, needed by ‘certs/x509_certificate_list‘
Unable to create servlet under SRC subfile of idea
Translation of attention in natural language processing
Sort out several uses of network IP agent
Importerror after tensorflow installation: DLL load failed: the specified module cannot be found, and the domestic installation is slow
At instruction of nbiot
PC starts multiple wechat at one time
Free and open source intelligent charging pile SaaS cloud platform of Internet of things
7_Addmodule和基因加和法add 得到的细胞类型打分在空间上空转对比
Remote sensing image classification and recognition system based on convolutional neural network
21 天学习MongoDB笔记
[daily question] chessboard question
将opencv 图片转换为字节的方式
Calculate the past date and days online, and calculate the number of live days
Object.keys后key值数组乱序的问题