Hi
i m using an ESP8266 with an HC-SR04 Ultrasonic Distance Sensor. I run this with a small Battery an a solar cell for power. actually i try to reduce the power consumption of the HC-SR04 during deep sleep. I connected ground to pin D5. if i switch of this pin the power drops down to 0.000 Amps. But if the ESP goes to deep sleep the pin is low and then the Sensor consumes 0.003 Amps. how can i fix this?
Here is my esphome yaml file.
any other suggestions to improve power consumption? normal deep sleep time is 5min.
substitutions:
device_name: wassertank
device_description: Fuellstand des Wassertank
friendly_name: Wassertank Füllstand
esphome:
name: ${device_name}
comment: ${device_description}
platform: ESP8266
board: d1_mini
on_boot:
then:
- delay: 1s
- switch.turn_on: relay1
- delay: 25s
- switch.turn_off: relay1
- delay: 3s
- deep_sleep.enter: Deepsleep1
wifi:
ssid: "SSID"
password: "PW"
use_address: 192.168.1.183
fast_connect: on #we only have one WiFi AP so just use the first one that matches
ap: #since we listed an SSID above, this AP mode will only enable if no WiFi connection could be made
ssid: ${friendly_name}_AP
password: ap_pw
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
web_server:
port: 80
# Sync time with Home Assistant
time:
- platform: homeassistant
id: homeassistant_time
text_sensor:
- platform: wifi_info
ip_address:
name: "Wassertank IP"
ssid:
name: "Wassertank SSID"
switch:
- platform: restart
name: "Wassertanksensor restart"
- platform: gpio
pin: D5
id: relay1
inverted: true
sensor:
# Uptime sensor
- platform: uptime
name: "Uptime"
# WiFi Signal sensor
- platform: wifi_signal
name: "WIFI Signal"
update_interval: 5s
#Tanksensor
- platform: ultrasonic
trigger_pin: D1
echo_pin: D2
name: "Wassertank Füllstand %"
unit_of_measurement: "%"
accuracy_decimals: 0
update_interval: 5s
filters:
- lambda: return ((((x*100)-20)-(123-20))/(123-20))*-100;
- filter_out: nan
- platform: ultrasonic
trigger_pin: D1
echo_pin: D2
update_interval: 5s
name: "Wassertank Füllstand l"
unit_of_measurement: "l"
accuracy_decimals: 0
filters:
- lambda: return ((((x*100)-20)-(123-20))/(123-20))*-3000;
- filter_out: nan
deep_sleep:
id: Deepsleep1
run_duration: 30s
sleep_duration: 10s