Solar Power Supply

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#51 Post by Ton_vN » 28 Aug 2019, 14:23

@Wiki

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 ........
For an ESP8266 current does not seem a problem, but voltage also has to fit, 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 ......
Last edited by Ton_vN on 24 Sep 2020, 19:27, edited 1 time in total.

Wiki
Normal user
Posts: 281
Joined: 23 Apr 2018, 17:55

Re: Solar Power Supply

#52 Post by Wiki » 29 Aug 2019, 13:01

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
Wetterstation.jpg (92.94 KiB) Viewed 9127 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
Unbenannt.JPG (45.46 KiB) Viewed 9127 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.

Code: Select all

pi@raspberrypi:~ $ man woman
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#53 Post by Ton_vN » 29 Aug 2019, 23:01

@Wiki

Sure!

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 ..............

Wiki
Normal user
Posts: 281
Joined: 23 Apr 2018, 17:55

Re: Solar Power Supply

#54 Post by Wiki » 30 Aug 2019, 08:47

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
Unbenannt.JPG (46.87 KiB) Viewed 9105 times

Code: Select all

pi@raspberrypi:~ $ man woman
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

Wiki
Normal user
Posts: 281
Joined: 23 Apr 2018, 17:55

Re: Solar Power Supply

#55 Post by Wiki » 30 Aug 2019, 10:00

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.

Code: Select all

pi@raspberrypi:~ $ man woman
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#56 Post by Ton_vN » 06 Sep 2019, 01:30

@Wiki

;-) 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).

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#57 Post by TD-er » 06 Sep 2019, 10:32

Ton_vN wrote: 06 Sep 2019, 01:30 @Wiki

;-) 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.

Wiki
Normal user
Posts: 281
Joined: 23 Apr 2018, 17:55

Re: Solar Power Supply

#58 Post by Wiki » 06 Sep 2019, 13:21

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:https://www.aliexpress.com/item/3275735 ... 4c4d9Ibgqo

Code: Select all

pi@raspberrypi:~ $ man woman
Kein Handbucheintrag für woman vorhanden
pi@raspberrypi:~ $

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#59 Post by Ton_vN » 08 Sep 2019, 21:21

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_Front
SolarPanel_Front
SolarPanel_5W5V_Front.jpg (287.45 KiB) Viewed 9011 times
SolarPanel_Back
SolarPanel_Back
SolarPanel_InterfaceBox.jpg (98.13 KiB) Viewed 9011 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 .....

Jack_T
Normal user
Posts: 1
Joined: 21 Sep 2019, 08:35

Re: Solar Power Supply

#60 Post by Jack_T » 21 Sep 2019, 10:54

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. https://en.wikipedia.org/wiki/Solar_street_light
Looking at below power station diagram you can build, a real example of this is portable power station design like Suaoki https://www.bestpowerstation.com/suaoki ... and_Weight
Image
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)
Image
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.

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Solar Power Supply

#61 Post by Drum » 20 Oct 2019, 04:03

Have a look at this
https://www.adafruit.com/product/390
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
https://www.adafruit.com/product/2821
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.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#62 Post by Ton_vN » 19 Feb 2020, 19:09

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 .....
Last edited by Ton_vN on 19 Sep 2020, 20:57, edited 4 times in total.

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#63 Post by TD-er » 10 Mar 2020, 20:37

Quite a nice video of Andreas on a voltage monitor connected to the EN pin of the ESP.
See: https://www.youtube.com/watch?v=cKDv0aN67BY

User avatar
dynamicdave
Normal user
Posts: 224
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: Solar Power Supply

#64 Post by dynamicdave » 11 Mar 2020, 09:50

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.

https://discourse.nodered.org/t/solar-p ... tion/12499

Hope you find it helpful/useful.

chemmex
Normal user
Posts: 22
Joined: 15 Feb 2019, 16:18

Re: Solar Power Supply

#65 Post by chemmex » 11 Mar 2020, 21:22

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
Image

happytm
Normal user
Posts: 107
Joined: 15 Aug 2016, 17:53

Re: Solar Power Supply

#66 Post by happytm » 17 Mar 2020, 21:45

@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 :

https://www.youtube.com/watch?v=s7LfIfPXnLs

Thanks.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#67 Post by Ton_vN » 20 Mar 2020, 18:42

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.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#68 Post by Ton_vN » 31 Mar 2020, 11:35

: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?
Last edited by Ton_vN on 06 May 2020, 22:50, edited 1 time in total.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#69 Post by Ton_vN » 22 Apr 2020, 16:22

: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

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#70 Post by TD-er » 22 Apr 2020, 21:05

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.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#71 Post by Ton_vN » 22 Apr 2020, 22:29

