Page 2 of 2

Re: Solar Power Supply

Posted: 28 Aug 2019, 14:23
by Ton_vN

You confirm my view on the matter.
In this post the configuration comprises 5 such 'naked' cells (because the PCBs in the lamps went rusty, and the batteries not surviving either).
Fans each require max. 100mA and 5V ~12V, ESP8266s far less.
My sun-operated fans now being served, and a few more solar lamps approaching end-of-life, makes one think about recycling of those upcoming cells for sun powered supply for a small configuration ........
Current does not seem a problem, but voltage also has to fit the ESP8266, and therefore, either a stepup converter seems required, or some waiting until you have sufficient cells to apply a controller like TP4056.

Cost for the experiment is neglectable; just a pity that reliability/quality is a critical issue, not favourable for the operation of ESP8266s+sensors.
;-) Only for uncritical missions .......

Out-of-the-box thinking (getting headaches related to that TP-board)
KISS as a credo, ;-) perhaps (for my ESP8266s+Light sensors) I should replace the TP4056+battery for an LM7805 (with a thick condensator in front as a buffer):
- sufficient sun during daytime = operation
- insufficient sun & night = 'silence', but who cares ......

Re: Solar Power Supply

Posted: 29 Aug 2019, 13:01
by Wiki
Ton_vN wrote:
28 Aug 2019, 14:23
(getting headaches related to that TP-board)
There is no need to get headaches related to an TP4056 board.

My solar-powered Temp/Humidity/Pressure Station (Stephenson screen 3D-printed):
Wetterstation.jpg (92.94 KiB) Viewed 7029 times
using a modified Wemos D1 china clone as described here (as you can see, no big capacitor, no diodes, no resistors, inside the battery housing a TP4056 pcb) delivers beside the sensor data its battery voltage to my Domoticz:

Unbenannt.JPG (45.46 KiB) Viewed 7029 times
Currently it is configuered to wake up every 5 minutes, staying awake for 20 seconds. This configuration I have chosen to make sure that the battery doesn't stay all the time in fully charged state. During wintertime I think I have to reduce the deep sleep cycle to 5 mins. sleep, 5 secs. awake.

But for your purpose of just running a light sensor I am pretty sure that the combination LM7805/1-4F capacitor will fullfill your needs. And it could be done with recycled solar panels, yes. I personally would prefer instead of the recycling somewhat like this.

Re: Solar Power Supply

Posted: 29 Aug 2019, 23:01
by Ton_vN


Variant with that type of solar panel in a transparant box almost ready to go for the ESP8266 controlling the light-measurements.
Variant with such solar panel plus TP4056-board will shift to an ESP8266-application with operation 24/7:
need to check on charging & discharging rythm ..............

Re: Solar Power Supply

Posted: 30 Aug 2019, 08:47
by Wiki
Discharge behaviour of a modified (as linked above) Wemos D1 china clone with a pretty power consuming ultrasonic distance sensor (cisterne) driven only by 3000 mAh liion battery, no solar panel, deep sleep 30 mins, awake 5 secs, power supply of the sensor switched by a transistor.:
Unbenannt.JPG (46.87 KiB) Viewed 7007 times

Re: Solar Power Supply

Posted: 30 Aug 2019, 10:00
by Wiki
Ehm, I forgot: I would not place solar panel inside your transparent box together with the battery. On full sunlight temperatures inside the box may raise up to 50-60 °C caused by the heating of the panel.

Re: Solar Power Supply

Posted: 06 Sep 2019, 01:30
by Ton_vN

;-) Same lesson meanwhile learned:
solar panel inside the transparant box becomes so hot that the cover at the panel's backside glued over the panel wiring drops from the panel.
Must split the panel (to fit on a plate allowing ambient cooling) and the electronics (in a box for weather protection).

Re: Solar Power Supply

Posted: 06 Sep 2019, 10:32
by TD-er
Ton_vN wrote:
06 Sep 2019, 01:30

;-) Same lesson meanwhile learned:
solar panel inside the transparant box becomes so hot that the cover at the panel's backside glued over the panel wiring drops from the panel.
Must split the panel (to fit on a plate allowing ambient cooling) and the electronics (in a box for weather protection).
What came actually loose?
The glue?

