Close

First solar powered ESP32 Node

A project log for An outdoor lab in our family vineyard

An experimental space for open DIY technology, sustainable agriculture, creative community, art, and connection between people and land

sotiris-barlakassotiris barlakas • 06/24/2025 at 09:18•0 Comments

Introduction

In this log, I’ll document my first real hands-on step in bringing the vineyard project to life: creating a solar-powered ESP32 node. It's a small but essential milestone that will teach me the fundamentals of powering electronics off-grid — and help me better understand the challenges ahead.

Goal

Build and test a standalone ESP32 microcontroller powered by a solar panel and battery system. The node should be able to operate continuously and send data to the central control unit. In our first project, it will send a message with the current battery voltage.

The primary goal is not just to succeed, but to learn through each failure and iteration.

After a bit of searching (there are a lot of similar projects online) I found out that the main components of a solar powered microcontroller are the following:

Microcontroller (obviously... ESP32-C3 mini is the cheapest I managed to find, is compact and works perfectly)

Solar panel (1 watt is enough to begin with)

TP4056 charging module (super important to manage the safe charging of our battery, it is a BMS actually

18650 lithium-ion battery (very common rechargeable battery. 2-3 mAh is good to begin with)

A voltage regulator (buck/boost converter) module to regulate voltage input from solar panel before feeding it to TP4056. The reason for this is that the TP4056 input voltage must be 4.5-5.5V and the solar panel outputs a variable voltage depending on the sunlight 

A voltage regulator (buck converter) to regulate voltage from the TP4056 to the ESP32 because it accepts 3.3V but TP4056 outputs something between 4.2 and 3.5 (the voltage of the battery)

A Shottky diode to prevent current from returning to the solar panel during night

Breadboard + jumper wires (of course)

Multimeter (very important for testing and learning)

The development of the project was split in discrete steps to gain experience with the individual components and learn their behaviour.

3 Demos were planned:

D1: Measuring of battery voltage with the microcontroller 

D2: Charge the battery with the TP4056 using AC adapter 

D3: Combine D1 and D2 in a single circuit and connect to solar panel

Demo 1

The goal here is to get the voltage of the battery in the analog pin of ESP32.  The voltage divider circuit is necessary because ESP32 accepts maximum voltage of 3.3 while the battery voltage is between 3.3 and 4.2. the voltage divider helps us reduce the voltage in a known amount, measure the reduced safe voltage and estimate the real voltage of the battery.

A photo of the circuit is shown in the image below:

Demo 2

The second demo was about getting TP4056 to work and manage the charging of the battery. For simplification, the TP4056 was charged using an AC wall adapter and not solar panel.

The circuit is shown in the image below:

Demo 3

Finally, the third demo was to connect the two partial circuits, to try measuring the voltage of the battery while it charges.

The combined circuit is this:

During this step a problem was realised. When the battery charges its voltage variates according to the charging voltage, but it usually is approximately 4.2volt. So measuring its voltage is pointless. When the battery discharges it's voltage stabilises at its true value.

Lesson learned:

Measuring battery voltage during charging is pointless.

Another problem here was the voltage regulator I bought.

The voltage regulator (mp1584) I bought is not suitable for regulating voltage between battery and esp32 because it has an Input voltage range between 4.75V-23V which is high. The battery will output something between 4.2 and 3.3. And the regulator must regulate this to 3.3 V exactly to power the esp32 safely. So input voltage is lower than the threshold so the voltage regulator shuts down, and the ESP32 doesn't receive any power.  

Lesson re-learned (as I have been there before): 

When purchasing electronics, look carefully for the specs that your project requires, but still as you can't foresee sometimes you buy the wrong component. It's ok (as long as it is not so expensive). 

So I bought a new regulator. And now it works perfectly to keep the voltage at 3.3 volts and power ESP32.

Then it was time to also connect the solar panel to the circuit.

We need a Shottky diode and another voltage regulator. The voltage regulator between the solar panel and TP4056 is supposed to  regulate the voltage from the range of 2 to 7 volts that the panel outputs to the range 4.4 to 5.5 that the TP4056 safely operates on. The regulator I had was the same as above (input voltage 4.75-17). So I thought that it would decently when the panel receives a fair amount of daylight and outputs voltage higher than 5 volts. Of course if voltage drops lower than 4.75 volts the regulator will shut down and the charging will stop. So I finally put it under the sun and wait to see the TP4056 starting. But the only thing I saw was its led lights flickering dimly! Why?

The voltage in the solar panel pins was something like 6 volts. So it should be working right?

After a bit search I found out that TP4056 operates at 1A. But the solar panel max current is 0.2A. It is a 1 watt operating at  5-6 volts so given the type Power= Voltage x current everything makes sense. But why is this a problem? I continued my research. I found out that the solar panels on general are current-limiting devices. 

A current-limiting devices can't provide larger current than its maximum. So if it is required to provide larger current, the voltage drops! It is called voltage sag. This is done in order for the Power equation to be satisfied. We can't generate more power than the available! We have max 1 watt available so if we demand 1 A from the panel the voltage must drop to 1 volt.

Consequently the voltage regulator didn't receive enough voltage so it shut down. 

So that's why the TP4056 was flickering and didn't work! It didn't receive enough voltage. 

Solution: 

One solution to this problem would be to change the solar panel in order to be able to handle higher current. Another solution to this (in order to avoid the replacement of the solar panel) is to increase the internal resistance (Rprog) of the TP4056 in order to expect lower current. (The Rprog  resistor  sets the charging current of the TP4056). There are lots of tutorials online on how to do this. A bit of soldering is required.  (EDIT: THIS IS HARD. The Rprog resistance is really tiny.) I had to buy a brand new soldering iron because the one I used so far was old and not so accurate (it was my grandpa's - who was an electrician). I also bought thinnier solder and flux (which indeed makes soldering quite easier!) The result is shown in the image below:

Lesson learned: 

When combining electronics, pay attention not only to the voltage but also to the current.

Finally after the aforementioned push-backs and iterations I managed to put everything together.  The circuit is able to power the ESP32, and manage the recharging of  battery using solar power. The complete circuit is shown in the image below:

OOOK, this is quite messy, but this is how prototypes must look! In the future we will build the circuit in a perfboard to reduce its volume and put in in a water-proof box in order to place it in the vineyard!

But we still have a way to go until then. For now, the next step is  to setup a Raspberry Pi zero, which will serve as a central server that will collect, save and process data from our ESP32.

Discussions