Running cables across a farm is expensive, and changing batteries on fifty sensors every few months is worse. A small solar panel and the right battery can keep a field device running for years. But only if the system is sized for the worst weeks of the year, not the best.
Many of our Viva deployments run entirely on solar power. Here's the method we use to size panels and batteries, with two worked examples: a small LoRa sensor and a 4G gateway.
Step 1: work out how much energy the device uses
Everything starts with an energy budget: how much energy the device needs in a day. Field devices spend most of their time asleep and wake briefly to measure and transmit, so you add up each state:
- Sleep: the current drawn while waiting, and for how long.
- Measuring: the current while the sensor and processor are awake.
- Transmitting: the current while the radio sends, usually the highest, but brief.
Measure these on a real device with a power analyser or a meter that captures short bursts. Datasheet figures are a starting point, but real boards often draw more because of regulators, LEDs and sensors left switched on.
Example A: a LoRa soil sensor
Suppose a sensor wakes every 15 minutes, spends 2 seconds measuring at 40 mA, transmits for 0.5 seconds at 120 mA, and sleeps at 20 µA the rest of the time.
| State | Calculation per hour | Charge per hour |
| Measuring | 4 × 2 s × 40 mA | 0.089 mAh |
| Transmitting | 4 × 0.5 s × 120 mA | 0.067 mAh |
| Sleeping | about 1 hour × 0.02 mA | 0.020 mAh |
| Total | | 0.176 mAh per hour, about 4.2 mAh per day |
Add a 50% margin for regulator losses, battery self-discharge and the unexpected, and plan for about 6.3 mAh a day. That's tiny. A single 2,000 mAh lithium-ion cell, using about 80% of its capacity, would last around 250 days on its own.
Sleep current is where designs go wrongIn this example sleep is only about 0.5 mAh a day. But if a sensor or LED is accidentally left powered and the board sleeps at 2 mA instead of 20 µA, sleep alone becomes 48 mAh a day, more than ten times the whole budget. Switching off sensors between readings is often the single biggest saving.
Example B: a 4G gateway
A gateway is a different story. It listens for sensors all the time and keeps a cellular connection, so it never sleeps. Suppose it averages 1.5 W around the clock:
- 1.5 W × 24 hours = 36 Wh per day.
- Add 20% for charge controller and wiring losses: about 43 Wh per day.
That's thousands of times more than the sensor, and it's the gateway that needs the serious solar design.
Step 2: size the battery for cloudy days
The battery has to carry the device through nights and through runs of cloudy days. The number of days it should last without any sun is called days of autonomy. For sites around Chennai, the northeast monsoon from October to December brings the longest grey spells, so that's the period we design for.
For the gateway, with 3 days of autonomy:
- 43 Wh × 3 days = 129 Wh needed.
- A LiFePO4 battery used to about 80% of its capacity needs 129 ÷ 0.8 ≈ 160 Wh.
- At 12.8 V, that's about 12.5 Ah, so we'd choose a 12.8 V, 15 Ah battery for headroom.
We prefer LiFePO4 (lithium iron phosphate) for gateways: it handles heat better than other lithium chemistries, lasts many more charge cycles than lead-acid, and can safely be used more deeply. For small sensors, a single 18650 lithium-ion cell or a LiFePO4 cell is usually plenty.
Step 3: size the solar panel
Panels are rated in watts under ideal test conditions. Real output is lower, so we use two numbers:
- Peak sun hours: the equivalent number of hours per day of full-strength sun. Chennai typically sees around 5 or more for much of the year, but we use 4 to cover monsoon months.
- Derating factor: about 0.75, to allow for heat, dust, panel angle, and charging losses.
For the gateway: 43 Wh ÷ (4 hours × 0.75) ≈ 14 W. The panel also needs to recharge the battery after a cloudy spell while still running the gateway, so we'd fit a 20 to 30 W panel.
For the LoRa sensor, the daily need is so small that a panel of around half a watt is more than enough, and the main design question becomes keeping the panel clean and correctly angled.
Step 4: protect the battery and electronics
- Use a proper charge controller. It prevents overcharging and stops the battery draining too deeply, both of which shorten its life. For larger panels, an MPPT controller harvests noticeably more energy than a basic one.
- Watch the heat. A sealed box in direct sun can get far hotter than the air around it. Lithium batteries shouldn't be charged when very hot; most cells are specified for charging up to about 45°C. Shade the enclosure, paint it light-coloured and allow some ventilation.
- Keep water out. Use enclosures rated IP65 or better, cable glands at the bottom, and a breather vent to stop condensation building up.
- Angle and clean the panel. In Chennai, tilting the panel roughly at the site's latitude, about 13°, facing south works well across the year and helps rain wash off dust. Check panels for dust and bird droppings during maintenance visits.
Step 5: make the firmware power-aware
Software can save as much energy as hardware:
- Batch transmissions. Take readings often, but send several together if nothing urgent has changed.
- Send on change. Report immediately when a value crosses a threshold, and less often when it's stable.
- Adapt to the battery. When the battery runs low, report less often rather than going dark.
- Report battery health. Every message should include battery voltage and charging status. That data shows which devices need attention long before they fail.
A quick checklist
- Measure real current in every state on a real device.
- Calculate daily energy, then add a margin.
- Choose days of autonomy for the worst season at the site.
- Size the battery from daily energy × days of autonomy ÷ usable capacity.
- Size the panel from daily energy ÷ (peak sun hours × derating), then add headroom for recharging.
- Add a charge controller, heat protection and a weatherproof enclosure.
- Make the firmware report battery health and adapt to low power.
Key takeaways
- Start with a measured energy budget, not datasheet guesses.
- Small sleeping sensors need very little; always-on gateways need real solar design.
- Size for the worst weeks, which around Chennai means the northeast monsoon.
- Heat, water and dust cause more field failures than the electronics themselves.
- Firmware that batches, adapts and reports battery health extends life significantly.