On a side note about gluing plastics.
I also have had issues finding proper glue that will stick to the smooth surface of ABS used in most enclosures.
For example to stick 3D printed parts to an enclosure.
What finally worked for me, was hot glue. At our local DIY store, they had the normal glue sticks and the "extra strong" ones.
Not sure if the "extra strong" part is the key feature here, or the fact that the glue gets over 200 degree C while applying, but this is the only way I could make parts really stick.
So maybe it is just melting stuff together, causing a blend of ABS & PLA in my projects, or the "extra strong" element is really helping :)

Just an idea to help holding stuff together.
Still the heat must be taken into consideration.
I also have a box outside, which is directed right into the sun's path and this summer I recorded 70 degree inside.
It doesn't have a solar panel inside.

Re: Solar Power Supply

Posted: 06 Sep 2019, 13:21
by Wiki
Well, the heating of the solar panel is one thing. The worse thing is, that liion batteries don't like it being heated. They are aging pretty fast and in worst case they may exhaule tiny blue smoke - pretty fast, pretty loud and pretty hot.

To get cables into and out of the boxes I am using this kind of plugs: ... 4c4d9Ibgqo

Re: Solar Power Supply

Posted: 08 Sep 2019, 21:21
by Ton_vN
See the 2 pictures.
The solar panel is 14cm*9cm.
The black box at the back is the junction box for the wiring, filled with a black compound, also acting as glue for the cover of the box:
the sun's heat melted the compound, causing drop of the cover.
SolarPanel_5W5V_Front.jpg (287.45 KiB) Viewed 6913 times
SolarPanel_InterfaceBox.jpg (98.13 KiB) Viewed 6913 times
Reading the stories and my own experiences trigger some rethinking:
- solar panels to be well-cooled in open air,
- batteries to be located in shaded, cool place,
- power supply should mimick real USB-supply, not simple 5VDC-generators

'Lessons learned', but requiring time to develop alternatives .....

Re: Solar Power Supply

Posted: 21 Sep 2019, 10:54
by Jack_T
You can refer to operation principle of solar street light. Most solar lights turn on and turn off automatically by sensing outdoor light using solar panel voltage. Solar streetlights are designed to work throughout the night. Modern designs use wireless technology for battery management.
Looking at below power station diagram you can build, a real example of this is portable power station design like Suaoki ... and_Weight
For an solar power generator system, you need basic components
1. Solar Panel (PV Panel)
2. Charge Controller
3. Battery
4. ESP8266s
5. blacking diode
6. DC usb plug (If you need)
7. Photoelectric Switches
8. Other (Duct tape, glue, screw terminals etc.)
9. Inverter (depend on battery watts)
Photoelectric Switches: Functions as a light sensitive switch that will turn off devices in the presence of light and turn them back on in the absence thereof. Ideal for requirements. UL LISTED & CERTIFIED SAFE Controller features 7 Inch Long Wire leads and easy wiring.

Re: Solar Power Supply

Posted: 20 Oct 2019, 04:03
by Drum
Have a look at this
This will maximize charging with a bit more circuitry and a big capacitor. They use the cap to "stabilize" the power from the solar cell. From what I can tell when the output from solar is below optimal, it charges and drains the cap to charge the battery. It is very effective and well documented in the linked pages.
For a 1 off or proof of concept this with a solar cell, battery and feather board
With an extra connector or two works great. None of the frustration I had with the really cheap boards I bought when I first started with the esp8266! They tend to do a really good job with design and documentation.

Having said that, I found using a tp4056 board and18650 battery I can run a esp8266 on 10 minute deep sleep cycle year round with no problem with the solar cell in a window. But I am also using a custom designed pcb because the USB powered boards are not designed to be power efficient. They are designed to be as cheap as possible and still work, mostly. Better quality parts (voltage regulator and diodes especially) are not expensive. But when you are selling on aliexpress pennies count.

My biggest problem now is condensation on the sensors boards causing oxidation. The sensor boards are not made for outdoor use and do not last long here.

Re: Solar Power Supply

Posted: 19 Feb 2020, 19:09
by Ton_vN
Got ESP8266 running with the TP4056-PCB in combination with 2*panel 5W5V like in Dave's example.
Next is implementation of 'deep sleep' for energy conservation at consumption side.
For ESPEasy_v2 enabling 'deepsleep' is by connection of GPIO16 to RST, plus setting values in the ESP_setup_v2, while this link tells howto script.
But have to consider a possibility for correction.
Looking in Wiki:
Temporary disable Deep Sleep via jumper setting

If 30 seconds is too short for you, you can use this method.

Disconnect GPIO-16 from RST and connect it to GND. Restart your ESP if neccesary.

Now deep sleep will be disabled and your ESP will function normally, until you connect GPIO-16 to RST again.

