描述
<div>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">* 1、项目功能介绍</h3>
<hr>
<p>本项目基于嘉立创桌面温湿度仪项目,将主控改为esp12f,温湿度传感器使用sht40,使用su-03t离线语音模块接入esp进行串口通信。3位数码管改为4位数码管,数码控制芯片使用tm1637,第一个数码管显示时间,第二个数码管交替显示温度和湿度。电源供电使用usb供电,加入触摸感应开关,刷入esphome,并接入homeassistant,实现复杂智能控制。</p>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">*2、项目属性</h3>
<hr>
<p style="line-height:1.8"><span style="color:#000000">本项目首次公开;项目是为原创;未曾在其他比赛中获奖</span></p>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">* 3、开源协议</h3>
<hr>
<p style="line-height:1.8"><span style="color:#000000"><span style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-size:medium;background-color:#ffffff">本项目使用</span><span style="line-height:1.4;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-size:medium;background-color:#ffffff">CC-BY-NC-SA 3.0</span><span style="font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-size:medium;background-color:#ffffff">开源协议,即</span><span style="line-height:1.4;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-size:medium;background-color:#ffffff">知识共享许可协议-署名-非商业使用-相同方式共享。</span></span></p>
<p style="line-height:1.8"> </p>
<p style="line-height:1.8"><strong><span style="color:#0093e6">请在竞赛阶段填写 ↓</span></strong></p>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">*4、硬件部分</h3>
<hr>
<p style="line-height:1.8"><img src="//image.lceda.cn/pullimage/8JgSGUwP76JCZgebiwSUG1EZVaiVeGlEW2YKz3IU.png" alt="" width="830" height="577"></p>
<p style="line-height:1.8">将主控为esp12f</p>
<p style="line-height:1.8">温湿度传感器使用sht40</p>
<p style="line-height:1.8">两个4位共阳极数码管,数码控制芯片使用tm1637,第一个数码管显示时间,第二个数码管交替显示温度和湿度</p>
<p style="line-height:1.8">离线语音模块使用SU-03T</p>
<p style="line-height:1.8">电源供电使用usb供电,AMS1117进行降压</p>
<p style="line-height:1.8"> </p>
<p style="line-height:1.8"><span style="color:#95a5a6;font-size:14px"> 注:请前往<span style="text-decoration:underline"><a href="https://lceda.cn/editor" target="_blank">嘉立创EDA</a> </span>生成/上传设计文件,文件完成后,相关文稿将自动生成至项目详情;这里可以详细说明您的项目实现原理和机制、注意事项、调试方法、测试方法等。推荐图文并茂的形式向别人介绍您的想法。 </span></p>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">*5、软件部分</h3>
<hr>
<p style="line-height:1.8"><code><span style="background-color:#fffffe;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace, Consolas, 'Courier New', monospace;white-space:pre;color:#000099">esphome</span><span style="background-color:#fffffe;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace, Consolas, 'Courier New', monospace;white-space:pre">:</span></code></p>
<div style="background-color:#fffffe;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace, Consolas, 'Courier New', monospace;line-height:19px;white-space:pre">
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">test</span></code></div>
<div><code> <span style="color:#000099">includes</span>:</code></div>
<div><code> - <span style="color:#0451a5">su03t_uart_read.h</span></code></div>
<br>
<div><code><span style="color:#000099">esp8266</span>:</code></div>
<div><code> <span style="color:#000099">board</span>: <span style="color:#0451a5">d1_mini</span></code></div>
<br>
<div><code><span style="color:#008000"># Enable logging</span></code></div>
<div><code><span style="color:#000099">logger</span>:</code></div>
<br>
<div><code><span style="color:#008000"># Enable Home Assistant API</span></code></div>
<div><code><span style="color:#000099">api</span>:</code></div>
<br>
<div><code><span style="color:#000099">ota</span>:</code></div>
<div><code> <span style="color:#000099">password</span>: <span style="color:#0451a5">"xxxxxxxxxx"</span></code></div>
<br>
<div><code><span style="color:#000099">wifi</span>:</code></div>
<div><code> <span style="color:#000099">ssid</span>: <span style="color:#0451a5">"xxxxxxx"</span></code></div>
<div><code> <span style="color:#000099">password</span>: <span style="color:#0451a5">"xxxxxxx"</span></code></div>
<br>
<div><code> <span style="color:#008000"># Enable fallback hotspot (captive portal) in case wifi connection fails</span></code></div>
<div><code> <span style="color:#000099">ap</span>:</code></div>
<div><code> <span style="color:#000099">ssid</span>: <span style="color:#0451a5">"xxxxxx"</span></code></div>
<div><code> <span style="color:#000099">password</span>: <span style="color:#0451a5">"xxxxxx"</span></code></div>
<br>
<div><code><span style="color:#000099">captive_portal</span>:</code></div>
<div> </div>
<div><code><span style="color:#000099">i2c</span>:</code></div>
<div><code> <span style="color:#000099">sda</span>: <span style="color:#0451a5">GPIO5 </span><span style="color:#008000">#D1 io5</span></code></div>
<div><code> <span style="color:#000099">scl</span>: <span style="color:#0451a5">GPIO4 </span><span style="color:#008000">#D2 io4</span></code></div>
<div><code> <span style="color:#000099">scan</span>: <span style="color:#0000ff">true</span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">bus_a</span></code></div>
<br><br><br>
<div><code><span style="color:#000099">time</span>: </code></div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">homeassistant </span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">homeassistant_time </span></code></div>
<div> </div>
<div><code><span style="color:#000099">sensor</span>: </code></div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">sht4x</span></code></div>
<div><code> <span style="color:#000099">temperature</span>:</code></div>
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">"Temperature"</span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">temperature</span></code></div>
<div><code> <span style="color:#000099">humidity</span>:</code></div>
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">"Humidity"</span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">humidity</span></code></div>
<div><code> <span style="color:#000099">address</span>: <span style="color:#3030c0">0x44</span></code></div>
<div><code> </code></div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">homeassistant </span></code></div>
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">"Keting_Temperature"</span> </code></div>
<div><code> <span style="color:#000099">entity_id</span>: <span style="color:#0451a5">sensor.miaomiaoce_t2_b84f_temperature_humidity_sensor </span></code></div>
<div><code> <span style="color:#000099">internal</span>: <span style="color:#0451a5">false </span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">keting_temperature </span></code></div>
<br>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">homeassistant </span></code></div>
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">"Keting_humidity"</span> </code></div>
<div><code> <span style="color:#000099">entity_id</span>: <span style="color:#0451a5">sensor.miaomiaoce_t2_b84f_relative_humidity </span></code></div>
<div><code> <span style="color:#000099">internal</span>: <span style="color:#0451a5">false </span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">Keting_humidity </span></code></div>
<br><br>
<div><code><span style="color:#000099">display</span>: </code></div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">tm1637 </span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">tm1637_time</span></code></div>
<div><code> <span style="color:#000099">clk_pin</span>: <span style="color:#0451a5">GPIO14 </span><span style="color:#008000">#D5 io14</span></code></div>
<div><code> <span style="color:#000099">dio_pin</span>: <span style="color:#0451a5">GPIO12 </span><span style="color:#008000">#D6 io12</span></code></div>
<div><code> <span style="color:#000099">update_interval</span>: <span style="color:#0451a5">500ms</span></code></div>
<div><code> <span style="color:#000099">lambda</span>: |-</code></div>
<div><code><span style="color:#0451a5"> static int i = 0;</span></code></div>
<div><code><span style="color:#0451a5"> i++;</span></code></div>
<div><code><span style="color:#0451a5"> if ((i % 2) == 0)</span></code></div>
<div><code> <span style="color:#0451a5">it.strftime("%H.%M", id(homeassistant_time).now());</span></code></div>
<div><code> <span style="color:#0451a5">else</span></code></div>
<div><code> <span style="color:#0451a5">it.strftime("%H%M", id(homeassistant_time).now());</span></code></div>
<div><code> </code></div>
<br>
<div> </div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">tm1637 </span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">tm1637_tem_hum</span></code></div>
<div><code> <span style="color:#000099">clk_pin</span>: <span style="color:#0451a5">GPIO12 </span><span style="color:#008000">#D6 io12</span></code></div>
<div><code> <span style="color:#000099">dio_pin</span>: <span style="color:#0451a5">GPIO14 </span><span style="color:#008000">#D5 io14</span></code></div>
<div><code> <span style="color:#000099">inverted</span>: <span style="color:#0000ff">false</span></code></div>
<div><code> <span style="color:#000099">update_interval</span>: <span style="color:#0451a5">5s </span></code></div>
<div><code> <span style="color:#000099">lambda</span>: |-</code></div>
<div><code><span style="color:#0451a5"> static bool show_tem = true; // true for temperature, false for hum </span></code></div>
<div> </div>
<div><code> <span style="color:#0451a5">// Toggle between showing tem and hum </span></code></div>
<div><code> <span style="color:#0451a5">show_tem = !show_tem; </span></code></div>
<div> </div>
<div><code> <span style="color:#0451a5">// Decide what to display based on show_tem </span></code></div>
<div><code> <span style="color:#0451a5">if (show_tem) { </span></code></div>
<div><code> <span style="color:#0451a5">// Display temperature</span></code></div>
<div><code> <span style="color:#0451a5">it.printf(0, "%.1f", id(keting_temperature).state);</span></code></div>
<div><code> <span style="color:#0451a5">//it.print(3, "0")</span></code></div>
<div><code> <span style="color:#0451a5">} else { </span></code></div>
<div><code> <span style="color:#0451a5">it.printf(0, "%.1f", id(Keting_humidity).state);</span></code></div>
<div><code> <span style="color:#0451a5">}</span></code></div>
<br><br>
<div><code><span style="color:#000099">uart</span>:</code></div>
<div><code> - <span style="color:#000099">id</span>: <span style="color:#0451a5">uart_bus</span></code></div>
<div><code> <span style="color:#000099">rx_pin</span>: <span style="color:#0451a5">GPIO13 </span><span style="color:#008000"># Modify according to your wiring, e.g., D6</span></code></div>
<div><code> <span style="color:#000099">baud_rate</span>: <span style="color:#098658">9600</span></code></div>
<br>
<div><code><span style="color:#000099">text_sensor</span>:</code></div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">custom</span></code></div>
<div><code> <span style="color:#000099">lambda</span>: |-</code></div>
<div><code><span style="color:#0451a5"> auto my_custom_sensor = new UartReadLineSensor(id(uart_bus));</span></code></div>
<div><code><span style="color:#0451a5"> App.register_component(my_custom_sensor);</span></code></div>
<div><code><span style="color:#0451a5"> return {my_custom_sensor};</span></code></div>
<div><code> <span style="color:#000099">text_sensors</span>:</code></div>
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">"su03t_test"</span></code></div>
<div><code> <span style="color:#000099">id</span>: <span style="color:#0451a5">"su03t_test"</span></code></div>
<div><code> <span style="color:#008000"># update_interval: 5s </span></code></div>
<div><code> <span style="color:#000099">on_value</span>:</code></div>
<div><code> <span style="color:#000099">then</span>:</code></div>
<div><code> - <span style="color:#000099">delay</span>: <span style="color:#0451a5">5s </span></code></div>
<div><code> - <span style="color:#000099">lambda</span>: |-</code></div>
<div><code><span style="color:#0451a5"> id(su03t_test).publish_state("abc"); </span></code></div>
<br><br><br><br>
<div><code><span style="color:#000099">binary_sensor</span>: </code></div>
<div> </div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">gpio</span></code></div>
<div><code> <span style="color:#000099">pin</span>:</code></div>
<div><code> <span style="color:#000099">number</span>: <span style="color:#0451a5">GPIO3</span></code></div>
<div><code> <span style="color:#000099">mode</span>:</code></div>
<div><code> <span style="color:#000099">input</span>: <span style="color:#0000ff">true</span></code></div>
<div><code> <span style="color:#000099">pullup</span>: <span style="color:#0000ff">true</span></code></div>
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">"chumokaiguan-test"</span></code></div>
<div><code> </code></div>
<div><code> <span style="color:#000099">filters</span>:</code></div>
<div><code> - <span style="color:#000099">delayed_on_off</span>: <span style="color:#0451a5">50ms </span><span style="color:#008000">#这里一定要加这个这个起到滤波的作用。</span></code></div>
<br>
<div><code><span style="color:#000099">switch</span>:</code></div>
<div><code> - <span style="color:#000099">platform</span>: <span style="color:#0451a5">gpio</span></code></div>
<div><code> <span style="color:#000099">pin</span>: <span style="color:#0451a5">GPIO16</span></code></div>
<div><code> <span style="color:#000099">name</span>: <span style="color:#0451a5">"shumaguan_switch"</span></code></div>
<div><code> <span style="color:#000099">restore_mode</span>: <span style="color:#0451a5">RESTORE_DEFAULT_OFF</span></code></div>
<br><br></div>
<p style="line-height:1.8"> </p>
<p style="line-height:1.8"><span style="color:#95a5a6;font-size:14px">注:若您的项目涉及软件开发,请在附件上传对应的工程源码。这里可以详细说明您的软件流程图、功能模块框图、相关算法的解释或科普、源码结构、编译环境的搭建和配置、源码编译方法、程序烧录方法等。推荐图文并茂的形式向别人介绍您的想法。</span></p>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">*6、BOM清单</h3>
<hr>
<p style="line-height:1.8"><span style="color:#95a5a6;font-size:14px">请输入内容…</span></p>
<p style="line-height:1.8"> </p>
<p style="line-height:1.8"><span style="color:#95a5a6;font-size:14px">注:项目涉及的BOM清单。在<span style="text-decoration:underline"><a href="https://lceda.cn/editor" target="_blank">嘉立创EDA</a> </span>生成/上传设计文件后,BOM将自动生成至项目详情;建议包括型号、品牌、名称、封装、采购渠道、用途等内容。具体内容和形式应以表达清楚项目构成为准。 </span></p>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">*7、大赛LOGO验证</h3>
<hr>
<p style="line-height:1.8"><img src="//image.lceda.cn/pullimage/xKufnc6iZBUx6UxlR4ViKJ3yd0jyskp2nBEVuDNw.png" alt="" width="745" height="566"></p>
<p style="line-height:1.8"> </p>
<h3 style="line-height:1.8">* 8、演示您的项目并录制成视频上传</h3>
<hr>
<p style="line-height:1.8"><a title="基于esp12f的离线语音温湿度检测仪" href="https://b23.tv/VMcuoEt" target="_blank">https://b23.tv/VMcuoEt</a></p>
</div>
评论(0)