描述
<p><div class="document">
<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;"><em> 1、项目功能介绍</h3>
<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;"><span style="color: #000000;"><span style="font-size: 14px;">此温湿度仪才采用STM32G030K6T6主控芯片,盛思锐SHT40</span><span style="font-size: 14px;">温湿度传感器提供精确的温湿度数值,IP5306电池管理芯片和1节18605锂电池提供电源输出,2个共阴极3位数码管分别提供温湿度数值显示。</span></span></h3>
<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;"> </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;"></em>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: #000000; 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>
<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;"><em> 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: #000000; font-size: 14px;">GPL3.0</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;"></em>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: #000000; font-size: 14px;">1、原理机制</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: #000000;"><span style="font-size: 14px;"> </span><span style="font-size: 14px;">盛思锐SHT40</span><span style="font-size: 14px;">温湿度传感器提供精确的温湿度数值,然后通过STM32G030K6T6主控芯片输出在2个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" style="line-height: 1.8;"><span style="color: #000000; font-size: 14px;"> 由于3位的数码管有11个管脚,2个数码管就有22个管脚,不可能所有的引脚都连接到STM32G030K6T6上,于是本项目用到了3个74HC595移位寄存器。分别控制数码管1的A-H段状态、数码管2的A-H段状态、数码管1、2中每一位的选择。移位寄存器可以只用3个引脚来控制8个引脚的电平状态。</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/oshwhub/c040bdaf6d8840ca878964081a450128.png" alt="移位寄存器" width="1128" height="309" /></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;"> 本项目用1节18650电池作为电源输出,用IP5306芯片提供锂电池的充电和5v的输出。ip5306空载时,自动进入休眠状态。<span style="color: #000000; font-size: 14px;">STM32G030K6T6和SHT40传感器、数码管用电量很小,ip5306可以判定为空载。省去了单片机休眠的代码。</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/oshwhub/8ce60145cd4c44be9c8b6d00dbec4dd9.png" alt="充电电路" width="807" height="463" /></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;"> 同时,18650的电池盒还可以充当温湿度仪的支架</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/oshwhub/50a69854631f426481f7a0bd60edc7b4.png" alt="底座" /></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;">2、调试的方法及注意事项</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;">板子引出了SWCLK和SWDIO接口,烧录器用的创新工坊PowerWriter PWLINK2。keil设置和st_lik有所以不同,烧录时需注意。</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/oshwhub/06275a9992984e38beeccae12cc2abb2.png" /></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;">调试的时候,我是一边焊板子一边调试。先把单片机和调试用led焊好,烧录代码点灯。点灯没问题,说明单片机工作正常,烧录器工作正常。然后焊接按键,测试按键点灯。然后把74HC595和数码管焊接好,测试数码管。测试数码管的时候我遇到了数码管显示不全的问题,经过分析有可能是控制相应数码管的74HC595芯片的问题。在更换了新的74HC595芯片后问题解决,数码管可以正常显示。其实就是芯片引脚焊接问题。安装传感器后测试传感器I2C代码。最后焊接线路板背面的IP5306和18650电池盒。</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;">还有个烧录时候应该注意的事项,在烧录单片机的休眠代码后,很短的时间就会进入休眠状态。导致烧录其他代码的时候无法找到芯片,无法烧录。可以按键激活单片机然后快速烧录,也可以擦除芯片,然后在烧录。我用的是PowerWriter擦除的芯片然后重新烧录的程序。</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;"><em>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: #000000; font-size: 14px;">代码用的基本上就是训练营的代码 ,跟着项目文档一步一步来操作还是很简单的。理解74HC595的原理</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/oshwhub/305cf33c0d194e8c9701bb3c8f3d4407.png" /></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;">根据SHT40的数据手册 ,编写温湿度模块的驱动</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/oshwhub/f2d4df7a05474089923af8a8e1d4686d.png" /></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;">因为我利用IP5306的空载时,自动进入休眠状态,所以生省略了单片机的休眠代码以及中断代码。</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 pap-left-indent-1.6em" 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;"></em>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: #000000; font-size: 14px;">项目中的电容、电阻、LED灯大部分采用0603封装,铁板烧加风枪焊接还不算太难。中途更换74HC595芯片的时候有点费劲,焊脚有点连锡,用吸锡带吸干净就好。眼神不好的需要准备个放大镜。</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;">在立场商城下单的时候忘了1.27mm弯插母座,从淘宝单独买的。<a href="<a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.4ec52e8dUIIkd3&amp;id=694593558241&amp;_u=21rfcsn7655%22>1.27MM%E5%8D%95%E6%8E%92%E5%BC%AF%E6%8E%92%E6%AF%8D%E8%BF%9E%E6%8E%A5%E5%99%A890%E5%BA%A6%E6%8F%92%E5%BA%A7%E5%8D%A7%E5%BC%8F%E6%AF%8D%E5%BA%A71x2/3/4/6/10-40P/1*50P-%E6%B7%98%E5%AE%9D%E7%BD%91" target="_blank">https://item.taobao.com/item.htm?spm=a1z09.2.0.0.4ec52e8dUIIkd3&amp;id=694593558241&amp;_u=21rfcsn7655">1.27MM单排弯排母连接器90度插座卧式母座1x2/3/4/6/10-40P/1*50P-淘宝网</a> (taobao.com)</a></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/oshwhub/dfa5e9d2e32c4efe88197305a37d1f0b.png" /></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;"><em>7、大赛LOGO验证</h3>
<hr class="horizontal-splitline normal-bold-2" />
<p style="line-height: 1.8;"><img src="//image.lceda.cn/oshwhub/1d1e0b66443847b9931b4c766f8a6277.png" /></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/oshwhub/7404d777faa44ae8ab2526213164564f.png" /></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/oshwhub/eb004e56ad954b5d884919793a73aacc.png" /></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;">放在桌面上当个小摆件还挺好看的。</h3>
<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;"></em> 8、演示您的项目并录制成视频上传</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;"> </p>
</div></p>
评论(0)