This requires ESPEasy v2.0.0-dev6 or newer.
Simple(?) question 1:
Is it possible = how to realise 'disable deep sleep' for < ESPEasy_v2.0.0-dev6 ?
( ;-) trying to keep it utmost simple & trying to minimise work on my older setups)

Related question 2:
For measurement in & near soil attached a string of sensors to an ESP8266: 4*DS18B20 + 1*SHT15 + 1*Rain-indicator
How to realise a simultaneous 'deep sleep & wake-up' for this pack of sensors?
[This message in this thread is linking to an applicable description, but with a much smaller set of 'consumer-sensors']
Considering the low price of a TP4056-PCB+Battery and the fact that my connected solar panels have ample capacity, it might be an alternative & option to give (parallel to the WEMOS-processor) that sensor-pack it's own TP4056+Battery.
Separate power supplies should mean generally longer operation {?}: to assure that the sensors are available when the processor needs them, must configure in such way that the sensors have ample supply.
;-) Open for still better ideas .....

Re: Solar Power Supply

Posted: 10 Mar 2020, 20:37
by TD-er
Quite a nice video of Andreas on a voltage monitor connected to the EN pin of the ESP.

Re: Solar Power Supply

Posted: 11 Mar 2020, 09:50
by dynamicdave
Here's a link to a Solar-Powered Weather Station project one of my IoT students tackled last year (July 2019).
It includes a write-up on using 'Deep Sleep' with a Wemos D1 Mini running ESP-Easy. ... tion/12499

Hope you find it helpful/useful.

Re: Solar Power Supply

Posted: 11 Mar 2020, 21:22
by chemmex
Here's my voltage detector part, similar to those in Andreas' video. Cuts down at ~2.7V and provides some hysteresis turning on when the bat is charged to at least 3.1V

Re: Solar Power Supply

Posted: 17 Mar 2020, 21:45
by happytm
@chemmex thank you for sharing your circuit. Since you have voltage supervisor IC can you please try connecting one resistor and one capacitor in series between battery and voltage supervisor to create RC Timer Please? I have ordered voltage supervisor but it will take some time. I was curious to see if your circuit with RC Timer added to it can be used as adjustable trigger to turn ESP8266 device On/Off instead of using regular deep sleep feature to conserve more power ? I realize that it will be useful only if power off time is more than couple minutes.I have written some code for battery powered ESP8266 device to send sensor data within 50 milliseconds and it go to sleep for user defined minutes but it is still using some 20 micro amps during sleep. Following link could be useful for choosing Resistor and Capacitor for RC Timer. Potentiometer between 500k to 1M would be even better in place of resistor to try different delay times :


Re: Solar Power Supply

Posted: 20 Mar 2020, 18:42
by Ton_vN
Addition of a Voltage detector seems good idea:
no run-up of the ESP (if not enough power available) is better than try&error at wake-up.

Re: Solar Power Supply

Posted: 31 Mar 2020, 11:35
by Ton_vN
:evil: Devil is in details

ESP8266 up and running with ESPEasy_v2 interfacing 4*DS18B20+1*SHT15+1*Rain-Indicator.
Solar Supply is continuous by TP_4056, and is sufficient for 24/7 feed of the setup for Operation cycle = Sleep 15 minutes & Processing 10seconds.

All well for the Thermo-sensors, but the read_out of the Rain-Indicator by ADC is oneshot at switch-on and then silence ......
In case of 'No-Sleep' the operation of the Rain-Indicator is OK.

What's wrong? Remedy?

Re: Solar Power Supply

Posted: 22 Apr 2020, 16:22
by Ton_vN
:evil: details to be solved

Question from previous message still open, kindly requesting hint:
how to get the analogue read-out for the rain-indicator?
Something with timing required for ADC, or other aspect overlooked?

Question on text-interpretation of wiki [because effects cannot be seen due to sleep of ESP8266, nor example or explanation found in descriptions]:
in setting of sleep-time, is
a) operation-time within the sleep-time?
b) operation-time outside the sleep-time?

Examples for illustration:
if setting sleeptime to 15 minutes and operation-time to 10s
a) sleeptime = 900 and operation-time = 10
b) sleeptime = 890 and operation-time = 10

Re: Solar Power Supply

Posted: 22 Apr 2020, 21:05
by TD-er
Sleep time is the time the unit will be in (deep) sleep.
In the ESP, there is some timer active, which will trigger the wake pulse.
When going to sleep, this timer is set, based on the set sleep duration.
It isn't very accurate, so when running the max. duration, there may be some fluctuation in the actual sleep time.

