How to Power DIY Outdoor Sensors: USB, Batteries or Solar?

When you build DIY outdoor sensors – tank level monitors, weather stations, garden sensors, shed monitors – the electronics are usually the easy bit. The hard part is deciding how to power the thing so it keeps running when you’re not there.

Do you just plug it in with USB? Run it off a battery? Go all-in on a solar powered ESP32 setup with a panel and charge controller?

In this post we’ll walk through the three main options – USB, batteries and solar – and when each one makes sense for a DIY outdoor sensor based on real-world ESP32-style projects.

Start by asking: where will this sensor live?

Before picking hardware, ask a few simple questions:

  • Is there mains power nearby?
  • Do I really need this sensor to be always-on, or can it wake up briefly and sleep most of the time?
  • How annoying will it be to swap or recharge batteries?
  • Is the location good for solar (sun exposure, not under a roof, etc.)?

The right answer for a water tank level sensor on a rural block is very different to a simple ESP32 temperature sensor on a patio next to a power point.

Once you know where the sensor will live and how often it needs to report data to Home Assistant or similar, choosing between USB, battery or solar gets much easier.

Don’t Miss the Next Build
Get new build ideas, code snippets, and project updates straight to your inbox!

Option 1: USB power – simple, but not always practical

If your DIY outdoor sensor is close to the house, USB power is the simplest option.

You plug your ESP32 or ESP32-C3 board into:

  • a spare phone charger inside, with a cable running through a wall, or
  • a weatherproof GPO outside with a USB adapter inside a small enclosure

The upside is obvious: you don’t worry about battery life, solar panels, or charging circuits. Your ESPHome device can stay online all the time, and you can push updates whenever you like.

USB power makes sense for:

  • Sensors mounted just outside a wall where you can run a short cable
  • Shed or garage monitors where you already have mains power
  • Bias lights or LED bars where you want the option to leave them on for long periods

The downside is that you’re tied to locations where a cable makes sense. Running long USB leads across the yard, along a fence, or up a water tank is usually asking for trouble. It’s messy, a bit unsafe, and doesn’t scale well once you have multiple DIY outdoor sensors.

If the sensor is even a little “remote”, you’ll probably end up looking at battery powered sensors instead.

Option 2: Battery powered outdoor sensors

A battery powered ESP32 sensor is often the sweet spot when you can’t easily run a cable, but you also don’t want the hassle of solar panels yet.

Common battery options for DIY outdoor sensors:

  • 18650 lithium-ion cells
  • Flat LiPo packs
  • AA or AAA cells (alkaline or NiMH)

Lithium cells are popular because they store a lot of energy in a small space and work well with 3.3 V ESP32 boards. AA/AAA packs can work too, especially for very low-power devices.

The key idea with a battery powered outdoor sensor is this:
you don’t leave the ESP32 running at full tilt.

Instead, you use deep sleep:

  • The ESP32 wakes up every X minutes.
  • It powers the sensor (if needed), takes a reading, and sends it over Wi-Fi.
  • Then it goes back to sleep and draws a tiny amount of current in between.

This pattern is perfect for things like a water tank level sensor, soil moisture probe, or temperature logger where “every minute” is good enough. You don’t need realtime, millisecond-by-millisecond updates.

Pros of battery powered sensors

  • No cables to run across the garden or up a tank.
  • Simple hardware: ESP32 + battery + maybe a regulator.
  • Great for testing locations before you commit to a permanent install.

Cons of battery powered sensors

  • You have to recharge or replace batteries eventually.
  • Wi-Fi can be power hungry if you wake up too often.
  • Poor deep-sleep setup or leaky regulators can kill battery life.

If you go down this path, it’s worth doing a bit of tuning in ESPHome:

  • Increase the update interval for your sensor to something sensible (e.g. every 5–15 minutes).
  • Use deep sleep rather than keeping Wi-Fi connected 24/7.
  • Turn off any extra LEDs on the board that don’t need to be on.

A well-tuned battery powered outdoor ESP32 sensor can run for weeks or months on a single charge, depending on how often it wakes up and how efficient your hardware is.

