252【Complete Course Design】Design of Watering System Based on 51 Single Chip Computer

[Resource Download] The download address is as follows:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl

51 Watering System Design-DHT11-Water Pump-BELL-Fan-LCD1602

This design consists of STC89C52 single-chip circuit + DHT11 temperature and humidity sensor + water pump control circuit + buzzer alarm circuit + fan control circuit + LCD1602 liquid crystal display circuit + power supply circuit.

1. When the humidity is lower than the lower limit, turn on the water pump for automatic irrigation and alarm at the same time. When the humidity is higher than the upper limit, automatically turn off the pump to stop irrigation. (The upper and lower limits of humidity are determined by Tongwang Technology)

2. When the temperature is higher than the upper limit, the fan will be turned on to ventilate and cool at the same time. When the temperature is lower than the lower limit, the fan will be automatically turned off. (The upper and lower limits of temperature are determined by Tongwang Technology)

3. LCD1602 displays real-time temperature, humidity and temperature and humidity thresholds.

5. The temperature is below 30℃, LCD display: Cold. The temperature is above 30℃, LCD display: Hot


void main (void)
{

	Init_Timer0();        //定时器0初始化
	
	UART_Init();

	LCD_Init();           //初始化液晶
	DelayMs(20);          //延时有助于稳定
	LCD_Clear();          //清屏

	DelayMs(120);
	SendStr("ready ok!",9);

	while(1)         //主循环
	{
		if(read_dht21==1)
		{
			read_dht21=0;
			ET0 =0;	 //关闭定时器中断
		   	RH();	 //读取模块数据周期不易小于 2S 
			ET0 =1;	 //开定时器中断
			sprintf(dis0,"T:%02d'C H:%02d%% ",(int)U8T_data_H,(int)U8RH_data_H);
			LCD_Write_String(0,0,dis0);//显示时间及温度

 

Guess you like

Origin blog.csdn.net/theroadon/article/details/109261071