Until core 2.4.0 arrived, this sleep time was limited to 2^32 usec, or 71 minutes.
Now we can use a longer sleep period, but the actual sleep period is not really fixed.
So if the set time is longer than the max sleep time reported by the SDK, it will only sleep for this maximum.
The max. is roughly 3.5 hours if memory serves me well.

There is also a setting to configure the 'awake time'.
This is a timer which is being started at boot and is reset if the WiFi connection is successful.
So if it cannot connect to WiFi, the node will go to sleep again after this set awake time seconds.

If it can connect to WiFi, it will go to sleep at max. this awake time after the successful WiFi connect.
So to save as much battery as possible, it is key to call the sleep command from the rules.

Re: Solar Power Supply

Posted: 22 Apr 2020, 22:29
by Ton_vN

Your response is not a short a) or b), but if I correctly understand, it is b) with some 'swing':
please correct if I am wrong with the 'simple' explanation below.

In my example b) the sleeptime is set at 890s, which means that after going asleep, then approx. 890s later the ESP wakes up and tries to connect to WiFi.
If successful, it realizes the series of defined jobs and goes asleep again, which may be earlier than the 10s defined as awake-time.
If not successful with WiFi-connection, the reaction depends on setting:
- 'sleep-if-no-connection' => immediate return to sleep
- otherwise => try for 10s, and then go to sleep.

With the above description I would have expected that also the ADC-function for the Rain-indicator would be completed if it's completion would fit inside the 10s awake-time.
Because (in my setup) the Rain-indicator-read-out is not done while in sleep-mode, (first) wondering why and whether related to the time-setting or (second) something else: therefore questionmark.


Re: Solar Power Supply

Posted: 23 Apr 2020, 13:13
by TD-er
The ADC (internal) is a bit strange in this as the ADC plugin is not processed while a WiFi connection is attempted.
So then it depends on the set "interval" of that plugin.
I guess you could call a taskrun of that task after the wifi connected event has fired.
This will then perform a measurement and call any connected controller to send the data.

Just as extra information.
When the system prepared deep sleep, it will try to flush the queue of each controller.
This may not be successful, or take a bit longer, depending on the controller settings (e.g. timeout, minimal time between messages, etc)
So the "awake time" may be longer than configured due to this flushing.

Re: Solar Power Supply

Posted: 26 Apr 2020, 12:22
by Ton_vN

;-) So my suspicion was correct, that 'something' was required for the operation of the ADC with ESPEasy having Sleep-function active .....
The ADC (internal) is a bit strange in this as the ADC plugin is not processed while a WiFi connection is attempted.
So then it depends on the set "interval" of that plugin.
I guess you could call a taskrun of that task after the wifi connected event has fired.
This will then perform a measurement and call any connected controller to send the data.
Now next is finding a solution, because what do you mean with
depends on the set "interval" of that plugin
and what is the taskrun you indicate?

Considering your previous 2 messages, first measure (in my configuration) seems to change the timing values:
- Sleep for 15minutes = 900s
- Awake for 100s
Interval is not very critical for the functions in this part of my configuration, therefore a 'nice' value is easier.
Awake-time of 100s should be ample for execution of defined jobs, and if successful, will be terminated much earlier than that 100s, while also giving enough 'space' for those 'flushing jobs' within the Awake-time.

Thinking out-of-the-box1 I might principally avoid the whole 'ADC-problem' by application of the digital output of the Rain-indicator, and setting the threshold in the Rain-indicator to a meaningful value. Then no gradual scale for rain-leveldetection, but just Yes/No rain, which is OK for a simple indication.
Thinking out-of-the-box2 might be [?] the connection to the ESP8266' I2C of an ADC like ADS1115, and then could even improve:
- ADS1115 is an 'external' device, unlike the internal ADC [or is the ADS1115-plug-in also subject to the same issues?]
- more bits for ADC-function, and programmable resolution
- 4 ADC-channels
Although that extra resolution might be more meaningful for solar-powered, remote read-out of analogue signals from measuring Soil-moisture and/or Level of groundwater.

Re: Solar Power Supply

Posted: 27 Apr 2020, 16:03
by Ton_vN
Thinking-out-of-the-Box1 might seem a good idea, but the limitations of WEMOS D1 cause some headscratching.
The digital output of the Rain/Moist-indicator is high or low dependent on the resistance or capacity due to wetness of the sensing-board, irrespective of the operation of the WEMOS.
In my configuration D6/GPIO12, D7/GPIO13 and D5/GPIO14 already in use for handling SHT15+DS18B20.
D3, D4 and D8 preferably should not be touched for error-free booting.

