Weather station: battery or plugged in?

I’m almost done putting together a weather station; going to have it plugged in with a [usb volt/amp/mAh tracker on my patio for a while to see how much energy it uses while I put it through a month or so of testing & debugging. The weather station is the [ESP32 micromod + [the weather station carrier board + [the rain/wind gauges.

What I’m trying to figure out is if it’s even worth trying to set this up with a battery & a solar panel.

Right now the code doesn’t sleep or anything, it just loops through collecting readings and generating averages, then once every five minutes it sends a MQTT message over wifi. I haven’t tried to use any of the [ESP32 sleep modes, mostly because I was focused on just getting the weather part up and running properly.

When I have the station at my desk and plugged in to the USB power gauge, it shows that the station uses 5.14-5.16 voltes and 1.07-1.10 amps. With those readings plugged into [this DigiKey battery life calculator with a 2500mAh battery, I get a whole… 2 hours. Not exactly a stellar up-time.

The plan is to mount this on the side of the townhouse where I live – I’m on the end of the building, so I can mount it at the apex of the side of the building.

I could buy a larger battery ( something like [this beast ) with a solar panel, but when I’m mounting it on my house that seems like a lot of extra bits and money spent just to have 24-hour uptime.

Is it worth diving into the ESP32 sleep modes and only have the station report data once every 10/20/30/60 minutes? Or should I just look into ways to power this from mains electricity and skip battery+solar entirely? What I’m mostly concerned with is how hard it is to use an ESP32 sleep mode without having to deal with weird bugs caused by Wifi not being ready or something. I want this thing to be rock-solid, stability-wise; I don’t want to have to go up and bring it down to reflash it if there are bugs.

For reference, the next step would be taking the measurements and doing a few things with them: sending them to something like [Open Weather Map, logging the data, sending it to Home Assistant, and maybe doing some basic weather predictions ( mostly “hey the pressure dropped a bunch in the last x minutes, bring an umbrella if you’re going outside” kind of stuff ). I feel like more data points is better, but I know it’s a trade-off if I want to have this thing run off a battery.](https://openweathermap.org/)](12V 18AH UPS Battery Replaces 20Ah Yuasa DataSafe NPX-80B, NPX80B| batteryspecialist.ca)](Battery Life Calculator | DigiKey Electronics)](Insight Into ESP32 Sleep Modes & Their Power Consumption)](SparkFun MicroMod Weather Carrier Board - SEN-16794 - SparkFun Electronics)](SparkFun MicroMod Weather Carrier Board - SEN-16794 - SparkFun Electronics)](SparkFun MicroMod Weather Carrier Board - SEN-16794 - SparkFun Electronics)](Amazon.ca)

I’d say run through pages 21 and 34/35 here https://github.com/sparkfun/MicroMod_ES … eet_en.pdf , then weigh those factors against a few time intervals, and see if it’s worth it to you.

Personally, I’d probably just use an ACTIVE usb extension cable…but it’s always good learn new skills :wink: