
Hello
I present the weather station on which I have been working for some time.
The beginning of work is also my beginning of fun with Arduino.
It started with a ready-made project of a tiny station with an OLED display.

Back then, just uploading the program to ESP8266 was a feat for me. Later I started to combine, improve this and that, try other soft. On the basis of this station, a data receiver from the network was created.
The next step was to make an external weather sensor.
Three versions were created.
First version

Complete failure. The system was powered by a Li-Ion battery through a 3.3V buck-boost converter. The battery is charged with the TP4056 system from a 2W solar cell. The system was also not cyclically put to sleep, which resulted in a continuous current consumption of 80mA. The results could be read on the display and by connecting to the device on the browser page. Such an arrangement had no right to exist.
Second version

Almost everything has been improved in this version. ESP8266 got cyclical awakening from the "Deepsleep" state every 30 minutes, I also gave up the converter for the LDO stabilizer, the measurement results are sent to the BLYNK and Thingspeak server, the possibility of reading on the OLED display remains unchanged. I also added a battery voltage reading.
Now the system uses 80mA for a few seconds every half an hour, and about 2mA for the rest of the time, because the display is permanently on.
Diagram

The diagram also shows HTU21d and BMP280 in the final version changed to BME280.
Third version

In this version, only the sensor has been improved and changed. In earlier versions, the sensor was inside the housing, now it is in the radiation housing. HTU21d and BMP280 have been replaced by one BME280 sensor.
The radiation casing is traditionally made of pot holders, bolted together on stainless steel M3 rods.
Data from such a sensor can be read in four ways: directly on the display, with a smartphone using the Blynk application, on our Thingspeak channel, and at the weather station itself.
Final program:
Code: c
Once I had the measuring part, it was the station itself.
For a long time, I had a 3.5 'display on the SSD2119 driver. I bought it because there is a Bascom service routine for it, and it stayed in a drawer for about two years. Now I would use a completely different LCD as this one is slow and needs a lot of I / 0 pins.
The whole thing is controlled by atmega128 on a PCB. I don't even know what this album was for, I bought one. As the display only tolerates a 3.3V power supply and atmega is powered with this voltage, it is also heavily overclocked, 16Mhz at 3.3V. I know it's an inflection, but before the whole station was created, I tested the whole thing for a long time and nothing bad happened.
HTU21d, BH1750 and RTC DS3231 sensors are connected to the atmega via I2C.
By default, the mega reads data from them and sends it to the display. The light sensor is needed to automatically change the backlight intensity - atmega controls the PWM converter on the display board. I resigned from synchronizing the time with the server, because you still have to change the winter / summer time in the program yourself, anyway, the DS3231 offers a lot of accuracy. The controller also receives data from ESP via Serial-A.
The wireless part is dealt with by ESP8266 with the program in Arduino. ESP connects to the Wi-Fi network, reads weather forecasts for the current day and two days ahead from the Weatherunderground server as well as the age of the moon, the latest values from my Thingspeak channel and the time from the NTP server. As I wrote earlier, he does not use his time. Then it formats this data and sends it via serial every minute. The atmega receives this data and presents it on the display.
The program is mostly web-ready. I glued it together from probably four different ones and added sending data via the series.
Bitmaps with icons for weather and moon phases are saved on the SD card.
The phase of the moon is calculated from its age. Of course, atmega does this.
Well, I know it could be easier. ESP alone would have done everything, but I wanted to use the parts I had. On the other hand, I do not think I saw a 3.5 'display that would work with ESP, and I do not know if it would be lacking pins.
5V power supply. Power consumption at the maximum brightness of 480mA backlight.
The enclosure is made of laminate, its individual elements were designed in Eagle and made like ordinary pcb. Connecting individual elements by soldering. The rear part is fixed with screws. I just have to sprinkle it with some varnish so that the copper does not oxidize, but now I don't have the conditions for it.
When commenting on programs, especially in Bascom, please take into account that I have never learned any programming language and it is written as is. The one for ESP is simpler, so also less messed up by me.
Sources of the program for atmega will be in the attachment.
Program for ESP8266:
Code: c
The station has been operating for several weeks and does not freeze. The only drawback I noticed is that sometimes the Atmega "does not see" the SD card after powering up the Atmega. This is indicated by a message on the display. A reset or restart of the power helps. This is probably related to overclocking.
I know that the sensor itself was already presented in the DIY department, but then it was a stand-alone device, and now it has become part of the entire weather station.
If I forgot something, write, ask.
And something for the eye.








Cool? Ranking DIY