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

BOM


评论