Feature

DIY Solar Powered WiFi Weather Station

Debasish Dutta

Issue 47, June 2021

Instead of buying a commercially available weather station with limited functionality, Debasish put his maker skills to work and made his own with all the bells and whistles.

Sure, you can ask Google or Alexa about the weather to know what to wear for the day, but what do you do if you want more accurate weather data for where you live? There are many affordable commercial units available these days, however, they become a lot more expensive when you want to measure more than just temperature and humidity, or when you want to access the weather data over the Internet.

With the use of his 3D printer, electronics knowledge, and a PCB manufacturer, Debasish has made his own weather station with solar-powered sensors and WiFi connectivity to access the weather data from an app on his smartphone.

We caught up with Debasish to find out more about his project.

We are really impressed by your weather station, Debasish. Before we go into details about it, please tell our readers a little about yourself.

I am an Electrical Engineer and maker from India. I usually do engineering at a Power Plant company during my day job and pursue my electronics hobby during the night and weekends. I am also a blogger, YouTuber, and author on many platforms like Instructables, Hackaday, and hackster.io, etc.

It was Instagram where we initially discovered you and the engaging posts about your weather station build. Congratulations on your amazing YouTube and Instructable channels. Almost 100K subscribers on YouTube and over 10M views on Instructables. Impressive! Do you have any advice for our readers who want to get into content creation for themselves?

Thank you so much. I always make projects which can help people in our society. So I always try my best to write the content or make YouTube videos in such a manner that any reader from non-technical background can also easily understand it and recreate it with their own customization.

I would suggest focusing on a specific domain which you really love or are passionate about. You can spend many hours on that project without frustration or tiredness.

We think it’s also the quality and in-depth explanation of the projects you are sharing. It’s wonderful that makers like yourself are willing to share knowledge with other makers. What originally got you interested in electronics?

From my childhood, I was always curious to tear down my toys and old electronic gadgets to see what is inside them. Though I can’t remember the age precisely, I can guess when I was 9 to 10 years but the real making starts from the year 2014.

One evening I was searching on the internet to find a project on decorative light for my living room and then I found a few Instructables on 8x8x8 LED cube. You can't believe it, I could not even sleep that night because it touched my heart and I was imagining how it will look when it will work successfully. The next day, I had ordered an Arduino starter kit from an online store and started my maker journey. But the real challenge started from that day only, all the projects that I found on the LED cube are run by Arduino or AVR microcontrollers. At that time, I didn't know the term "Arduino" but I was determined to learn about the Arduino and making my own LED Cube. So, I started to read many tutorials and watched YouTube videos on "How to get started with Arduino" to gather my knowledge. After a month of struggling, I got some confidence to start making an 8x8x8 LED Cube, and with a lot of heat and try, I managed to make it within 15days.

That was my foundation for real electronics project making, I learned a lot about how to solder, how to make breadboard circuits, how to program Arduino, and many more.

Custom PCB with onboard ESP32 and sensors.

We are spoilt for choice these days for Arduino starter kits. What was the motivation for building your own weather station, and what makes this V3.0 version different from the ones you have designed in the past?

I am passionate about working on renewable energy and climate change. So I always love to make projects on solar power, environment monitoring, and recycling.

With my limited knowledge, I first started to make a simple weather station (Version-1.0) on a perforated board that can monitor temperature, humidity, pressure, and altitude, and send the data to the Internet so that I can monitor it from the web browser and Smartphone. But luckily, that simple weather station design was accepted by many people around the globe which encouraged me to make a customized PCB for my weather station with additional ports for hooking a few more sensors (Version-2.0). The version-2.0 weather station also got popular and won many contests, which forced me to think about the upgrading, and finally landed on Version-3.0. The Version-3.0 Weather Station is more powerful and professional than my earlier versions of weather stations because:

  • It uses a more powerful microcontroller (ESP32)
  • Additional ports to hook-up a variety of weather sensors like (wind speed, wind direction, rainfall, UV Index, Lux level, and add an external temperature sensor).
  • Ability to hook up a Gas sensor (BME680) for air quality monitoring.
  • The power supply circuit is more stable and reliable than the older version.
  • More powerful solar panel (1.25 Watt)
  • It can be deployed in many applications by using a weatherproof enclosure, like weather forecast, smart agriculture, home automation, smart city, construction site, and many more.

That clearly demonstrates that a maker is always learning and finding better ways to improve their projects. Can you give us a general overview of the project and how it works?

The entire project is based on the ESP32 development board, which is powered by a 18650 Li-ion battery. The battery is charged by a solar panel through a charger module (TP4056).

The environmental parameters are sensed by the weather sensors and processed by ESP32, then the processed data are uploaded to the cloud for monitoring in various platforms.

I have designed a customized PCB for this project. It is designed in such a way that you can conveniently integrate different combinations of sensors according to your actual application needs.

