085、STM32项目分享开源:智能饮水机控制系统
目录一、项目成品图片二、项目功能简介1.主要器件组成2.功能详解介绍三、项目原理图设计四、项目PCB硬件设计项目PCB图五、项目程序设计六、项目实验效果 编辑七、项目包含内容一、项目成品图片哔哩哔哩视频链接https://www.bilibili.com/video/BV15Zjy6FE3x/?spm_id_from333.1387.upload.video_card.click资料分享看文章末尾二、项目功能简介1.主要器件组成本设计由STM32F103C8T6单片机WIFI模块ESP8266-01S电路OLED屏幕电路DS18B20温度传感器电路TDS电导率传感器电路水位传感器电路加热电路继电器模块电路蜂鸣器电路按键电路电源电路。2.功能详解1、环境采集DS18B20温度传感器采集饮水机温度、TDS电导率传感器电路检测饮水机TDS电导率是否正常、水位传感器检测饮水机水位等。2、屏幕显示OLED显示模块用于在设备本地实时、直观地呈现饮水机的全部运行状态与关键参数能够显示当前水温、设定温度、水位状态、TDS数值、系统工作模式如加热/保温等信息。清晰的界面帮助用户直接了解设备状况并进行本地设置。3、阈值设置通过按键和app设置加热、保温、缺水、水满和TDS阈值4、TDS报警TDS用于评估水质纯净度并在数值超标时声光报警5、恒温控制保温模式下当检测到温度低于设置的保温阈值时自动加热到保温值进行恒温6、加热控制加热模式下自动加热到指定温度7、缺水报警当检测到水位过低时声光报警提醒水位过低8、水满提示当检测到水位过高时声光报警提醒水满9、干烧断电实现缺水自动停止加热10、远程控制通过WIFI连接手机APPAPP可以查看当前环境信息数据可调节阈值范围三、项目原理图设计四、项目PCB硬件设计五、项目程序设计#include stm32f10x.h #include usart.h #include USART2/usart2.h #include DS18B20/ds18b20.h #include timer.h #include adc.h #include menu.h #include key.h #include modules.h #include hzd.h #include beep.h #include tds.h #include relay.h #include ph.h #include water.h #include oled.h #include pid.h /****************破晓电子工作室******************* *** 破晓单片机 *** 项目:STM32饮水机控制系统 *** BILIBILI:破晓单片机 *** 小红书:破晓单片机 *** 授权IP:破晓单片机 *** 淘宝:破晓单片机 *** 淘宝:破晓电子 *** 版本:V01.01 *** MCU:STM32F103C8T6 ******************破晓单片机***********************/ //显示界面 CaiDanJieGouTi KeyTab[SIZE_CAIDAN] { {0 ,0 ,0 ,0 ,0 ,Main_Menu0}, {1 ,1 ,1 ,1 ,1 ,Main_Menu1}, {2 ,2 ,2 ,2 ,2 ,Main_Menu2}, {3 ,3 ,3 ,3 ,3 ,Main_Menu3}, {4 ,4 ,4 ,4 ,4 ,Main_Menu4}, {5 ,5 ,5 ,5 ,5 ,Main_Menu5}, {6 ,6 ,6 ,6 ,6 ,Main_Menu6}, {7 ,7 ,7 ,7 ,7 ,Main_Menu7}, {8 ,8 ,8 ,8 ,8 ,Main_Menu8}, } ; //传感器变量声明 typedef struct { uint16_t tempds;// uint16_t tds;// uint16_t water; }SensorModulesValue; typedef struct { uint8_t tempdsbw; uint8_t tempdsjr; uint16_t waterTV; uint16_t watermax; uint16_t tdsTV; }SensorThresholdValue; typedef struct { uint8_t modeFlag; uint8_t RELAYFlag; uint8_t BEEPFlag; uint8_t BJ1Flag; uint8_t BJ2Flag; }DriveFlag; int main(void) { delay_init(); TIM3_Int_Init(9,7199);//定时器初始化 OLEDGUI_Config(); //OLED OLEDGUI_DispString(30,16,Init...,16,1); key_Init();//按键初始化 Adc_Init();//Adc初始化 beep_Init();//beep初始化 WATER_Init();//WATER初始化 tds_Init();//tds初始化 DS18B20_Init();//DS18B20初始化 relay_Init();//relay初始化 SensorThresholdSet();//阈值初始化 uart1_init(9600); delay_ms(100); uart2_init(9600); delay_ms(100); memset((uint8_t *)currentDataPoint, 0, sizeof(dataPoint_t)); gizwitsInit(); OLEDGUI_Clear(); //OLED清屏 while(1) { //获取按键值 key_scan(); //进入菜单界面显示处理数据 GetKeylnput(Keystatus); //获取传感器数据 SensorDataGet(); //数据上传 currentDataPoint.valuetempdsSensorData.tempds/10; currentDataPoint.valuewaterSensorData.water; currentDataPoint.valuetdsSensorData.tds; currentDataPoint.valuemodeFlag!DriveFlagData.modeFlag; currentDataPoint.valuemodeFlag1DriveFlagData.modeFlag; gizwitsHandle((dataPoint_t *)currentDataPoint); //数据下发 Sensorthreshold.tempdsbwcurrentDataPoint.valuetempdsbw; Sensorthreshold.tempdsjrcurrentDataPoint.valuetempdsjr; Sensorthreshold.waterTVcurrentDataPoint.valuewaterTV; Sensorthreshold.watermaxcurrentDataPoint.valuewatermax; Sensorthreshold.tdsTVcurrentDataPoint.valuetdsTV; delay_ms(100); } }六、项目实验效果 七、项目包含内容