The goal of this project is simple, a device that reports temperature and humidity data on an interval to a MQTT server that can be read on my mobile device. The device need to run on 3V battery for ~3 months. However, it was disappointing that in real life testing, this device consumes more power than expected and it only lasts about a week-ish.
I need help on improving the power consumption so this device lasts longer. Any idea is welcome.
This is how it works on high level:
- ATTiny85 wakes up every ~20 mins from sleep and turns on the sensor circuit (DHT22 and ESP-01S) and the LED indicator,
- DHT22 and ESP-01S receive power, collect temperature and humidity data and connect to MQTT server for data transmission. This process usually takes about 6 to 8 seconds. Once data transmission is done, ESP-01S fires a signal to let ATTiny85 know that the job is complete, it can now turn off the circuit. As failsafe, if for some reason the process takes up more that 15 seconds, it forces the circuit to turn off.
- Repeat
My thoughts:
- I could remove the LED indicator but I would like to keep it if possible
- I am not using the best transistor 2N3904 here
- There are ways to make ESP-01S consumes less power but I would rather keep it physical modification free if possible
- Maybe I don't need voltage convertor Pololu S7V8F3(coverts 3V to 3.3V), I heard both DHT22 and ESP-01S can run on 3V
Components:
- ATTiny85 chip
- ESP-01S
- DHT22/AM2302 temperature and humidity sensor
- Pololu S7V8F3 step up voltage convertor output 3.3V
- 2N3904 transistor
- 3V battery
- Couple resistors
- Couple bypass capacitors
- 1 LED indicator
The diagram, schematic, and code(attached)
Attached code for both ATTiny85 and ESP-01S.
makeral-weather-station-timer.ino (2.17 KB)
makeral-weather-station.ino (7.22 KB)