Custom PCB

The PCB looks fantastic. Great job. What weather parameters are you measuring and what modules have you used?

Currently, the weather station is consists of the following modules:

  • Internal Temperature (BME280)
  • Humidity (BME280)
  • Barometric Pressure (BME280)
  • External Temperature (DS18B20)
  • Wind Speed (Sparkfun Weather Meter)
  • Wind Direction (Sparkfun Weather Meter)
  • Rain Gauge (Sparkfun Weather Meter)
  • UV Index (SI1145)
  • Lux Level (BH1750)

BH1750 Lux meter & BME280 Temperature, barometric and humidity sensor.

DS18B20 Temperature sensor & GY1145 for UV Index.

Note, you can hook up a gas sensor (BME680) in place of BME280 for monitoring temperature, humidity, barometric pressure, and air quality.

It’s great that makers are able to source the wind vane and sensor modules separately instead of having to buy an entire weather station system. Could makers make their own instead?

I purchased the Sparkfun Weather Meters kit which includes both wind and rainfall sensors. But I am sure, the wind and rainfall sensor can be purchased separately from online stores like Aliexpress.

Yes, of course, makers can make their own wind and rain sensors by using few electronics components and 3D printed parts. There are many open-source designs available on Thingiverse.

What was your reason for choosing the ESP32 module?

My main reasons for using ESP32 include:

  1. Extra CPU core, faster Wi-Fi, and more GPIO
  2. Additional RTC memory
  3. Higher ADC resolution ( 12bits )
  4. Ultra-low power consumption in Deep Sleep Mode

Can you elaborate on the rechargeable battery and charging circuitry. What design considerations did you need to consider when choosing the battery, charging module, and solar panel?

BATTERY SELECTION:

The battery selected needs to provide the desired voltage and current required for the circuit. The ESP32 needs an input voltage of around 3.3V and draws around 240mA (when the WiFi module, the processing cores, and the Bluetooth module are on). I selected a 18650 Li-ion battery that is perfect since it provides voltage in the range of 2.8-4.2V and can deliver the desired current.

CHARGER SELECTION:

The charger circuit is designed by considering the following factors:

  1. Must have a constant current and constant voltage charging algorithm
  2. Can provide the desired charging current. The advised charge rate of Li-ion battery is between 0.5C and 1C (C= battery capacity )
  3. Equipped with appropriate protection circuit

I have used a TP4056 charger module in my weather station project, which is cheaper and provides all the above 3 features.

SOLAR PANEL SELECTION:

The solar panel is selected by considering the following factors:

VOLTAGE: The solar panel voltage must be higher than the fully charged battery voltage (4.2V). As per the TP4056 datasheet, the input voltage shall be 5-6V, so I have selected a 5V solar panel.

CURRENT: The solar panel current must be sufficient to provide daily power consumption in extreme weather conditions. I have selected a 250mA solar panel which is much higher than my weather station daily power consumption.

DIMENSION: If the solar panel is to be mounted on the enclosure, then dimension is also important. You have to select it as per your enclosure dimension. I have selected a 110 x 69mm solar panel for my weather station project.

Thank you for your in-depth explanation. Can you elaborate briefly on the Deep Sleep Mode for our readers who are not familiar with that function?

ESP32 is really a power-hungry device. If we want to run it by a battery, we have to lower the power consumption. To do that, we’ll use the Deep Sleep Mode which is the most power-efficient option for the ESP chip. It allows you to put the ESP32 into hibernation which saves the battery. You can wake up the ESP at regular intervals to make measurements and publish them.

During deep sleep mode, the CPU, most of the RAM, and all the digital peripherals are powered off. The only parts of the chip that remain powered are the RTC controller, RTC peripherals (including ULP co-processor), and RTC memories (slow and fast). The chip consumes around 0.15mA (if the ULP co-processor is powered on) to 10µA.

How did you go about designing the PCB, and what challenges, if any, did you have to get the ideal solution. Did you need to make many iterations to get the right PCB?

First I made a prototype on a perforated board, then tested out the circuit. After the successful working of my prototype, I started my PCB designing process. The main challenge I found during the design is finding the right parts from the library. I have already made 2 iterations to reach out to the final PCB. In my first iteration, I made a few mistakes like using the wrong packages for the RJ11 connector, the power tracks were very thin, and the mounting hole dimensions were incorrect.

In my view, it is always good practice to simply take a printout of the board layout and try by placing the components over the soldering pads to make sure that everything fits. It will reduce your time significantly in designing a product from the prototype.

Good advice. We also suggested the same technique in our EAGLE tutorials to avoid having to do many PCB iterations. What was the reason to choose an LDO (Low-Dropout Regulator) for the 3.3V output needed?

All the linear regulators require an input voltage at least some minimum amount higher than the desired output voltage. That minimum amount is called the dropout voltage. Due to this reason when battery voltage drops to around 3.7V, the linear voltage regulator will not be able to maintain the voltage required voltage (3.3V) to run the ESP32.