Only D1 and D2 then available, but those generally used for I2C, or good experience to 'mis-use' those pins for reading binary input?
Or easier to tweak the handling of the ADC at A0 in combination with Sleep-mode?

Re: Solar Power Supply

Posted: 29 Apr 2020, 12:44
by TD-er
About the 'taskrun' I mentioned.

As you know, ESPEasy has tasks to run and a task is using a plugin.
This abstraction is important to realize, as there are up-to 12 tasks (on ESP32 there are more) and several tasks can use the same plugin.

In order to output data from a task, you have to run the PLUGIN_READ call in ESPEasy itself.
This is either called periodically, with a period set in the task configuration as "interval".
So at boot it will call PLUGIN_READ and then set a timer for "interval" number of seconds in the future.

You can override this interval by calling "taskrun".
This will (re-)schedule the task to run almost immediately.
The only way the execution may be delayed is when there are other scheduled things that are already overdue.
I just mention this so you don't expect to have very tight timing requirements here, but expect some tolerance of typically a few tens to hundreds of msec.

Now back to the idea of getting the ADC values read before going back to sleep again.
ADC is not read during WiFi connect, so you must wait for the WiFi connected event.
If that event is fired, you can call a taskrun on the ADC task to let it perform a read. (maybe even 2 reads with some delay in between, if using oversampling)
So to have it optimal, you can try this:

On WiFi connected event:
- taskrun of ADC
- Set timer to a few seconds

When timer event fires:
- taskrun of ADC.

At that second run you will be sure it has a proper reading of the ADC and you don't need to tweak the interval settings as that's something you probably can't get right for all external delays that may extend the time needed for getting a wifi connection.

Re: Solar Power Supply

Posted: 29 Apr 2020, 14:22
by Ton_vN

Thanks for the elaborate explanation!

Reading that explanation a suspicion what is the reason of no completed ADC-read-out in my configuration.
The present time-setting is 890s of Sleep & 10s of Wake.
ADC-interval now set at 60s (as usual & OK for all my continously operating ESPs) then surely means that the ADC does not get a second chance as mentioned in your explanation.

Therefore will modify the time-settings and see what happens:
- Sleep 900s
- Wake 50s
- ADC-interval 5s (allowing a few repeats within the nominal Wake-time)
Correct interpretation of your explanation?

Re: Solar Power Supply

Posted: 29 Apr 2020, 15:33
by TD-er
The first few readings of the ADC may then be bogus.

Like I tried to explain, if you are running on a sleep/wake cycle, it is better to not rely on the interval timer, but act on events.
Those events are then fired on "when they are ready" or "when they occur".
Time based operation is always some kind of compromise and thus there are always scenarios where they don't apply.
When acting on events (e.g. WiFi connected event) you can call a taskrun for the ADC to make sure there are no left over samples in the oversampling routine and start a second timer.
Then when this second timer fires you call a taskrun again to make sure you only have samples based on the time between those 2 calls of taskrun.

If you do it time based (relying on the interval timer), you are not sure what side effects may have had impact on the readings.

Re: Solar Power Supply

Posted: 29 Apr 2020, 16:52
by Ton_vN

Understand what you tell, but setting up the required eventdriven task seems a bit beyond my present knowlegde & skills.
Then looking at examples usually is a fast lane for learning:
could you hint to any applicable example?
Considering the background, such event-driven setup may be a real bonus (or even a requirement) for all task-execution in a configuration using Sleep-timing.

Re: Solar Power Supply

Posted: 29 Apr 2020, 21:04
by TD-er
Some documentation regarding events: ... tem-events
See the highlighted "WiFi#Connected"

Also on the same page the "Rules#Timer=" part.

Here some example on how to set a timer (search for "timerSet"): ... r%3D#timer
Such a timer (upto 8 timers can be set) will trigger the "Rules#Timer=" event.

And here is the taskRun command listed: ... nds-listed

Re: Solar Power Supply

Posted: 07 May 2020, 14:08
by Ton_vN

With interest reading your older discussions in Github on this subject:
provide some other angles for view on the matter.

;-) Now just to translate into a few short script lines for
#1. start action at Wifi-connect
#2. either read1 for ADC, but disregard result (because probably rubbish),
or timed delay to read2,
#3. read2 etc. for ADC & transfer