In our ongoing exploration of innovative solutions for sustainability, I've embarked on a project to integrate a miniature weather station with solar power. To ensure reliability and longevity, we've opted for the use of a supercapacitor as our backup battery.

Starting the Journey with Supercapacitors

I began by testing the application of supercapacitors in various projects. This experience has been invaluable as I now want to apply what we’ve learned to make our weather station more sustainable and efficient.

Converting Our Miniature Weather Station to Solar-Powered Operation

The next phase of this project involves converting the miniature weather station to run on solar power. By integrating a supercapacitor, which acts as a buffer between the variable output of solar panels and the constant demand from our weather station sensors, we can achieve reliable and consistent readings even during periods of low sunlight.

Why Supercapacitors?

2.7V 30F Supercapacitor

Supercapacitors offer several advantages over traditional batteries such as lithium batteries. Here are the key reasons why they are well-suited for our solar-powered weather station project:

High Power Density:

  • Quick Current Delivery: Deliver high currents quickly, suitable for intermittent and peak loads.
  • Immediate Response to Demand: Provide immediate power when needed, ensuring consistent readings during low sunlight periods.

Long Cycle Life:

  • Improved Efficiency: Maintain efficiency better under frequent discharges and recharges.
  • Reliability in Variable Conditions: Robust performance in varying environments (e.g., hot direct sunlight), ensuring consistent operation over time.

Quick Recharge Time:

  • Efficient Energy Storage: Store excess power from solar panels for quicker recharge cycles.
  • Optimized Power Management: Ideal for capturing intermittent solar energy and continuous system operation.

Comparison with Lithium Batteries

Performance Under Extreme Conditions:

  • Thermal Stability Issues: Suffer from thermal runaway in extreme heat (e.g., above 60°C), reducing capacity and safety risks.
  • Limited Recharge Cycles: Have a limited number of recharge cycles, not suitable for variable solar conditions.

Environmental Considerations:

  • E-waste Concerns: Pose significant e-waste issues due to toxic components and high recycling costs.
  • Resource Intensive: Require substantial resources (e.g., lithium, cobalt) for manufacturing, with environmental implications.

ESP32C3 Supermini

BME680 Module

TPS63802 Buck Boost Converter Module

The Solution: A Block-by-Block Breakdown

My project breaks down into several key stages:

  1. Energy Harvesting: Capturing sunlight using a solar panel.
  2. Energy Storage: Storing the harvested energy using supercapacitors.
  3. Power Management: Providing a stable voltage to the microcontroller and sensor despite fluctuating storage voltage.
  4. The Brain: An ESP32C3 microcontroller handling sensor reading, WiFi, and data transmission.
  5. The Sensor: A BME680 measuring temperature, humidity, pressure, and gas resistance.
  6. The Software: Firmware running on the ESP32C3 to control everything.

Let's look at each part in more detail.

1. Harvesting Sunlight: The Solar Panel

The energy source for this project is a 5V 200mA solar panel. This is a standard, relatively small panel suitable for low-power applications. It captures sunlight and converts it into electrical energy.

2. Storing the Energy: Supercapacitors

Instead of a traditional battery, I'm using two 2.7V 30F supercapacitors connected in series. Supercapacitors are fantastic for this kind of application because they can charge and discharge very quickly and tolerate a huge number of cycles compared to batteries.

  • Series Connection: Connecting the two 2.7V caps in series allows them to handle a higher total voltage (up to 5.4V). However, connecting capacitors in series reduces the total capacitance – in this case, two 30F caps in series behave like a single 15F capacitor.
  • Charging Protection: A diode is connected in series between the solar panel and the supercapacitors. This is crucial! It acts as a one-way valve, allowing current to flow from the solar panel to the supercapacitors, but preventing the stored energy in the supercapacitors from flowing back into the solar panel when the sun isn't providing enough voltage (like at night).
  • Balancing Act: When connecting capacitors (especially supercapacitors) in series, it's essential to ensure the voltage is shared equally across them during charging and discharging. If one capacitor ends up with a significantly higher voltage than the other, it can be damaged or fail prematurely. To address this, I've implemented voltage balancing using 4.8 MegaOhm resistors connected in parallel with each supercapacitor. These resistors help bleed off excess voltage from the capacitor that charges faster, allowing the voltage to equalize across the pair. I followed guidance similar to the techniques described in resources like the Analog Devices document on supercapacitor balancing: https://www.analog.com/en/resources/design-notes/voltage-balancing-techniques-for-series-super-capacitor-connection-for-max3888689.html

3. Stable Power for the Electronics: The Buck-Boost Module

The voltage stored in the supercapacitors will fluctuate depending on how much charge they hold (from near 0V up to ~5.4V). Microcontrollers and sensors need a stable operating voltage. This is where the TPS63802 Buck-Boost module comes in.

A buck-boost converter is special because it can output a stable voltage that is higher than, lower than, or equal to its input voltage. The TPS63802 takes the fluctuating voltage from the supercapacitors and converts it into a stable output voltage. In this project, the output is configured to 3.3V, which is the ideal operating voltage for the ESP32C3 and the BME680 sensor. (The module is versatile and can also be set to output 4.2V or 5V if needed for other applications).

4. The Brains: ESP32C3 Microcontroller

The core of the system is the ESP32C3. This is a modern, low-power microcontroller from Espressif with built-in WiFi capabilities. It's responsible for:

  • Initializing and reading data from the BME680 sensor.
  • Managing WiFi connectivity.
  • Formatting the sensor data.
  • Publishing the data to an MQTT broker.
  • Potentially managing power modes (though that's an area for further optimization).

5. The Sensor: Bosch BME680

For environmental data, I chose the BME680 sensor. This single module from Bosch measures multiple parameters critical for environmental monitoring:

  • Temperature
  • Relative Humidity
  • Barometric Pressure
  • Gas Resistance (related to air quality)

It's a popular and versatile sensor for IoT projects involving air quality and environmental conditions.

The Software: Firmware and Libraries

Bringing the hardware to life requires robust software. The firmware running on the ESP32C3 is based on an open-source project specifically designed for interfacing with the BME680 and connecting via WiFi/MQTT.

The code I'm using is from this repository: https://github.com/manupawickramasinghe/bme680-wifi-sensor-firmware

This firmware is built using the ESP-IDF framework (Espressif IoT Development Framework) and leverages an open-source driver for the BME680: https://github.com/gschorcht/bme680-esp-idf

Here's a summary of the key features provided by this firmware:

  • Multi-Interface Support: It can communicate with the BME680 sensor using either I2C or SPI protocols, offering flexibility depending on how the sensor is wired.
  • ESP32/ESP8266 Support: While I'm using an ESP32C3 (which is compatible with ESP-IDF), the framework has support for various ESP platforms.
  • WiFi Connectivity: It includes functionality for connecting to WiFi networks, including SmartConfig for easy provisioning.
  • MQTT Data Publishing: Sensor readings are published to a specified MQTT broker, making it easy to integrate the data into home automation systems, cloud platforms, or dashboards.
  • Advanced Sensor Configurations: The firmware allows for customization of BME680 settings like oversampling rates for different measurements, configuring the internal IIR filter for stable readings, and setting up heater profiles for the gas resistance measurements.
  • Automated Builds and Testing: The project incorporates CI/CD using GitHub Actions, ensuring code quality and compatibility across different ESP32 variants (a nice touch for project maintainability!).
  • Structured Data Output: Sensor readings are formatted into a JSON payload before being published via MQTT, providing a clean and standardized data format for downstream systems.

This firmware provides a solid foundation, handling the complexities of the BME680 interface, WiFi connectivity, and data transmission, allowing the ESP32C3 to efficiently collect and send the environmental data.

How It All Comes Together

In summary, sunlight hits the solar panel, its energy is directed via the diode into the supercapacitors for storage (kept balanced by resistors). The TPS63802 buck-boost takes the variable voltage from the supercaps and outputs a stable 3.3V. This 3.3V powers the ESP32C3 and the BME680 sensor. The ESP32C3, running the custom firmware, reads data from the BME680, connects to the local WiFi network, and publishes the environmental readings as a JSON message to an MQTT broker.

This creates a self-sufficient system capable of monitoring temperature, humidity, pressure, and air quality, powered entirely by the sun and stored energy.

Conceptual Circuit Diagram Description:

                                 ```
                                 +---------------------+
                                 |    Solar Panel      |
                                 |    (5V, 200mA)      |
                                 +--------|------------+
                                          |
                                         ---
                                         | | Diode (Forward Bias)
                                         ---
                                          |
                                          |+
                                 +--------o--------+
                                 |                 |
                               -----             -----
         R_balance1 (4.8M) || --- C1 (2.7V, 30F)--- || R_balance2 (4.8M)
                               -----             -----
                                 |                 |
                                 +--------o--------+
                                          |-
                                          |
                                 +--------o--------+ VIN (Input to Buck-Boost)
                                 |                 |
                         +-------V-------+         |
                         |  TPS63802     |         |
                         |  Buck-Boost   |------> VOUT (3.3V) ----> VCC_ESP32 & VCC_BME680
                         |  Module       |
                         +-------|-------+
                                 | GND
                                 |
       --------------------------o------------------------- GND
      |                                                    |
      |                                                    |

+---------|----------+ +---------|----------+ | ESP32-C3 | | BME680 Sensor | | | | | | GPIO (SDA) o-----------------------------o SDA | | GPIO (SCL) o-----------------------------o SCL | | | | | | GND o-----------------------------o GND | | 3.3V o-----------------------------o VCC (3.3V) | +--------------------+ +--------------------+


[![](https://blogger.googleusercontent.com/img/a/AVvXsEjEn4JkEzuzIL9i8WYdh2J8RTClQfYG-Pre0n6knbJ_5PNXqoAwLbZTmwZJc8o45uu51aLrDCkIDNJpOZiKtCDPD_nKMMHUAxhwDJO1-dNnmUUY_8j1B4al8tCt_UhffUSmkierB3KNk2iZpV8neFRJ3gCaFj41BNQ6dJgH-2eEcNwJFQY04Z4tb0Q3NNPk)](https://blogger.googleusercontent.com/img/a/AVvXsEjEn4JkEzuzIL9i8WYdh2J8RTClQfYG-Pre0n6knbJ_5PNXqoAwLbZTmwZJc8o45uu51aLrDCkIDNJpOZiKtCDPD_nKMMHUAxhwDJO1-dNnmUUY_8j1B4al8tCt_UhffUSmkierB3KNk2iZpV8neFRJ3gCaFj41BNQ6dJgH-2eEcNwJFQY04Z4tb0Q3NNPk)

  

  
  

Readings  
  

### What the Data Tells Us: Observing Performance

Analyzing the collected data revealed a lot about the system's behavior:

*   Temperature Trends: We see the expected daily warming/cooling and the sensor's fine resolution (small ±0.02 °C noise).
*   Location Impact: A significant peak spike up to ~46°C highlighted a major issue: the sensor wasn't measuring ambient air, but the heat from hot concrete it was placed on.
*   Power Fluctuation Noise: Subtle temperature jitter was more apparent in the morning and evening, likely linked to power instability during low light/charging transitions.

Crucially, the data reporting frequency varied significantly based on light conditions:

*   Morning (7 AM+): Starts slow (~15 min/message), increasing to ~5 min/message.
*   Mid-day (10 AM+): Becomes very frequent (almost every second). Clouds cause it to drop back to 5-15 mins.
*   Evening (After 5 PM): Frequency drops drastically (5-15 mins -> 30 mins), stopping completely after 6:30/7 PM.

This changing frequency is a direct indicator of the system reacting to available solar power/supercapacitor voltage. More light means more power, allowing the ESP32 to operate and transmit more often. Less light means less power, forcing it to slow down or eventually stop.

  
  

[![](https://blogger.googleusercontent.com/img/a/AVvXsEhlxmNY1YwwCFbRxN9U7u4B988iTe3Rl8zp8sl5HBCX39tUNPpdMcmNowXilSwjIcnxs5JM75b_BO53BYeHQ8cnLnBNOJvGxBueIVQmb48HhuJDv9H8VvoWbz1aPX4Cu3RzNzgI2c5r1ACtr5do39W-EN2ZPVDlFyKuj7LkMOfVpoAe-NYKOCkgzAPWmSqA)](https://blogger.googleusercontent.com/img/a/AVvXsEhlxmNY1YwwCFbRxN9U7u4B988iTe3Rl8zp8sl5HBCX39tUNPpdMcmNowXilSwjIcnxs5JM75b_BO53BYeHQ8cnLnBNOJvGxBueIVQmb48HhuJDv9H8VvoWbz1aPX4Cu3RzNzgI2c5r1ACtr5do39W-EN2ZPVDlFyKuj7LkMOfVpoAe-NYKOCkgzAPWmSqA)

  

[![](https://blogger.googleusercontent.com/img/a/AVvXsEixFlBVWJOHPwMjjOknGFH9kzqVmfqHDcF1XdhkqQTFZXOHVA357NgCSpy-soD1bIarJv9ryZ4wc8gnn61s10EIh_Mkezo9VcLxgXp9hyTrP57nDRxPm1GeT7Hc90q8_qLkLz7vJNSfqrAFGtEcKx7gclWE_PKFYxV60OWyyXuB1jCkLKHUkN49FAYpaym-)](https://blogger.googleusercontent.com/img/a/AVvXsEixFlBVWJOHPwMjjOknGFH9kzqVmfqHDcF1XdhkqQTFZXOHVA357NgCSpy-soD1bIarJv9ryZ4wc8gnn61s10EIh_Mkezo9VcLxgXp9hyTrP57nDRxPm1GeT7Hc90q8_qLkLz7vJNSfqrAFGtEcKx7gclWE_PKFYxV60OWyyXuB1jCkLKHUkN49FAYpaym-)

  

[![](https://blogger.googleusercontent.com/img/a/AVvXsEhrK32s7BuZA9WAeo3U_huc8Dm6gPK2TSaQUoAKr0Xd2rohKS4GPy2tUbOuVFyU9i2zE1cHxeLV2DoD30hI1eRsWobRh9-T_OkNsMQ6AW6SWXAtIShmyuaztHq5BoOSigCpTJ_Q-lpNc8ZQRlJSZOfm5HFUw1fU5YJISYquy_peWVObxmEnlgZCGL5Xf8Uc)](https://blogger.googleusercontent.com/img/a/AVvXsEhrK32s7BuZA9WAeo3U_huc8Dm6gPK2TSaQUoAKr0Xd2rohKS4GPy2tUbOuVFyU9i2zE1cHxeLV2DoD30hI1eRsWobRh9-T_OkNsMQ6AW6SWXAtIShmyuaztHq5BoOSigCpTJ_Q-lpNc8ZQRlJSZOfm5HFUw1fU5YJISYquy_peWVObxmEnlgZCGL5Xf8Uc)

  

[![](https://blogger.googleusercontent.com/img/a/AVvXsEiXc6M1WfLDukB70uH5XdLhDN869t2_e805tVLR_8GGtXQM1VFm06M4CYppWFq87TFUP_5si9cYLtNMElftAxEPfPefZgeAkhse8nfVqRq4nseVqg809Hiu80c76dhzCm3E3Or2BivMro74pTILhJ3Sh77S6pbQQGTsDwMsA7bRQe7I3D36Z1QDiBEcECsT)](https://blogger.googleusercontent.com/img/a/AVvXsEiXc6M1WfLDukB70uH5XdLhDN869t2_e805tVLR_8GGtXQM1VFm06M4CYppWFq87TFUP_5si9cYLtNMElftAxEPfPefZgeAkhse8nfVqRq4nseVqg809Hiu80c76dhzCm3E3Or2BivMro74pTILhJ3Sh77S6pbQQGTsDwMsA7bRQe7I3D36Z1QDiBEcECsT)

  
  

[![](https://blogger.googleusercontent.com/img/a/AVvXsEhr9-C7MXRt7ykQpRF9zPZeT9cWFRKqr7yW_JNvkTy-xijCdsFeG81im1dADI2z75D8NFDL_gZnN6W3fbMN1XlW_h_Qe2VV8OPikfG48rF8c_H2dfSCmQN0fix8zB2Bnu5RfV5ziZfM42Oz1Z-5sA54uFttdmOjs3lU4ZCiaLTlcpOgzxPdQHq3EOX46VcI)](https://blogger.googleusercontent.com/img/a/AVvXsEhr9-C7MXRt7ykQpRF9zPZeT9cWFRKqr7yW_JNvkTy-xijCdsFeG81im1dADI2z75D8NFDL_gZnN6W3fbMN1XlW_h_Qe2VV8OPikfG48rF8c_H2dfSCmQN0fix8zB2Bnu5RfV5ziZfM42Oz1Z-5sA54uFttdmOjs3lU4ZCiaLTlcpOgzxPdQHq3EOX46VcI)

  

Current Limitations & What's Next:

While it works, I've hit a few snags I plan to address:

*   Sensor Accuracy: The BME680 is too close to the heat from the ESP32C3, affecting readings. Future: Physically separate the sensor.
*   Placement Heat: Heat builds up when the device sits on a surface. So I just kept it on a wooden Pole.
*   Power Efficiency: The current code isn't optimized for low power, potentially draining the supercaps too fast. Future: Implement Optimize the Electronics, Ensure the Cap balances efficently ESP32C3 Deep Sleep, optimize WiFi connection time, and minimize time spent in active modes.
*   Using More efficient Solar charging Circuit because the Voltage is loss when a diode is used