If you want to stretch that out further, or you never want to touch the sensor again, solar power becomes interesting.

Option 3: Solar powered ESP32 sensors

A solar powered DIY sensor adds one more piece to the puzzle: a small solar panel and some kind of charging circuit feeding a battery.

The basic idea is simple:

  • The solar panel charges a battery during the day.
  • The battery runs your ESP32 sensor all the time.
  • Even if you get a few cloudy days, the system keeps ticking.

For something like a solar powered water tank level sensor, this is ideal. You probably can’t run mains to the tank, you don’t want to climb a ladder to swap batteries, and there’s usually plenty of sun.

A typical setup looks like:

  • ESP32 / ESP32-C3 board
  • 18650 or LiPo battery
  • Charge controller board (USB + solar inputs, battery output)
  • Small solar panel mounted somewhere with good light

Pros of solar power

  • Once dialled in, it’s close to “set and forget”.
  • Ideal for truly remote DIY outdoor sensors.
  • You can wake the ESP32 more often without panicking about every milliamp.

Cons of solar power

  • More parts: panel, charge board, extra wiring, enclosure design.
  • Panels can be shaded, covered in dust, or damaged by weather.
  • You still need to design for low power if you want good reliability.

The key is to treat solar as a top-up, not an excuse to ignore efficiency:

  • Use deep sleep as if it were battery only.
  • Size the solar panel and battery so that a few bad-weather days don’t instantly kill the system.
  • Keep the charge controller and ESP32 in a weather-resistant enclosure, with decent cable glands for the panel and sensor wiring.

If you’re using ESPHome, combining deep sleep + solar is a very practical way to run something like a tank sensor, garden monitor or gate sensor for months or years with almost no maintenance.

Choosing the right power option for each project

Rather than trying to pick one “best” way to power everything, it helps to have a simple rule of thumb for different DIY outdoor sensor types.

Good candidates for USB power:

  • Sensors mounted just outside a wall with easy cable access
  • Shed / garage monitors where there’s already a power point
  • LED bars and bias lights that might stay on for long periods

Good candidates for battery only:

  • Temporary or “test” sensors where you’re still figuring out the ideal location
  • Low-traffic sensors that don’t need constant updates (e.g. soil moisture, gate open/close state)
  • Places where running a cable is ugly but you can live with swapping batteries every so often

Good candidates for solar + battery:

  • Anything on a water tank, shed roof or fence line far from power
  • Sensors that report often or need to be online most of the time
  • Devices you want to “install and forget”, like long-term environmental monitors

If you’re unsure, it’s often smart to start with battery only while you dial in the deep-sleep timings, sensor behaviour and Home Assistant logic. Once you’re happy, you can add solar on top and turn it into a more permanent solar powered ESP32 project.

A quick word on safety and robustness

Whichever way you power your DIY outdoor sensors, a few basics go a long way:

  • Use decent quality USB adaptors if you’re powering from mains.
  • Treat lithium cells with respect: don’t short them, don’t leave them loose in metal boxes, and use appropriate charge modules.
  • Use proper enclosures and glands so water doesn’t creep into your power hardware.
  • Plan for disconnects: what happens if Wi-Fi drops, or the battery goes flat and comes back?

A little thought up front can turn a fragile prototype into a sensor that happily survives rain, heat and the occasional spider.

Wrapping up

Power is the boring part of a lot of ESP32 projects, but it’s also the bit that decides whether your DIY outdoor sensor is something you show off once, or a tool you actually rely on.

  • If you’re close to the house, USB is the easiest.
  • If you’re a bit remote but still reachable, a battery powered sensor with deep sleep is simple and flexible.
  • If you’re right out on a tank, fence or paddock, a solar powered ESP32 with a small panel and battery starts to make a lot of sense.

Once you’ve wired up one or two sensors using each method, you’ll start to see patterns: which jobs suit USB, which are perfect for batteries, and which deserve the full solar treatment. From there, every new project is just picking the right power option and reusing the same ideas.

Leave a Reply

Your email address will not be published. Required fields are marked *