Outdoor Temperature Humidity Sensor with an ESP32 and Esphomeyaml

The sensor itself lays under a carport and is protected from direct rain.
Batterystats for now: changed the battery once since the beginning of this project

Nice little project. Given 18650 have fully charged voltage of 4.2VDC, and the ESP max voltage is 3.6VDC, how have you connected the battery?

@patfelst Use a voltage regulator.

1 Like

oops very silly of me. Those boards have an onboard regulator right?

yep, the one I linked above could also load the battery

Hi there. The gist for the esphome yaml is missing. Do you still have it?

Edited the links. New Version runs a BME280.

Tell me if u want some updated sccreenshots aswell.

2 Likes

Whatā€™s the voltage low level to replace/alert to change the battery?

edit: just look at your github, you set it to 3.3V

Does the battery voltage sensor works ok for you? for me it always shows 3.9, but multimeter indicates lower and lower values over time, until today when I found it off, and voltage was down to 2.3.
The battery is also a 18650

I am not using the board with battery port, just connecting the + from battery to vin, the bridging it to pin 35.

Not really. Usually my ā€œno update alertā€ reminds me to change the battery when it is empty.
I assume it has nothing to do with @OttoWinter 's code but maybe he could provide you some more information why it is not workingā€¦

In my current setup I just use a the shutdown switch in the ESPHome code and HA triggers it when the state of the battery is reported below 3.3V (in theory).

1 Like

Same here!

Looks like an issue with esp32. If i power the esp32 with USB, and connect the battery to the read pin i get more real voltage values, goes up and down so kinda of useless, but there is a max which is likely to be the battery reading.

The humidity reads also are way off when using battery, keeps going up and up until 100% never goes back. Going to try with a BME280 sensor soon

1 Like

Why we donā€™t need voltage divider?

The battery weā€™re using here outputs a maximum of 4.2V when fully charged, but the ESP32 GPIOs work at 3.3V. So, we need to add a voltage divider so that weā€™re able to read the voltage from the battery.

Regards,

Hey void,

thank you for sharing your project. I will rebuild it as soon the hardware will arrive. According to the esphome.yaml I was just wondering why you use MQT instead of the Home-Assistant API provided by esphome?

# Enable Home Assistant API
api:
  password: 'XXXXXX'

Is there a advantage using MQT instead of Home Assistant API?

Cheers,
ZEkE

Found the answer ā€¦
-> https://github.com/esphome/issues/issues/174

the wemos board will do that for you

glad you found it =)

right now using the api only for ac powered devicesā€¦ letā€™s see what Otto comes up with in the future =)

Are you sure?

see https://esphome.io/components/sensor/adc.html#adc-esp32-attenuation

and here :neutral_face:

Known problem in esp32 the adc sensor just donā€™t work properly. You get better results using an ads1115

1 Like