The solution to the above problem is to use a low-dropout or LDO regulator. A low-dropout or LDO regulator is a DC linear regulator which can regulate the output voltage even when the supply voltage is very close to the output voltage and has an ultra-low quiescent current.

Surface mounted TVS diode.

We noticed one of the components is a surface-mount device. Do you have any tips on how to solder those to a PCB for a maker who hasn't done that before?

The TVS diode is the single SMD type component that I have used in my project. I have also not much experience in soldering SMD components, but I know a few basic tips which I regularly used. The tips are listed below:

  1. Start by applying flux on all the pads on the circuit board.
  2. Apply some solder to one of the chip’s corner pads.
  3. Place and align the chip using tweezers.
  4. Hold the chip in place while touching the corner pad with the tip of the soldering iron so that the solder melts the pin and the pad together.
  5. Continue soldering on the opposite corner by putting a bit of solder on the soldering iron tip then touching the circuit board pad and pin at the same time. Do this for all the pins of the chip, one by one.
  6. After all the pins have been soldered you should inspect the solder joints carefully with a microscope.

How did you go about writing the code? Was this all your own work or did you need to remix code from another maker?

I usually write my own customized code, but when the project deadline is very short, I remix code from another maker. I always feel very happy to use an existing code and modify it as per my own requirement and give appropriate credit to the author. I believe this is the main strength of the Open Source community, and I always take advantage of it.

Using the Blynk App to access data from a Smartphone.
Weather data via ThingSpeak via a browser.

Still on the subject of software, we see that you can monitor the weather stats on a phone or web browser. What applications did you choose to display these? Are they straightforward to set up?

I have used Blynk App for monitoring the weather parameters on a smartphone and ThingSpeak for the web browser.

It is really very straightforward to set up, you can do it within a few minutes. To make the Blynk app easier, I have created a QR code for my project, so users can create a clone of my project by scanning the QR code.

A shout out to our many makers, including yourself, who selflessly share their knowledge and projects with others. Where is the best place for our readers to access the other resources in order to make a weather station project for themselves?

The full project documentation is available on Instructables. Readers can access it for making their own and can ask questions if they will face any difficulty during their building process.

3D printed parts.

With regards to the 3D printed parts of your project, what is your design software of choice, the printer, and material you used, and what advice do you have for our readers who want to print their own?

I use Autodesk Fusion 360 to design all of my 3D-printed parts. I personally love Creality made 3D printers because they are cheap, very good build quality, and have large community support.

I used PLA filament to print most of my 3D-printed parts because it is very easy to use. I would recommend using ABS or PTEG filaments for outdoor use.

What kinds of challenges did you need to overcome to get your build to work?

During the building process, I faced many challenges, but the most critical are listed here:

DESIGNING A STABLE POWER SUPPLY: Initially, I have used a voltage regulator AMS1117 to get 3.3V from the battery output but it was very unstable. Later, I replaced it with an LDO MCP1700.

IMPLEMENTING DEEP SLEEP MODE: The weather station software uses two interrupts for measuring the wind speed and rainfalls. During deep sleep, these two functions are not working properly. I am still working on this issue, to optimize the power consumption.

DESIGNING THE RIGHT ENCLOSURE: In the beginning, I designed a simple enclosure for keeping the PCB which looked decent but didn't serve its purpose. The enclosure was made in green color PLA filament, due to which the heat absorbed from the sun and the top solar panel caused local heating of the interior parts which leads to wrong sensor readings.

After a few research, I found that a Stevenson screen is a right enclosure to keep the weather sensors because it shields the sensors against precipitation and direct heat radiation from outside sources, while still allowing air to circulate freely around them. My friend Glen from New Zealand helped me a lot to make a professional-grade Stevenson Screen for V3.0 Weather Station.

Version 1 & version 2 of the weather station.

We read that a Stevenson screen is also referred to as an instrument shelter. Are you happy with your project as it is, or do you plan to expand on it?

Yes, I have a plan to implement a LoRa communication for a long-range (about 3-5km), so that the device can be deployed on a very remote location. I will also make my own 3D-printed wind and rain sensors.

Stevenson screen.

Excellent. We’ve had some fun with LoRa before and achieved these distances. Do we imagine you are working on other projects now that your weather station is operational?

I have a lot of interesting projects in my mind, a few of them are listed below:

  • Battery Capacity Tester V3.0
  • Solar PV Power Generation monitoring
  • Solar Irradiance Meter
  • Portable Solar Generator V2.0
  • My own customized Power Wall

We don’t know where you will possibly find the time to do those, but we’ll watch on with interest.

You can also find Debasish online at:

https://www.youtube.com/OpenGreenEnergy/

https://www.instructables.com/member/opengreenenergy/