描述
<div class="document">
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">注:* 为必填项</p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><strong><span style="color:#0093e6;">请在报名阶段填写 ↓</span></strong></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 1、项目功能介绍</h3>
<hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;"><span style="font-size:16px;"><strong>STM32终端控制器</strong>,</span>设计的初衷是做一款拥有蓝牙BLE与LORA传输功能的室内外传感控检测控制的产品。</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:14px;"><span style="color:#95a5a6;">该项目基于目前DIY爱好者经常使用的STM32F103C8T6型号,通过LORA或BLE,从而实现远程主控的实时显示。</span><span style="color:#95a5a6;">该系统最大特色在于拥有远程控制与后备电源系统。</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:14px;"><span style="color:#95a5a6;">部分代码已支持<strong><span style="font-size:16px;">国民技术</span></strong>N32G430C8L7方案芯片,详见底部说明。</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*2、项目属性</h3>
<hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">此项目完全原创,首次公开,代码、自制代码、PCB以及原理图完全开源,禁止资料倒卖否则后果自负。此项目前后历时2个月,PCB打样两版,遵循GPL3.0协议。</span><span style="color:#95a5a6;font-size:14px;">也请“嘉”人们多多支持开源,共同维护国内开源环境。</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 3、开源协议</h3>
<hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">GPL3.0开源协议<br>原理图、PCB、代码完全开源,但不允许个人制作出售以及倒卖资料,如需使用,请标明来源。<br>首先,感谢杜洋老师的“STM32入门30步”,详细的教程资料带我入门STM32CubeIDE,代码参考于此,希望大家致敬开源精神。其次,感谢立创开源平台中开源的各种工程,为我提供了创新的想法和理论支持。最后,感谢立创EDA提供此次难能宝贵的机会,也十分感激立创EDA为开源建设所付出的一切,相信在立创开源平台的带领下,国内开源环境会越来越好,我们一起加油!</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*4、硬件部分</h3>
<hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">•产品名:基于STM32物联网终端设备 <br>•主要功能: <br>1.可读出环境的温湿度值,在设置的温度时通过继电器打开/关闭用电器;<br>2.可通过手机蓝牙BLE连接设备,连接后显示温湿度值,亮度,电压值,连接状态,控制LED,系统重启、继电器开关等功能;<br>3.可通过LORA 模块扩频调制进行无线串口多机通讯(型号:A39C-T400A22D1A),实测极复杂传输距离最远可达 1000 米(官方宣传无遮挡5000米)。通过使用该模块的主从模式、自动中继、传输方式。实现超低功耗,可广泛应用于各种环境下,轻松实现低频无线数据传输。请注意:该项目在USART2使用<span style="color:#e67e23;">9600</span>波特率,其余均为<span style="color:#e67e23;">115200</span>;<br>4.在系统出现故障时蜂鸣器报警,并将报警事件上传用户,继电器异常自动断电;<br>5.从机包含HLK-5G人体传感器,可实时判断当前人员存在状态;<br>6.从机包含BH1750光照传感器,可准确、实时判断当前环境亮度;<br>7.从机包含0.96寸OLED屏幕,使得调试更加方便,数据更为直观;<br>8.从机包含CH340N串口芯片,可实现与PC端通信调试;<br>9.从机与接收机均使用充放电一体电路,检测到电池电量低于极限电压时,强制MCU进入待机状态降低功耗;<br>10.利用双路ADC检测,实现外置电源与电池供电检测。预留MQ-X传感器接口(当外置电源5V输入时正常工作);<br>11.接收机搭载1.44TFT显示屏幕,实时显示接收到的温湿度、光照、电压等数据。<br></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">V1.0版本照片:</p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/Zej8SIfCNLMIQcmq1xfXkUcGZjfWkm2UM6FnqCSw.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;">V1.1版本照片:</p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;">(1)从机-正面</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/PE10jfAlo5OJ3Ax9fm8hcgQAEX7i8RkEtKWi5lNJ.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;">(2)从机-背面</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/EJuMMQbcmlzDJb6TJTwPHc70K5s3vXUr5THEXuaK.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;">(3)从机-工作状态</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/EddiOWhSaox2S73gzIwlSZJDhsGuOevciexaxeJg.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;">(4)从机-工作状态</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/4sd9715gMu9StBtCxLyNpDRpz8HJXWumvCq896Yt.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;">(5)接收器-工作状态</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/FWD6o0z5gzLzOcT7u8UB5jwqWU0opi57hTyLbi1Y.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;">(6)主从机-工作状态</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/Hs2TJjObOfrMZWr6eVuAFAlpQwyQUT4G1cNd6lEj.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="font-size:14px;"><span style="color:#95a5a6;">国民技术N32G430C8L7方案芯片:</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="font-size:14px;"><span style="color:#95a5a6;">如您使用的是该系列芯片。<span style="color:#e03e2d;">请自行更改ADC部分的代码</span>,其余部分(蓝牙,串口,I2C,按键等)可不做修改,直接使用由CUBE IDE编辑器完成的代码</span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="font-size:14px;"><span style="color:#95a5a6;"><img src="//image.lceda.cn/pullimage/0lOLIC3MGyKAupbEM91Oo310Xpybg3o0xHyUcu1C.jpeg" alt="" width="1200" height="900"></span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;">最新完整版本已更新,详见附件,效果如下:<br></span></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"><span style="color:#95a5a6;"><span style="font-size:14px;"><img src="//image.lceda.cn/pullimage/s5180tnUGb0uTb0l8ur9QeVgt8bQqJA4jFIrheoC.jpeg" alt="" width="1200" height="900"></span></span></p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*5、软件部分</h3>
<hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">从机(传感器端)代码使用STM32CubeIDE 1.8.0编辑;接收端代码使用Keil5 MDK编辑。<br>STM32Cube端部分代码如下:</span></p>
<p><code>while (1)</code><br><code> {</code><br><code> HAL_NVIC_DisableIRQ(DMA1_Channel1_IRQn);//关DMA中断</code><br><code> DHT11_ReadData(DHT11_BUF);//读出DHT11传感器数据(参数是存放数据的数组指针)</code><br><code> HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);//开DMA中断</code><code></code><code></code></p>
<p><code> bh1750_lux = Get_BH1750_Value();</code><code></code><code></code></p>
<p><br><code> if(USART2_RX_STA&0x8000){//判断中断接收标志位(蓝牙模块BT,使用USART2)</code></p>
<p><code> if((USART2_RX_STA&0x7FFF) == 1) //判断接收数量1个(手机控制程序)</code><br><code> {</code><br><code> switch (USART2_RX_BUF[0]){//判断接收数据的内容</code><br><code> case 0x41:</code><br><code> RELAY_1(1);////继电器的控制程序(0继电器放开,1继电器吸合)</code><br><code> BT_printf("Relay ON");//返回数据内容,在手机APP上显示</code><br><code> break;</code><br><code> case 0x44:</code><br><code> RELAY_1(0);////继电器的控制程序(0继电器放开,1继电器吸合)</code><br><code> BT_printf("Relay OFF");//返回数据内容,在手机APP上显示</code><br><code> break;</code><br><code> case 0x42:</code><br><code> LED_2(1);//LED2控制</code><br><code> BT_printf("LED1 ON");//返回数据内容,在手机APP上显示</code><br><code> break;</code><br><code> case 0x45:</code><br><code> LED_2(0);//LED2控制</code><br><code> BT_printf("LED1 OFF");//返回数据内容,在手机APP上显示</code><br><code> break;</code><br><code> case 0x43:</code><br><code> BUZZER_SOLO1();//蜂鸣器输出单音的报警音</code><br><code> BT_printf("BEEP");//返回数据内容,在手机APP上显示</code><br><code> break;</code><br><code> case 0x46:</code><br><code> BT_printf("CPU Reset");//返回数据内容,在手机APP上显示</code><br><code> HAL_Delay(1000);//延时</code><br><code> NVIC_SystemReset();//系统软件复位函数</code><br><code> break;</code><br><code> default:</code><br><code> //冗余语句</code><br><code> break;</code><br><code> }</code><br><code> }</code><br><code> USART2_RX_STA=0;//标志位清0,准备下次接收</code><br><code> }</code></p>
<p><code> if(dmaadc[0]<3200){</code><br><code> BT_printf("进入停机状态!\n\r");</code><br><code> HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);</code><br><code> SystemClock_Config();</code><br><code> BT_printf("退出停机状态!\n\r");</code><br><code> }</code><code></code></p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*6、BOM清单</h3>
<hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">BOM参考原理图即可,与商城元件编号基本一致</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">下图分别为从机、接收机BOM表</span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/oXENDLfjHRJUaOx7aG2HGIXZcgKjJ7woCxtRQUc5.png" alt="" width="960" height="616"><img src="//image.lceda.cn/pullimage/jLC2I4sOGbo1N0kI7zlJfs3kR3yFLEHJFgED3QE7.png" alt="" width="960" height="364"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">如您对该项目使用的LORA模块有兴趣,请点击<span class="title" title="AS15-USB-T3串口模块转接板"><a href="/gbn2333/as15-usb-t3-chuan-kou-mu-kuai" target="_blank">AS15-USB-T3串口模块转接板</a>项目,内附有购买链接。</span></span></p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*7、大赛LOGO验证</h3>
<hr class="horizontal-splitline normal-bold-2"><p style="line-height:1.8;"> </p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/d5oK2bay0wuGF26FKo3quDPTcEbYLoKEXPsfWnsP.jpeg" alt="" width="1200" height="1200"></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p>
<h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 8、演示您的项目并录制成视频上传</h3>
<hr class="horizontal-splitline normal-bold-2"><p style="line-height:1.8;"> </p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;"><a href="https://www.bilibili.com/video/BV1PW4y1U7hx/" target="_blank">请点击:https://www.bilibili.com/video/BV1PW4y1U7hx/</a></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">蓝牙控制演示视频:<a href="https://www.bilibili.com/video/BV11N4y1V7FH/" target="_blank">https://www.bilibili.com/video/BV11N4y1V7FH/</a></span></p>
<p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p>
</div>
评论(47)