@TDer

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.

Correct/hint?
Last edited by Ton_vN on 26 Apr 2020, 11:52, edited 1 time in total.

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#72 Post by TD-er » 23 Apr 2020, 13:13

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.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#73 Post by Ton_vN » 26 Apr 2020, 12:22

@TDer

;-) 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.
Last edited by Ton_vN on 06 May 2020, 22:52, edited 1 time in total.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#74 Post by Ton_vN » 27 Apr 2020, 16:03

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?

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#75 Post by TD-er » 29 Apr 2020, 12:44

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.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#76 Post by Ton_vN » 29 Apr 2020, 14:22

@TDer

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?

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#77 Post by TD-er » 29 Apr 2020, 15:33

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.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#78 Post by Ton_vN » 29 Apr 2020, 16:52

@TDer

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.

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#79 Post by TD-er » 29 Apr 2020, 21:04

Some documentation regarding events: https://espeasy.readthedocs.io/en/lates ... 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"): https://espeasy.readthedocs.io/en/lates ... 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:
https://espeasy.readthedocs.io/en/lates ... nds-listed

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#80 Post by Ton_vN » 07 May 2020, 14:08

@TDer

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

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#81 Post by Ton_vN » 27 May 2020, 10:25

Was just wondering whether this construction would work in combination with Sleep-mode for read-out of an analogue Rain, Leafwetness or Soilmoisture signal by means of A0?
Related Rule might be

Code: Select all

