How-to · Intermediate · 3 min read
Solar Panels and Charge Controllers for Electronics Projects
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
A solar project needs a panel, a charge controller and a battery. Size the battery for several cloudy days of use, and the panel to recharge a day's use in your local peak sun hours, about 4 to 5.5 hours in most of India. Use a controller made for your battery chemistry: a solar Li-ion charger for an 18650, or PWM or MPPT for 12 V lead-acid and LiFePO4.
Key specs at a glance
- Peak sun hours (India)
- About 4 to 5.5 per day; less in monsoon
- Panel output
- Watts at about 1000 W/m² sun; expect 70 to 80% in real use
- 12 V panel
- Vmp about 17 to 18 V, Voc about 21 to 22 V
- PWM controller
- Cheap; panel Vmp should be close to battery voltage
- MPPT controller
- 15 to 30% more energy, best with higher-voltage panels
- Small builds
- 5 or 6 V panel + solar Li-ion charger (CN3791, or TP4056 with care)
A shorted, over-charged or damaged lithium cell can get very hot and catch fire. Use a protection board or BMS, never short the terminals, charge on a non-flammable surface and do not leave a charging pack alone. Throw away cells that are swollen or dented.
Sizing panel and battery
- 1Daily energy: average current x voltage x 24 h. An ESP32 sensor that sleeps and wakes might average 20 mA at 3.7 V: 0.02 x 3.7 x 24 = 1.8 Wh per day.
- 2Battery: cover 3 to 5 cloudy days and stay above 20% charge: 1.8 x 4 / 0.8 = 9 Wh, so a 3.7 V 2500 to 3000 mAh 18650 cell.
- 3Panel: daily energy / (sun hours x 0.7 losses). With 4 sun hours: 1.8 / (4 x 0.7) = 0.64 W, so use a 1 to 2 W panel for monsoon margin.
The solar panel sizing and battery life calculators do this arithmetic.
PWM vs MPPT charge controllers
| PWM | MPPT | |
|---|---|---|
| How it works | Connects panel to battery in pulses | Converts panel voltage down to the battery, tracking peak power |
| Efficiency | Wastes the difference between panel and battery voltage | Harvests 15 to 30% more, more in cold or with high-voltage panels |
| Cost | Low | Higher |
| Best for | Small 12 V systems with matching 12 V panels | Larger systems, higher-voltage panels, Li-ion/LiFePO4 |
- How it works
- PWM:
- Connects panel to battery in pulses
- MPPT:
- Converts panel voltage down to the battery, tracking peak power
- Efficiency
- PWM:
- Wastes the difference between panel and battery voltage
- MPPT:
- Harvests 15 to 30% more, more in cold or with high-voltage panels
- Cost
- PWM:
- Low
- MPPT:
- Higher
- Best for
- PWM:
- Small 12 V systems with matching 12 V panels
- MPPT:
- Larger systems, higher-voltage panels, Li-ion/LiFePO4
Small single-cell solar projects
For an ESP32 or Arduino sensor on one 18650 cell, use a solar Li-ion charger module (such as a CN3791 board with MPPT-like input regulation) fed by a 6 V panel. A TP4056 can work with a 5 to 6 V panel, but it does not track the panel's power point and charges poorly in weak light. Add a low-quiescent 3.3 V regulator and use deep sleep so the average current stays low. Protect the cell with a protection circuit (DW01) and keep it out of direct sun: Li-ion cells should not charge above about 45 °C.
Wiring order for 12 V controllers
Connect the battery to the controller first, so it can detect the system voltage, then the panel, then the load. Disconnect in reverse order. Use a fuse on the battery lead, size cables for the current, and set the controller's battery type (lead-acid, gel, LiFePO4) correctly. Most cheap PWM controllers have a load output with low-voltage disconnect, which protects the battery from deep discharge.
Try it: Solar panel sizing calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Sizing the panel for sunny days only.
- Connecting the panel to the controller before the battery.
- Using a lead-acid controller setting on a LiFePO4 battery.
- Charging Li-ion cells in a hot sealed box in direct sun.
- Expecting a 12 V panel to charge a 12 V battery without a controller.
Frequently asked questions
What size solar panel do I need for an ESP32?
With deep sleep, an ESP32 sensor usually needs 1 to 3 W of panel and an 18650 cell. A continuously running ESP32 on Wi-Fi needs far more, around 5 to 10 W and a larger battery.
PWM or MPPT, which is better?
MPPT harvests more energy, especially with higher-voltage panels or in cold weather. PWM is cheaper and fine for small 12 V systems with matching panels.
Can I connect a solar panel directly to a battery?
Not safely. Without a charge controller the battery can overcharge. Always use a controller made for the battery chemistry.
How many sun hours does India get?
Most regions get about 4 to 5.5 peak sun hours per day on average, lower during the monsoon and in the far north in winter.
Can a TP4056 charge from a solar panel?
It can, with a 5 to 6 V panel, but it is inefficient in weak light. A solar charger such as a CN3791 module works better.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 6 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- Ministry of New and Renewable Energy and NREL solar resource data for India
- Consonance CN3791 datasheet
- Charge controller manufacturer manuals
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




