描述
<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>
<ul>
<li>温湿度测量仪项目使用STM32G030K6T6芯片作为主控芯片,Arm Cortex-M0+内核,最大主频64Mhz,具有32KB的Flash、8K的SRAM,供电电压在2.0V~3.6V。</li>
<li>使用IIC通信,采集来自sht40传感器的温湿度数据,通过数码管显示温湿度数据。</li>
<li>空闲时间进入低功耗睡眠模式,按键进入正常运行模式,运行结束自动进入低功耗睡眠模式,等待按键唤醒。</li>
<li>干电池供电采用两节5号电池。</li>
</ul>
<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;">首次公开。</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><em><strong>GPL 3.0 </strong></em></p>
<p> </p>
<ul>
<li>第三版GNU通用公共许可证,由自由软件基金会(FSF)发布。</li>
<li>只要在工程项目中使用了GPL协议下的产品,那么这个工程项目必须采用GPL协议,即为:开源和免费。</li>
</ul>
<p> <<代码的开源与免费使用和引用、修改、衍生代码的开源与免费使用,但不允许修改后和衍生的代码做为闭源的商业软件发布和销售。>></p>
<ul>
<li><em><strong>开源协议说明链接:</strong></em><a href="<a href="https://oshwhub.com/posts/3203787b8f8044748469e47caf39c5ef" target="_blank">https://oshwhub.com/posts/3203787b8f8044748469e47caf39c5ef</a>" target="_blank" rel="noopener">立创开源硬件平台公告【帮助文档】开源硬件平台开源协议说明</a></li>
</ul>
<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>
<ul>
<li><strong>STM32G030K6T6,复位NRST默认上拉,外接LSE时钟源32.768kHz</strong></li>
</ul>
<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;"><img src="<a href="https://image.lceda.cn/oshwhub/2954492da983411f837b2221c075a488.png" target="_blank">https://image.lceda.cn/oshwhub/2954492da983411f837b2221c075a488.png</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 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>5、软件部分</h3>
<h4><em><strong>STM32CubeMX配置工程代码</strong></em></h4>
<ul>
<li>具体配置请打开附件里的ioc文件进行查看。</li>
</ul>
<p><img src="<a href="https://image.lceda.cn/oshwhub/5b153942db5b4886b495eb1a2b6ca9e0.jpg" target="_blank">https://image.lceda.cn/oshwhub/5b153942db5b4886b495eb1a2b6ca9e0.jpg</a>" width="1100" height="570" /></p>
<p><img src="<a href="https://image.lceda.cn/oshwhub/75707b00e56842e8b505bf14338237e0.jpg" target="_blank">https://image.lceda.cn/oshwhub/75707b00e56842e8b505bf14338237e0.jpg</a>" width="1102" height="371" /></p>
<p> </p>
<h4><em><strong>MDK编</strong></em><em><strong>程</strong></em><em><strong>工程代码</strong></em></h4>
<ul>
<li><em><strong><<主程序>></strong></em></li>
</ul>
<p><img src="<a href="https://image.lceda.cn/oshwhub/f067c0fd51374dd390ad673a3b9e05eb.png" target="_blank">https://image.lceda.cn/oshwhub/f067c0fd51374dd390ad673a3b9e05eb.png</a>" width="1088" height="772" /></p>
<p><img src="<a href="https://image.lceda.cn/oshwhub/05528a83aa374e1e9e6f0adda5e9aed6.png" target="_blank">https://image.lceda.cn/oshwhub/05528a83aa374e1e9e6f0adda5e9aed6.png</a>" width="1089" height="357" /></p>
<p> </p>
<ul>
<li><strong><<部分数码管驱动代码>></strong></li>
</ul>
<p><img src="<a href="https://image.lceda.cn/oshwhub/8f336c043dc14fa88f0a0200c6be57bc.png" target="_blank">https://image.lceda.cn/oshwhub/8f336c043dc14fa88f0a0200c6be57bc.png</a>" width="1091" height="672" /></p>
<p> </p>
<ul>
<li><strong><<获取SHT40传感器温湿度数据>></strong></li>
</ul>
<p><img src="<a href="https://image.lceda.cn/oshwhub/6b73ff53199b4fd786d574a797bcf3f8.png" target="_blank">https://image.lceda.cn/oshwhub/6b73ff53199b4fd786d574a797bcf3f8.png</a>" width="1082" height="357" /></p>
<p> </p>
<ul>
<li><strong><<ADC采集电压>></strong></li>
<li><strong>volvalue = (adc_value</em>(3.03F-0.15F))<em>2/4095.0F</strong></li>
<li><strong>在前文看到的ADC采集电路,由两个等值电阻串联对锂电池于这部分的电压进行了分压,所以ADC采集的是总电压的一半,这里进行了</em>2</strong></li>
<li><strong>实测MCU的电压VDD/VDDA的电压:3.01V,至于减去的0.15算是误差吧(之前也试过一个HK芯片来ADC采集电压,精度到了小数点三位数,但是对现在的这个MCU进行ADC测试发现数据还存在较大误差,不知具体原因)</strong></li>
<li><strong>STM32G030的ADC分辨率为12位,所以4095 = 2<sup>12</sup>-1 ,表示:内部电压3V可以分割为4095份,每份占比0.000732伏特(V),代码里的公式其实就是一个比例对换。</strong></li>
<li>注意:这里所要采集的对象,电压不能超过VDD,否则测得的电源电压不准确,因为超过测量范围!</li>
</ul>
<p><img src="<a href="https://image.lceda.cn/oshwhub/e7988a89921e422f8ff4e063d89a7fbd.png" target="_blank">https://image.lceda.cn/oshwhub/e7988a89921e422f8ff4e063d89a7fbd.png</a>" width="1097" height="473" /></p>
<h3><img src="<a href="https://image.lceda.cn/oshwhub/82f8cb4ac8bf4444ac8bc0aea262b605.png" target="_blank">https://image.lceda.cn/oshwhub/82f8cb4ac8bf4444ac8bc0aea262b605.png</a>" width="1092" height="479" /></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;">*6、BOM清单</h3>
<hr class="horizontal-splitline normal-bold-2" />
<table border="2px" width="100%">
<tbody>
<tr>
<td width="67" height="28"><strong>编号</strong></td>
<td width="71"><strong>数量</strong></td>
<td width="223"><strong>备注</strong></td>
<td width="375"><strong>位号</strong></td>
<td width="473"><strong>封装</strong></td>
<td width="117"><strong>数值</strong></td>
<td width="175"><strong>立创商城编号</strong></td>
<td width="169"><strong>立创商城价格</strong></td>
<td width="278"><strong>Manufacturer</strong></td>
<td width="137"><strong>材料费用</strong></td>
</tr>
<tr>
<td height="28">1</td>
<td>9</td>
<td>100nF</td>
<td>C1,C2,C8,C10,C12,C13,C15,C17,C18</td>
<td>C0603</td>
<td>100nF</td>
<td>C14663</td>
<td>0.013981</td>
<td>YAGEO(国巨)</td>
<td>0.125829</td>
</tr>
<tr>
<td height="28">2</td>
<td>2</td>
<td>20pF</td>
<td>C3,C4</td>
<td>C0603</td>
<td>20pF</td>
<td>C105621</td>
<td>0.014605</td>
<td>YAGEO(国巨)</td>
<td>0.02921</td>
</tr>
<tr>
<td height="28">3</td>
<td>5</td>
<td>1uF</td>
<td>C5,C6,C7,C14,C16</td>
<td>C0603</td>
<td>1uF</td>
<td>C59302</td>
<td>0.030538</td>
<td>FH(风华)</td>
<td>0.15269</td>
</tr>
<tr>
<td height="28">4</td>
<td>2</td>
<td>10uF</td>
<td>C9,C11</td>
<td>C0603</td>
<td>10uF</td>
<td>C77044</td>
<td>0.067488</td>
<td>muRata(村田)</td>
<td>0.134976</td>
</tr>
<tr>
<td height="28">5</td>
<td>1</td>
<td>HC-XH-2AW-G</td>
<td>CN0</td>
<td>CONN-TH_2P-P2.50_HC-XH-2AW-G</td>
<td> </td>
<td>C5341208</td>
<td>0.107373</td>
<td>HCTL(华灿天禄)</td>
<td>0.107373</td>
</tr>
<tr>
<td height="28">6</td>
<td>2</td>
<td>MBR120LSF</td>
<td>D1,D2</td>
<td>SOD-123_L2.8-W1.8-LS3.7-RD</td>
<td> </td>
<td>C130880</td>
<td>0.2192</td>
<td>SHIKUES(时科)</td>
<td>0.4384</td>
</tr>
<tr>
<td height="28">7</td>
<td>1</td>
<td>BSMD0805-050-6V</td>
<td>F1</td>
<td>F0805</td>
<td> </td>
<td>C883108</td>
<td>0.276183</td>
<td>BHFUSE(佰宏)</td>
<td>0.276183</td>
</tr>
<tr>
<td height="28">8</td>
<td>1</td>
<td>CBG160808U000T</td>
<td>L1</td>
<td>L0603</td>
<td> </td>
<td>C43163</td>
<td>0.024165</td>
<td>FH(风华)</td>
<td>0.024165</td>
</tr>
<tr>
<td height="28">9</td>
<td>2</td>
<td>SP420281N</td>
<td>LED1,LED2</td>
<td>LED-SEG-TH_SP420281N</td>
<td> </td>
<td>C122944</td>
<td>2.1663</td>
<td>ARKLED(方舟)</td>
<td>4.3326</td>
</tr>
<tr>
<td height="28">10</td>
<td>2</td>
<td>XL-1608UBC-04</td>
<td>LED3,LED4</td>
<td>LED0603-RD_BLUE</td>
<td> </td>
<td>C965807</td>
<td>0.02253</td>
<td>XINGLIGHT(成兴光)</td>
<td>0.04506</td>
</tr>
<tr>
<td height="28">11</td>
<td>1</td>
<td>SZYY0603R</td>
<td>LED5</td>
<td>LED0603-R-RD</td>
<td> </td>
<td>C434419</td>
<td>0.041609</td>
<td>yongyu(永裕光电)</td>
<td>0.041609</td>
</tr>
<tr>
<td height="28">12</td>
<td>1</td>
<td>XL-1608PGC-06</td>
<td>LED6</td>
<td>LED0603-RD_GREEN</td>
<td> </td>
<td>C7371905</td>
<td>0.0586</td>
<td>XINGLIGHT(成兴光)</td>
<td>0.0586</td>
</tr>
<tr>
<td height="28">13</td>
<td>4</td>
<td>M2</td>
<td>P1,P2,P3,P4</td>
<td>M2</td>
<td> </td>
<td> </td>
<td>0</td>
<td> </td>
<td>0</td>
</tr>
<tr>
<td height="28">14</td>
<td>3</td>
<td>10kΩ</td>
<td>R1,R8,R13</td>
<td>R0603</td>
<td>10kΩ</td>
<td>C25804</td>
<td>0.005579</td>
<td>UNI-ROYAL(厚声)</td>
<td>0.016737</td>
</tr>
<tr>
<td height="28">15</td>
<td>6</td>
<td>4.7kΩ</td>
<td>R2,R3,R4,R5,R6,R7</td>
<td>R0603</td>
<td>4.7kΩ</td>
<td>C23162</td>
<td>0.006472</td>
<td>UNI-ROYAL(厚声)</td>
<td>0.038832</td>
</tr>
<tr>
<td height="28">16</td>
<td>2</td>
<td>5.1kΩ</td>
<td>R9,R10</td>
<td>R0603</td>
<td>5.1kΩ</td>
<td>C23186</td>
<td>0.006186</td>
<td>UNI-ROYAL(厚声)</td>
<td>0.012372</td>
</tr>
<tr>
<td height="28">17</td>
<td>1</td>
<td>2.4kΩ</td>
<td>R11</td>
<td>R0603</td>
<td>2.4kΩ</td>
<td>C22940</td>
<td>0.006003</td>
<td>UNI-ROYAL(厚声)</td>
<td>0.006003</td>
</tr>
<tr>
<td height="28">18</td>
<td>1</td>
<td>250mΩ</td>
<td>R12</td>
<td>R0603</td>
<td>250mΩ</td>
<td>C422951</td>
<td>0.022713</td>
<td>UNI-ROYAL(厚声)</td>
<td>0.022713</td>
</tr>
<tr>
<td height="28">19</td>
<td>1</td>
<td>22kΩ</td>
<td>R14</td>
<td>R0603</td>
<td>22kΩ</td>
<td>C31850</td>
<td>0.006147</td>
<td>UNI-ROYAL(厚声)</td>
<td>0.006147</td>
</tr>
<tr>
<td height="28">20</td>
<td>1</td>
<td>GT-TC054A-H035-L1</td>
<td>SW1</td>
<td>SW-SMD_L7.8-W3.5-P4.20-EH</td>
<td> </td>
<td>C778158</td>
<td>0.24573</td>
<td>G-Switch(品赞)</td>
<td>0.24573</td>
</tr>
<tr>
<td height="28">21</td>
<td>1</td>
<td>SK12D07VG3</td>
<td>SW2</td>
<td>SW-TH_SK12D07VG3</td>
<td> </td>
<td>C431547</td>
<td>0.130586</td>
<td>SHOU HAN(首韩)</td>
<td>0.130586</td>
</tr>
<tr>
<td height="28">22</td>
<td>2</td>
<td>Test-Point</td>
<td>SWCLK,SWDIO</td>
<td>Test-Point-0.5mm</td>
<td> </td>
<td> </td>
<td>0</td>
<td> </td>
<td>0</td>
</tr>
<tr>
<td height="28">23</td>
<td>1</td>
<td>STM32G030K6T6</td>
<td>U1</td>
<td>LQFP-32_L7.0-W7.0-P0.80-LS9.0-BL</td>
<td> </td>
<td>C529331</td>
<td>4.7</td>
<td>ST(意法半导体)</td>
<td>4.7</td>
</tr>
<tr>
<td height="28">24</td>
<td>3</td>
<td>SN74HC595PWR</td>
<td>U2,U3,U4</td>
<td>TSSOP-16_L5.0-W4.4-P0.65-LS6.4-BL</td>
<td> </td>
<td>C273642</td>
<td>1.2759</td>
<td>TI(德州仪器)</td>
<td>3.8277</td>
</tr>
<tr>
<td height="28">25</td>
<td>1</td>
<td>GT-USB-7002C</td>
<td>U5</td>
<td>USB-C-SMD_GT-USB-7002C</td>
<td> </td>
<td>C5117884</td>
<td>0.417367</td>
<td>G-Switch(品赞)</td>
<td>0.417367</td>
</tr>
<tr>
<td height="28">26</td>
<td>1</td>
<td>TC4056A</td>
<td>U6</td>
<td>ESOP-8_L4.9-W3.9-P1.27-LS6.0-BR-EP3.3</td>
<td> </td>
<td>C84051</td>
<td>0.312037</td>
<td>FM(富满)</td>
<td>0.312037</td>
</tr>
<tr>
<td height="28">27</td>
<td>1</td>
<td>AO3401-ED</td>
<td>U7</td>
<td>SOT-23-3_L2.9-W1.3-P0.95-LS2.4-BR</td>
<td> </td>
<td>C4748724</td>
<td>0.112913</td>
<td>HXY MOSFET(华轩阳电子)</td>
<td>0.112913</td>
</tr>
<tr>
<td height="28">28</td>
<td>1</td>
<td>SHT40-AD1B-R2</td>
<td>U9</td>
<td>DFN-4_L1.5-W1.5-P0.8-TL-EP</td>
<td> </td>
<td>C2909890</td>
<td>11.51</td>
<td>Sensirion(瑞士盛思锐)</td>
<td>11.51</td>
</tr>
<tr>
<td height="28">29</td>
<td>1</td>
<td>JSM6206A3.0XG</td>
<td>U10</td>
<td>SOT-23-3_L2.9-W1.6-P1.90-LS2.8-BR</td>
<td> </td>
<td>C2845116</td>
<td>0.191449</td>
<td>JSMSEMI(杰盛微)</td>
<td>0.191449</td>
</tr>
<tr>
<td height="30">30</td>
<td>1</td>
<td>32.768kHz</td>
<td>X1</td>
<td>OSC-SMD_L3.2-W1.5</td>
<td>32.768kHz</td>
<td>C390740</td>
<td>1.2448</td>
<td>JGHC(晶光华)</td>
<td>1.2448</td>
</tr>
<tr>
<td height="120"><strong>总数:</strong></td>
<td><strong>61</strong></td>
<td><strong>总价:</strong></td>
<td><strong>28.562081(不含锂电池)</strong></td>
<td width="473"><strong>MCU、sht40可以在某宝上采购,一个不到3.00元,3个数码管在某宝上也不到1.5元</strong></td>
<td width="117"> </td>
<td width="175"><strong>如果不算MCU、数码管、sht40,那么得到:7.469403</strong></td>
<td width="169"><strong>7.469403+3+1.5=11.969403</strong></td>
<td width="278"><strong>有些元件还可以再节省些,预估(不含锂电池)总价至少小于12元</strong></td>
<td width="137"> </td>
</tr>
</tbody>
</table>
<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;">*7、大赛LOGO验证</h3>
<hr class="horizontal-splitline normal-bold-2" />
<p style="line-height: 1.8;"><img src="//image.lceda.cn/oshwhub/ea31469bbfde432091c08ae19eab6274.jpg" /></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></p>
评论(0)