on Rain#Analog do
 SendToHTTP,192.168.0.200,8080,/json.htm?param=udevice&type=command&idx=1234&nvalue=[Rain#Analog]
endon
Not using the facilities of ESPEasy for connection to a Controller, but
checking availablity of Analogue values in ESPEasy and then through 'Rules' directly aiming at the IDX in the destination Domoticz.
Related virtual device of type Leafwetness is nice, because almost applicable.

Today enough sun to keep the circuits running during a test without sleep-mode.
Result of testing:
- Sleep-disabled (= D0 at GND) => Rule is effective and IDX at Domoticz is filled as expected
- Sleep-enabled (= D0 at RST) => No change of IDX = Rule not executed = no refresh of IDX at Domoticz

Also checked with inclusion of WiFi#Connected in the first line of the Rule

Code: Select all

on Rain#Analog and WiFi#Connected do
 SendToHTTP,192.168.0.200,8080,/json.htm?param=udevice&type=command&idx=1234&nvalue=[Rain#Analog]
endon
Runs OK for Sleep-disabled, but no improvement for Sleep-enabled
:( One more illusion shattered, and further search required for solution .........

Perhaps easier/quicker to avoid the internal ADC and hook a PCF8591 to the I2C-interface:
for read-out of a Rain-indicator, for Leaf-Wetness or for Soil-Moist sensing even 8 bits is more than ample resolution.
;-) 1 PCF8591 could serve all 3 devices at the same time ......
If 100% better resolution is required, an ADS1115 is easy to find & integrate.
Last edited by Ton_vN on 15 Jul 2020, 18:17, edited 8 times in total.

RobertBurton45
Normal user
Posts: 5
Joined: 28 Feb 2020, 02:46

Re: Solar Power Supply

#82 Post by RobertBurton45 » 30 Jun 2020, 22:56

Guys, can you send me some good sources where could I read about solar panels? And check this link and see a paper on renewable energy sources. Interested in your opinion. And I would also be grateful to you for any useful literature on this topic. I want to deepen my knowledge of renewable energy and in particular the sun a little. Thank.

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#83 Post by Ton_vN » 17 Sep 2020, 20:17

The transport from China took some time, but the PCF8591-breakout arrived.
Installed as ADC-channels 0 ~ 3 hooked by I2C to WEMOS_Pro & ESPEasy.
PCF8591-breakout powered directly from Solar Power Supply at approx. 4 Volts, provides margin to read signals coming from circuits powered by 3.3V through WEMOS' integrated VCC.
Jumpers set to read the internal NTC and the Potmeter at PCF8591's Breakout through ADC-channels 01 and 03.
Rain-sensor (powered by VCC from WEMOS_Pro) provides analogue output to ADC-channel 02.
For reference PCF8591 is reading VCC of the Rain-sensor by ADC-channel 00.
Reading-function itself seems OK, both in sleep and no-sleep, because varying values appearing.

But slightly puzzled, because ADC-channel 02 constantly is at 255=100%, although the output from the Rain-sensor at value < 3VDC.
Any experience with such setup?
Last edited by Ton_vN on 19 Sep 2020, 21:03, edited 2 times in total.

TD-er
Core team member
Posts: 3162
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Solar Power Supply

#84 Post by TD-er » 17 Sep 2020, 21:35

Do you have some resistor voltage divider to lower the voltage you want to measure?
According to the datasheet the input voltage should be lower than the voltage powering the chip (absolute max is Vdd + 0.5V)

Ton_vN
Normal user
Posts: 170
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Solar Power Supply

#85 Post by Ton_vN » 18 Sep 2020, 14:39

@TDer

Your argument is exactly the reason that in my setup
- the PCF8591 is powered by the Solar Power Supply at approx. 4VDC (allowable = 3.3V ~5V) which is also reference for the onboard devices for CH0, CH1 and CH3.
- the Rain-sensor interface is powered from the WEMOS' stabilised VCC at 3.3VDC:
In that way the output from the rain-sensor interface ( max. 3.3VDC) should always be within the capture range of the ADC of the PCF8591 (of 0~4VDC).
Rain-sensor &amp; interface-PCB
Rain-sensor & interface-PCB
regensensor.jpg (61.47 KiB) Viewed 382 times
Test1
Read-out of the PCF8591 is by ESPEasy, for ADC channels 0 ~ 3.
Channel-setup for PCF8591:
- AIn0 = CH0 = VCC of RainSensor-InterfaceBoard = 3.3V from WEMOS
- AIn1 = CH1 = NTC on breakout PCF8591 by jumper = variable output related to ambient temperature of breakout
- AIn2 = CH2 = analogue output of RainSensor-Interfaceboard
- AIn3 = CH3 = Potmeter on breakout PCF8591 by jumper = stable portion of the Power Supply Voltage
All readouts 'normalised' by formula = %value%*100/255, generating 0 (= nil) to 100 (= full scale = 100%)
Comparison of values from CH0 and CH3 should enable some 'mutual calibration' of the references for the ADC-conversion on CH2.
CH1 is just a test that the read-out function makes sense, because should show some variation related to ambient temperature.
CH2 should show variation related to moisture on the RainSensor-grid.
Readout for CH0, CH1 and CH3 shows a slow variation, while CH2 is always at ceiling value, which cannot be correct as described in lines 1 till 4:
order of magnitude for CH2 should be less than 3.3/4 => < 84%

'Floating ground' or bad connection to power supply might be a reason for strange readouts, but with operating I2C-interface that aspect seems OK.

Test2
The analogue output of the rain-sensor interface board and the ADC-input of the PCF8591 directly connected:
perhaps the signal to ADC-input AIn2 must be loaded by a resistance to ground'?
Could not find any documentation on this aspect, but emperical check of AIN2 with 10kOhm to ground gives surprising results:
- Value at CH0 (checking on VCC of rain-sensor) jumps from 38 units to 95 units [which is impossible conversion-value as described earlier]
- Value at CH1 (looking at onboard NTC) seems steady, staying in same range
- Value at CH2 (looking at output of rain-sensor) remains at 100 units
- Value at CH3 ( checking on Voltage from onboard Potmeter) drops from 88 units to 44 units [which is equally strange as the jump at CH0]
Schematics PCF8591
Schematics PCF8591
schematic-pcf8591-enh-600-wm.jpg (28.28 KiB) Viewed 382 times
LM393-Comparator-LDR
LM393-Comparator-LDR
Comparator-Night-Light-LM393.jpg (55.01 KiB) Viewed 377 times
Test3
Testing with all jumpers removed from the PCF8591-breakout and sequentially each AIn connected to the analogue output of the rainsensor (other pins open):
results from the ADCs were just 'haywire' = unexplainable, because apparently random without relation to the connected analogue signal.

:? Headscratching ........
Then observation that operation of the setup even in 'Sleep-mode' with 1*5W5 solar panel (2nd panel unluckily lost) lasted only till 22:00 ~ 23:00 of each day:
apparently addition of the PCF8591-breakout just too much in a configuration already comprising 4*DS18B20+1*SHT15+1*Rain-sensor.
Not enough power supply obviously results in handicapped operation.

Conclusion:
Application of the PCF8591-breakout might be good idea for lowres read-out of signals by an I2C-device, but (in this rather large configuration) the resulting cumulative power consumption seems killing for the applied solar power supply.
Fortunately just an uncritical experiment.
The PCF8591-breakout and the rainsensor+interface to be moved to an application with ample, continuous power supply.
The power supply of this configuration to be checked, because the series of experiments due to multiple fitting/unfitting might have had some effects on wiring etc..
;-) Lesson learned = know the limitations to load a solar power supply.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests