It took some time to get the right spare parts for the 3D printer, but I now have them and will probably have a new batch ready next week.
Although I didn’t really design the Salt sentry to run of a battery pack, it should technically not be a problem to run it off a battery pack. I believe it consumes around 70.5 mA, so it should last about a month on a battery pack.
It could however be much longer it the microcontroller (esp8266) is set to go in deep sleep and only wakeup every now and then to report the measured distance. If you’re using ESPhome, I believe it can be dome with this code:
esphome:
name: salt-sentry
esp8266:
board: esp_wroom_02
i2c:
sda: 2
scl: 14
scan: true
globals:
- id: full_cm
type: float
initial_value: '5'
- id: empty_cm
type: float
initial_value: '35'
sensor:
- platform: vl53l0x
id: distance_m
address: 0x29
update_interval: 60s
long_range: false
internal: true
- platform: template
unit_of_measurement: cm
icon: mdi:arrow-expand-down
name: distance
id: distance
update_interval: 10min
lambda: |-
return id(distance_m).state * 100;
- platform: template
name: "percentage"
unit_of_measurement: '%'
icon: mdi:percent
lambda: |-
if (id(distance).state < id(full_cm)) {
return 100;
}
if (id(distance).state > id(empty_cm)) {
return 0;
}
return 100 - (id(distance).state - id(full_cm)) / ((id(empty_cm) - id(full_cm)) / 100);
update_interval: 10min
deep_sleep:
run_duration: 10sec
sleep_duration: 10min
I have not yet tested if tis really works, but it should improve battery life quite significantly