Solar
weather station
An energy-independent weather station: WeMos D1 mini, BME280 sensor, an 18650 cell and a small solar panel. Readings went to a MySQL database every 15 minutes.
Building the station
The main goal was for the whole device to be self-sufficient in energy. After going through the internet and checking how others built this kind of station, I decided to build my own. I took a lot from these pages:
- Solar Powered WiFi Weather Station
- ESP8266 + BME280
- ESP32/ESP8266 โ MySQL + PHP
- malinowemeteo.zgora.pl
Parts
- Electrical enclosure
- WeMos D1 mini
- BME280
- 18650 holder
- 18650 cell
- TC4056A
- PCB terminal block
- 6 V solar panel
- Jumper
- 220k resistor
I wanted the readings sent to a MySQL database, so I created one on my hosting server. Next I uploaded the code to the WeMos with Arduino and put a PHP file on the server. You don't need a domain; the server's IP address is enough for the upload to the database to work.

Arduino
I'm no Arduino genius, more of an amateur. The code was written with a lot of sweat and is mostly the result of trial and error, but it works, except for measuring the battery level ๐

MySQL
Create a database to store the values measured by the sensor. To make it easier, after creating the database log in to it and import the prepared sql.sql file, which creates the tables and rules automatically.

PHP
Put the prepared post-esp-data.php file in the root directory of your hosting, usually public_html. Edit it first (Notepad is enough) and enter the details of the MySQL database you created.

PCB
To make the layout easier I designed a PCB. The version I use is the basic one and differs from the one on GitHub in the number of connectors broken out. The component placement is not the work of a professional; it follows the size of the enclosure I wanted the board to fit.

Radiation shield
If you want to use the sun, you have to accept that the sensor enclosure will heat up, which gives wrong readings, temperature above all. Original metal shields cost a fortune, so I followed this article about a shield made from plant-pot saucers. The author describes in great detail how to build one cheaply and shows how it performs in different conditions. I bought ten 21 cm saucers and one 25 cm, 6 mm threaded rods, nuts, washers, a wall bracket and PP pipe, which I cut into spacers between the plates.















Summary
A small solar panel and ESP deep sleep do the job. On the 18650 alone the station would run for weeks; I stopped counting after 10 days ๐ The panel works great. The longer the deep sleep, the less energy the system uses, which matters a lot with our winter sunshine.
What you do with the data in MySQL is up to your imagination. I simply put it on a web page. I encourage you to build your own weather station.
Live readings from the station are no longer published here. The values were indicative only, as the station was experimental.