stm32水质检测系统(TDS检测,水温检测,PH检测,wifi上传,上位机显示)

一、硬件材料清单:

1、STM32核心板

2、OLED显示屏

3、PH传感器

4、TDS传感器

5、DS18B02水温传感器

6、ESP8266

二、实现的功能

1、数据的实时检测

2、本地OLED数据实时刷新

3、远程终端上位机数据显示刷新

4、APP上位机数据显示

三、效果演示

stm32水质检测系统(TDS检测,水温检测,PH检测,wifi上传,上位机显示)_第1张图片    stm32水质检测系统(TDS检测,水温检测,PH检测,wifi上传,上位机显示)_第2张图片   stm32水质检测系统(TDS检测,水温检测,PH检测,wifi上传,上位机显示)_第3张图片

stm32水质检测系统(TDS检测,水温检测,PH检测,wifi上传,上位机显示)_第4张图片stm32水质检测系统(TDS检测,水温检测,PH检测,wifi上传,上位机显示)_第5张图片

stm32水质检测系统(TDS检测,水温检测,PH检测,wifi上传,上位机显示)_第6张图片

四、硬件部分源代码共享

 while(1)
	{
			delay_ms(1000); 
			temperature=DS18B20_Get_Temp();	
			if(temperature<0)
			{
				OLED_ShowString(40,40,"-",16);		//ÏÔʾ¸ººÅ		
				temperature=-temperature;					//תΪÕýÊý
			}
			else			
				OLED_ShowString(40,40," ",16);		//È¥µô¸ººÅ
			

			OLED_ShowNum(50,40,temperature/10,2,16);//ÏÔʾÕýÊý²¿·Ö	    
			OLED_ShowString(70,40,".",16);		//ÏÔʾСÊýµã
			OLED_ShowNum(80,40,temperature%10,1,16);//ÏÔʾСÊý²¿·Ö 	
			OLED_ShowString(90,40,"'C",16);		//ÏÔʾµ¥Î»
			OLED_Refresh();		
			
			msg[4]=temperature/10;
			msg[5]=temperature%10;	
			
	}

五、上位机部分源代码共享

string gate = msg.Substring(4, 2);
string node = msg.Substring(6, 2);
string temp = msg.Substring(8, 2);
string temp2 = msg.Substring(10, 2);
string tds = msg.Substring(12, 4);
string ph = msg.Substring(16, 2);

Int16 data_temp = 0, data_temp2 = 0, data_tds = 0, data_ph = 0;

data_temp = Convert.ToByte(temp, 16);
data_temp2 = Convert.ToByte(temp2, 16);
data_tds = Convert.ToInt16(tds, 16);
data_ph = Convert.ToInt16(ph, 16);


string tt = data_temp.ToString() + '.' + data_temp2.ToString();
Text_Temp.Invoke(showTemp, tt);
Text_Hum.Invoke(showHum, data_tds.ToString());
Text_Lux.Invoke(showLux, data_ph.ToString());

Write(DateTime.Now.ToString("yyyy-MM-dd"), nowtime + "+" + tt + "," + data_tds.ToString() + "," + data_ph.ToString() + "\r\n");

六、源代码链接

https://item.taobao.com/item.htm?spm=a2oq0.12575281.0.0.15d11deblBXfYB&ft=t&id=632361207620

你可能感兴趣的:(浩瀚物联,物联网,水质监测,传感器,stm32)