# Managing ESP32 & 18650 solar charging?

**URL:** <https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175>\
**Category:** Hardware\
**Created:** [March 30, 2022, 11:50am UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175 "2022-03-30T11:50:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [March 30, 2022, 11:50am UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/1 "2022-03-30T11:50:17Z")

</div>

Hi,

I’m planning on adding a node to a beehive to send stats to a nearby gateway, It’ll be remote so solar powered seems the best option. What do you think of these two options?

**Option 1 - Quick and dirty:**  
 ![Hive Solar 1](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/0/8/08ef856aa990e09a9f37d1e231387672bb6122dd.png)  
Using a 50W (site experiences shade unfortunately) 12V panel and connecting the panels built in 5V output directly to the USB interface of the ESP32 and letting it manage charging etc.  
It has a AXP192 Charge IC built in (Charging current 500mA)

**Option 2 - CN3791 charge controller** :  
 ![Hive Solar 2](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/c/d/cd035a4a0fb5ca38a1a4b036fd307e5ffd0234a2.png)  
Connect the solar panels 12V output to a CN3791 board and then directly to the 18650 battery housed on the back of the ESP32.

Option 2 seems much better as far as capturing as much energy as possible with the MPPT to regulate the voltage and current, the oversized solar panel should help during the winter (Northern climate).

My question is, will connecting the battery to the charge controller like this cause any problems, considering it’s connected to the ESP32’s own charge controller?

---

<div class="post-metadata">

**Author:** ![Jeff-UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jeff-uk/32/35697_2.png) [@Jeff-UK](https://www.thethingsnetwork.org/forum/u/Jeff-UK)\
**Post date:** [March 30, 2022, 1:06pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/2 "2022-03-30T13:06:32Z")

</div>

The key thing to look for is the open circuit max Vout from the panel - and even then allow a bit of safety margin c/w the VMax input limit for either charger input option. MPPT is usually that bit more efficient but really only comes into its own at higher power levels - a 50W panel getting full sun yes maybe, if only ever/mostly shaded so not really runnng at 50W but likley \<30 or even 20W - say \>70% of winter daylight hours perhaps not unless cost of MPPT controller small - though another way to look is that extra bit of efficiency may make different of 365/24 operation or loosing a few hours - best advice is do the maths! 😉

---

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [March 30, 2022, 2:02pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/3 "2022-03-30T14:02:50Z")

</div>

Thanks Jeff, I was hoping to avoid the maths by oversizing everything! 😆

There’s no tech specs for the panel, other than DC12-18V being the 12V output, guessing it’s capped to 18V as it’s designed for car battery charging (directly).

The MPPT circuit is £2 so cost is not an issue, I’d expect a massive variance for solar, more light in the winter (no leaves on trees near the hive) but less in the summer so as you say, it should help.

I’m not 100% sure on sensors etc, probably internal\external temperature and humidity to start with. In the future I may use Espressif’s ESP-Now feature to allow other hives in the apiary to pass sensor data to this master hive. I’ll use some deep sleep and adjust usage based on available power (Much less data is required in the winter).

This is the panel I was looking at, it’s cheap, waterproof and is the same dimensions as the hive roof so I can securely attach it directly on top. It’ll be flat, so a slight loss there but will make securing it easy. I’m guessing the 12V output is directly from the panel (through the diodes) but the 5V is probably via a cheap\inefficient regulator.

Solar Panel:

> **[29.43C$ |50W 12V Portable Solar Panel Double USB With metal border silicon...](https://www.aliexpress.com/item/4001143887779.html)**
>
> Smarter Shopping, Better Living! Aliexpress.com

MPPT Circuit:

> **[2.88C$ 1% OFF|1 Cell Lithium Battery Charge 3.7V 4.2V CN3791 MPPT Solar Panel...](https://www.aliexpress.com/item/1005001572351643.html)**
>
> Smarter Shopping, Better Living! Aliexpress.com

---

<div class="post-metadata">

**Author:** ![Jeff-UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jeff-uk/32/35697_2.png) [@Jeff-UK](https://www.thethingsnetwork.org/forum/u/Jeff-UK)\
**Post date:** [March 30, 2022, 2:18pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/4 "2022-03-30T14:18:04Z")

</div>

The panel you show ships with dual USB port/voltage regulator (missed that in you OP) which itself looks rated to ~\>24Vmax as far as I can tell from picture - suggests VoutMax of panel is below that 🙂 More importantly just take that to the USB input of of your sensor module with the on board rechargeable battery - board then takes care of everything and any middle many item (Vreg/Charge controller) is redundant - you’ve just saved your £2 😉 That suggests you are looking at option one above…

---

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [March 30, 2022, 2:43pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/5 "2022-03-30T14:43:52Z")

</div>

Hi Jeff, thanks for your help - would there be much efficiently lost in not having the MPPT manage the battery charging and doing it “dirty” 😂 These parts are so cheap it seems easier to just oversize the hell out of it (a 50cm square solar panel is also a bonus as it’ll act as a roof cover).

---

<div class="post-metadata">

**Author:** ![Jeff-UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jeff-uk/32/35697_2.png) [@Jeff-UK](https://www.thethingsnetwork.org/forum/u/Jeff-UK)\
**Post date:** [March 30, 2022, 3:10pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/6 "2022-03-30T15:10:29Z")

</div>

Remember each intervening convertor adds its own inefficiencies & losses so you dont want to layer these…if going (2) you need to ignore the existing USB convertor (waste of money? - also disconnect it from panel to remove its losses even when not loaded) and take feed directly to external charge controller - I see that has a 12V input buy option…but then you come back to my 1st advice - check the VinMax of the charge controller - if no data on/from panel then play safe and assume it needs to be same as the USB adaptor/convertor - 24V? If I recall (last used quite a while back) the CN3791 IC is good to raw Vin Max 28V, allowing up to 4A chargiing current max (more than battery will need) so should be golden - but check with supplier if there is anything that may limit (caps, diodes, external MosFets etc.) - cant tell from the link provided. Note dont connect battery when charger running - as inrush can be significant and may blow something! Hook battery then add panel connection or keep panel covered until battery ready.

---

<div class="post-metadata">

**Author:** ![wolfp](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/wolfp/32/45304_2.png) [@wolfp](https://www.thethingsnetwork.org/forum/u/wolfp)\
**Post date:** [March 30, 2022, 4:16pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/7 "2022-03-30T16:16:16Z")

</div>

One additional hint concerning the solar-module:  
The rated power is given in Chinese Watt. Depending on where you are, I won’t expect more than 20W.  
0.14 qm x 800W/qm x 0.2 = 22W peak.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [March 30, 2022, 4:58pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/8 "2022-03-30T16:58:53Z")

</div>

> [@wolfp](#):
>
> The rated power is given in Chinese Watt.

LOL Would that be rather like the 1024Gb SD Card I can buy on eBay for a fifth the price of main stream brands??!!

---

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [March 30, 2022, 5:26pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/9 "2022-03-30T17:26:22Z")

</div>

> LOL Would that be rather like the 1024Gb SD Card I can buy on eBay for a fifth the price of main stream brands??!!

I’ve been there too many times in the past 🤪 I figure if you divide the chinese value by 10 you get roughly the right one!

---

<div class="post-metadata">

**Author:** ![Jeff-UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jeff-uk/32/35697_2.png) [@Jeff-UK](https://www.thethingsnetwork.org/forum/u/Jeff-UK)\
**Post date:** [March 30, 2022, 6:02pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/10 "2022-03-30T18:02:31Z")

</div>

Had already factored that in as was going to say 50W overkill for ESP32…then I figured Chinese/Alibaba (no jingoism intended - just previous buying history) so figured real/op likley 20-30W in part contributing to my

> [@Jeff-UK](#):
>
> but likley \<30 or even 20W

comment earlier! 🤣 - I can get GW’s running of good quality 50W panels let along a sensor nodes!

Good luck!

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [March 30, 2022, 6:12pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/11 "2022-03-30T18:12:57Z")

</div>

What information are you going to collect and what is the power consumption of the sensors?

The current proposals seems quite a bit overbuilt - you can get a lot of runtime out from a typical well-designed LoRaWAN node (which an ESP32 solution may not be) from a few alkaline cells, and it’s not clear that this is an application that’s ever going to use enough power (other than by wasteful design) to redeem the resources embodied in that rather large panel.

Essentially, I’d argue to make it efficient first (even if run on disposable cells) and only then worry about alternative power sources.

---

<div class="post-metadata">

**Author:** ![Clemens\_G](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/clemens_g/32/45186_2.png) [@Clemens\_G](https://www.thethingsnetwork.org/forum/u/Clemens_G)\
**Post date:** [April 6, 2022, 9:57am UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/12 "2022-04-06T09:57:21Z")

</div>

I had a ESP8266 based hive monitoring system running with a 0.5 W / 6 V solar panel and update intervalls of 5 minutes and it worked from March on to autumn good. Also a GSM based system with 20 min updates worked till early winter with this 0.5 W panel.

So with your solar panel and LoRa it should be no problem at all, it is at least double oversized, I think. 🙂 I assume that your system will be sleeping most time. So focus on the deep sleep phases and use hardware that supports a good deep sleep consumption. Seems like you will use a TTGO T-Beam variant. For different a TTGO LORA32 / T-Beam module I found incredible low deep sleep numbers at aliexpress, unfortunately no information from TTGO itself. So I assume the mentioned 0,2 uA deep sleep is “Chinese uA” also or mA or whatever. It could not be the real consumption because ESP32 needs 8 uA in deep sleep alone.

So I would first check if your board has a ~ 50 uA deep sleep current (the ESP32 based LoPy can do this or the DFRobot FireBeetle, but last one has no LoRa), and optimize that in case you want to. I think both variants above should work. I would count on simplicity and use your Variant 1 first, track the battery voltage over a season and you can allways switch to Version 2 in case this is insufficient.

I had really [bad experiences](https://github.com/Xinyuan-LilyGO/LilyGo-T-Call-SIM800/issues/189) with the T-Call (SIM800 board) from TTGO, it has also the AXP192 as power management chip. So I hope the LoRa board has a better power design than the T-Call.

Keep in mind what your optimization could be in the future. A smaller panel, other power hungry sensors, LTE as telemetry option …

Btw. what sensors are you using? Weight, temperature, humidity or more advanced things like sound? Feel free and feel invited to join the Hiveeyes community, a tec beekeeper and maker group: [https://community.hiveeyes.org](https://community.hiveeyes.org)

---

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [April 20, 2022, 12:46pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/13 "2022-04-20T12:46:31Z")

</div>

So option 1 was a failure, the 5V output from the 12V (50 chinese Watts) panels controller could only provide enough power to charge the battery in strong direct sunlight. I’ve removed it:

![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/a/6/a62327ecc0c56fe4a7f47436d89c54d3f3a7aaaa.jpeg)

And replaced it with the CN3791. I’ve also removed the 1 cell battery pack from the T-Stream, replacing with a 2 cell holder. It seems to be charging significantly faster, even with heavy clouds at the moment.

@Clemens_G Thanks - I’ve posted there about developing a hive scale recently 🙂  
I will be capturing bee count (in\out via IR LED gates) temp, humidity (inside and out), GPS, motion (theft alarm), sound (only current frequency & volume to to low data bandwidth) and weight.

Does the angel of the panel have much affect on energy conversion? I would like to keep it flat against the beehive roof, but could tilt it towards the south if there’s much of an improvement.

---

<div class="post-metadata">

**Author:** ![Clemens\_G](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/clemens_g/32/45186_2.png) [@Clemens\_G](https://www.thethingsnetwork.org/forum/u/Clemens_G)\
**Post date:** [April 20, 2022, 6:07pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/14 "2022-04-20T18:07:43Z")

</div>

> [@chinswain](#):
>
> And replaced it with the CN3791. I’ve also removed the 1 cell battery pack from the T-Stream, replacing with a 2 cell holder. It seems to be charging significantly faster, even with heavy clouds at the moment.

I have used 1s cells only because the charger I used are 1s charger. As far as I know, you should not use 1s charger for 2s / 3s LiPos. In case you changing the battery holde from a single LiPo to two, I would say it is a 2s setting and you need specail load balancer and it could be dangerous or at leas unefficient to use the 1s chartger for a 2s LiPo. But this is my basic understanding with no guarantee. Or is 1s, 2s, … and balancing only needed with LiPos in series and it is an other case with LiPos in parallel? Perhaps someone other can jump in and enlight us or you have to do more research on this.

---

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [April 20, 2022, 6:40pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/15 "2022-04-20T18:40:46Z")

</div>

The batteries must be identical (Same age, type, voltage rating, size and capacity).

---

<div class="post-metadata">

**Author:** ![constellationlabs](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/constellationlabs/32/35697_2.png) [@constellationlabs](https://www.thethingsnetwork.org/forum/u/constellationlabs)\
**Post date:** [April 20, 2022, 8:44pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/16 "2022-04-20T20:44:39Z")

</div>

@chinswain The angle of the sun definitely affects power from the panel. The basic theory is that the light is spread out by the cosine of the angle (where perpendicular/directly on the panel is 0 degrees), so for a 45 degree angle of incidence, expect cos(45 deg) or about 0.707 (70.7%) of the maximum.  
For what it’s worth, I suspect that the original circuit was designed for bright light only (meaning its minimum input voltage from the panel was relatively high, perhaps 15 V or more). The circuit was probably not running well in the shade. Your new solution sounds better.  
I’ll also echo what others have said, with well-written firmware the module will be in sleep mode most of the time and the total consumption should be low enough to require a much smaller panel and battery, but I understand the approach of over-designing so you just don’t have to worry about it. Cheers on the great project!

---

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [April 20, 2022, 9:10pm UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/17 "2022-04-20T21:10:27Z")

</div>

I’m actually doing it in reverse - I wanted a panel that covered the majority of the flat hive roof, and the cost is not much more than a properly sized panel. I can now adjust the data collection frequently based on the (hopefully) excess power, it would be nice to have more frequent updates. The weather is extremely unpredictable here so another level of insurance!

I don’t think the mechanics of a tilting system will be worth the extra gain, the oversized panel should compensate I hope.

---

<div class="post-metadata">

**Author:** ![dreimal8](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/dreimal8/32/35697_2.png) [@dreimal8](https://www.thethingsnetwork.org/forum/u/dreimal8)\
**Post date:** [April 21, 2022, 7:34am UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/18 "2022-04-21T07:34:24Z")

</div>

May I ask how often your node should send data?  
I use a MKR WAN 1310 with a 1800mAh battery to controll the amount of food left in my bird feeder - it sends every 4 hours (deep sleep in between) and runs with the battery for over a year until I need to recharge. Maybe the solar cell is not necessary for you?  
When using a 26650 you can get cells with 5000mAh…

Or is it necessary that your node is awake all the time?

---

<div class="post-metadata">

**Author:** ![chinswain](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/chinswain/32/35697_2.png) [@chinswain](https://www.thethingsnetwork.org/forum/u/chinswain)\
**Post date:** [April 21, 2022, 8:58am UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/19 "2022-04-21T08:58:28Z")

</div>

It has a lot of sensors, some are extremely time sensitive so the controller will be on all day, with sleep periods at night. I will be counting bees entering and leaving via IR sensors, so constant processing for this. Most other sensors can record every 10 minutes without any impact on the data. (Actual data only needs to be sent back a few times a day so the radio can stay off).

---

<div class="post-metadata">

**Author:** ![dreimal8](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/dreimal8/32/35697_2.png) [@dreimal8](https://www.thethingsnetwork.org/forum/u/dreimal8)\
**Post date:** [April 21, 2022, 9:41am UTC](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175/20 "2022-04-21T09:41:50Z")

</div>

Ahh - ok. Under these circumstances my suggestion is complete obsolete 😉

[Next page](https://www.thethingsnetwork.org/forum/t/managing-esp32-18650-solar-charging/56175.md?page=2)
