Developing a solar powered weather station

  • Solar powered weather station.

    After my weather station has been torn apart by a storm gust I take a new approach to make a new version.

    It is possible to power the LOLIN D1 mini module with a custom solar power bank. To prevent the solar power bank from getting exhausted, the "deep-sleep" mode of the module is used.

    As far as sensors are concerned a "tipping bucket" is not usable using deep-sleep.

    Based on the experience gained with the first version of my weather station, the experimental wind speed meter is abandoned. Because acrylic covers and normal glass block UV-radiation it makes no sense to use UV sensors.

    The following sensors are used:

    BME280 : pressure, humidity and temperature
    TSL2561 : light level
    DS18B20 : temperature
    HMC5883: compass for the wind direction
    Anemometer: wind speed sensor

    The data are transmitted via WiFi. This is a direct connection with a router. The data are transferred using the MQTT protocol.

    The mechanical construction is overhauled and adapted to the removal of some sensors.

    The solar power bank is tested. With the module sending at the highest level the power-level of the power bank had fallen to one quarter after some 50 odd hour. Using deep-sleep power should not limit the functioning of the weather station.

    Weather station software.

    The software is as lean as possible.

    Software related to removed sensors needs to be taken out.
    Instead of the meshed radio network a single WiFi connection has to be put into place.
    Adjustment of sensor reading timing is abandoned. The sleep interval is implemented and is not adjustable.
    Based on the experience gained with eGeoffrey adjustment of the sensor values is taken out of the sensor software. It can be done with eGeoffrey.

    The flow of the process has to be adapted to the deep-sleep / awake scheme.

    Data transfer

    The MQTT topic structure is unchanged for the sensors of the new weather station.


    Everything related to the abandoned sensors needs to be removed.
    Some settings of the sensors are no longer required. Related features in eGeoffrey need to be removed.

    The "Shelly – buttons" are not used anymore. Egeoffrey can be simplified.

    Data presentation

    It is possible to display the frequently transferred data for the last 24 hours. The graph will reflect great detail.

    A graph of historical data is based on average values.

    Both types of graph are interesting. For each sensor two graphs are implemented.

    eGeoffrey will handle the weather data next to the burglary alarm data.

  • Implementation

    The software design approach needs adjustment.

    For normal software in the "setup" all kinds of initial settings are done. In the "loop" those software modules are called which should run continuously.

    Using "deep-sleep" is a little different.

    The software is run ONLY ONCE. Then the module goes to sleep for the duration defined.
    Then the module gets to live and runs the software ONCE again.

    That means that all software modules need to be called in the setup.
    The loop stays empty.

    The result is that the module can only send data. Receiving data is NOT POSSIBLE.

    That means that only sensor and message related portions of the existing software can be re-used.

    The resulting software will be much less and simpler than in the first set-up.

  • @eporocrail said in Developing a solar powered weather station:

    The result is that the module can only send data. Receiving data is NOT POSSIBLE.

    Yet another very interesting project! Regarding the above specifically, what I'm using here with the arduino-based sensor responsible for turning the heater on/off which is battery powered is egeoffrey-service-mysensors which has the capability to queue commands. The sensors is waking up every minute, notify the gateway is awake (this is done automatically by the MySensors library) and stays on for something like half a second so that if the gateway has something queued up, it can send it over. Always worked great, never miss a command for the last 2-3 years. A similar logic can be implemented with any other eGeoffrey service I'd say if strictly required, just to let you know in case of need.


  • The software is ready except for the deep-sleep functionality.


    To get the module out of deep-sleep, the RST pin needs to be pulled low.
    This is done by the internal clock via pin D0. That means that D0 and RST have to be connected to enable the deep-sleep function. When doing this in a permanent way, it is not possible to awake the module and reprogram it. The preferred way is using a jumper between both pins.

    The anemometer needs 15V power supply. While the power bank provides 5V a step-up converter is required. The first set-up will be to place this converter next to the power bank. This will mean that the power bank will provide power to the anemometer continuously. If it turns out that the anemometer uses to much power, the converter has to be hooked-up to the PCB of the weather station and needs to be switched on and off. This would require an extra connector on the PCB.

    The PCB is modified to cater for both issues.

  • The weather station is on-line.

    Now eGeoffrey needs adaptation.

  • eGeoffrey lost quite some weight.

    Let's see what happens in about a week.

  • @eporocrail said in Developing a solar powered weather station:

    f it turns out that the anemometer uses to much power, the converter has to be hooked-up to the PCB of the weather station and needs to be switched on and off. This would require an extra connector on the PCB.

    I'm afraid this could be the case, especially with a step-up converter which should drain some current as well.
    Interested to know how this will evolve 🙂

    Thx for sharing!

  • I have a new PCB for the new set-up.
    Only one larger issue: I can not force the module into deep sleep. It leaves deeplsleep after some seconds, enters "deep sleep", leaves it and so on.

    No clue what is happening here.

  • I managed to put the module into deep-sleep. But the interval is not very stable. It happens very often that after the ten minutes interval the module awakes several times with an interval of some ten seconds. Overnight it happens that the interval is stretched to several hours.

    That means the end of my weather station project.

  • @eporocrail pretty weird this inconsistent behaviour, either should work or not, wonder if it is cause waking up requires a current peak the battery cannot provide consistently....

Log in to reply