|
BME688 |
x 2 | |
|
AS3935 |
x 1 | |
|
LTR390 |
x 1 | |
|
PMSA003I |
x 1 | |
|
Noctua 5V Fan |
x 1 | |
|
Anemometer |
x 1 | |
|
Wind Vane |
x 1 | |
|
Rain Gauge |
x 1 | |
|
See BOM for remaining components |
x 1 |
|
arduino IDEArduino
|
|
|
Soldering iron |
|
|
Wire Stripper & Cutter |
|
|
3D Printer (generic) |
|
|
CAD Software |
Esp32 Solar Weather Station-V1
Key Features:
Solar-Powered Operation:
The weather station is equipped with a solar panel, exemplifying eco-friendly functionality. This feature ensures sustained and autonomous operation, making it ideal for remote and off-grid locations.
Comprehensive Sensor Array:
The station incorporates a dual setup of BME688 sensors for precise environmental readings, along with AS3935, LTR390, PMSA003I, anemometer, wind vane, and rain gauge to capture a wide range of meteorological data.
Wireless Connectivity with ESP-Now:
The ESP-Now protocol facilitates seamless and low-latency communication between the weather station and the receiver, allowing for long-range data transmission.
Customization:
The PCBA was designed in a way to allow for customization, and expandability. There are extra I2C connectors, and the used ones can be used with any I2C component.
Assembly and Testing: Solar-Powered Operation:
The weather station is equipped with a solar panel, and lithium polymer battery, providing an uninterrupted power source. This feature ensures sustained and autonomous operation, making it ideal for remote and off-grid locations.
The development process involved a meticulous approach, including hand-drawn schematics, individual sensor testing, code optimization, 3D modeling and printing, and the creation of a custom designed PCBA. Rigorous testing was conducted to ensure the seamless integration of all components, leading to a complete, and reliable system.
Applications:
- Personal Weather Monitoring
- Environmental Research
- Educational Projects
- Agriculture and Farming
Schematics:
ESP32 with PCB Antenna:
The heart of the system, the ESP32 micro controller with a PCB antenna, serves as the central processing unit. This powerful component serves as the central hub for data acquisition, sensor interfacing, and wireless communication through the ESP-Now protocol. The PCB antenna ensures efficient signal reception and transmission, crucial for long-range communication.
I2C Ports (5, 2 Spares):
The I2C ports facilitate communication between the ESP32 and various sensors, providing a standardized and efficient interface. Each I2C port is crucial for connecting sensors like BME688, LTR390, and PMSA003I. The inclusion of two spare I2C ports allows for future expansion or integration of additional sensors.
Battery Charger IC:
Ensuring the optimal charging performance of the onboard battery, the Battery Charger IC is a critical component. This device manages the charging process efficiently, safeguarding the battery against overcharging and contributing to its longevity. The inclusion of a dedicated Battery Charger IC enhances the reliability and sustainability of the solar-powered system.
Battery Protection IC:
The Battery Protection IC acts as a guardian for the onboard battery, shielding it from potential risks such as over-discharge, over-current, and short-circuit conditions. This protective mechanism is integral to ensuring the safe and prolonged operation of the battery, particularly in environments with variable weather conditions.
LDO IC (Low Dropout Regulator):
The LDO IC serves as a vital regulator, stabilizing the voltage supplied to various components of the weather station. This stability is crucial for preventing voltage fluctuations that could compromise sensor readings and the overall performance of the system. The LDO IC enhances the reliability of the power distribution within the weather station.
SPI Port:
The Serial Peripheral Interface (SPI) port is employed for high-speed communication between the ESP32 and the AS3935 sensor. This sensor relies on SPI communication to swiftly transfer data to the micro controller, allowing for real time lightning event analysis.
5V Fan Port:
The 5V Fan Port is dedicated to powering the cooling fan, a crucial component for maintaining optimal operating temperatures within the weather station. By preventing overheating, this port ensures the longevity and reliability of the entire system, especially during extended periods of operation.
RJ11 Connectors for Wind/Rain Sensors:
The RJ11 Connectors serve as standardized interfaces for connecting the wind and rain sensors to the weather station. This modular approach facilitates easy replacement or upgrades to sensors, enhancing the flexibility and future-proofing of the entire system.
USB to UART IC:
The USB to UART IC serves as a bridge between the ESP32 micro controller, and the computer, allowing for convenient programming and debugging of the PCB. This standardized interface enhance the ease of firmware updates and troubleshooting, providing a streamlined development process.
USB Ports:
The USB Ports serve a dual purpose in the schematic. Both provide power to the ESP, and are stepped down to 3.3V. One is used for the Solar panel, which runs to the Battery, and Battery Protection/Charging Circuit. While the other is used for UART and programming, ensuring ease of use when updating code.
Voltage Monitoring:
To ensure a precise and consistent power source, two voltage dividers have been integrated into the schematic. The first voltage divider is dedicated to monitoring the battery voltage, providing valuable insights into its charge status. The second voltage divider monitors the solar panel voltage, allowing real-time tracking of solar input. These dividers enable the ESP32 to gauge the power levels, contributing to efficient power management and allowing the weather station to adapt to varying environmental conditions.
Sensor Power Circuit:
The Sensor Power Circuit introduces a dynamic control mechanism for managing power consumption of the I2C sensors. Utilizing a combination of a MOSFET and transistor, this circuit offers the ability to selectively turn the sensors on and off. During periods of inactivity or low power availability, the sensors can be powered down to conserve energy. This feature enhances the overall energy efficiency of the weather station, ensuring optimal utilization of resources while maintaining the capability to collect data when needed.
Sensors:
BME688:
The BME688 sensor is a versatile environmental sensor that combines capabilities for measuring temperature, humidity, pressure, and gas resistance. It is a digital sensor with an I2C interface, providing accurate and calibrated readings for each parameter. The gas resistance feature allows for air quality monitoring, making it a valuable component for assessing environmental conditions. The BME688 plays a crucial role in providing comprehensive data for a holistic understanding of the weather.
LTR390:
The LTR390 is a versatile digital sensor that serves as both an ambient light sensor and a UV index sensor. With its I2C interface, this sensor provides accurate and calibrated readings for both light intensity (lux) and UV index. The LTR390 contributes valuable data to the weather station, offering insights into ambient lighting conditions and the intensity of ultraviolet (UV) radiation. This dual functionality enhances the station's ability to monitor environmental parameters, making it a valuable component for assessing both daylight conditions and potential exposure to UV radiation.
PMSA003I:
The PMSA003I is a highly capable particulate matter (PM) sensor designed to provide comprehensive data on air quality. This digital sensor employs a laser scattering principle to measure PM1.0, PM2.5, and PM10.0 concentrations in both standard and environmental units. Additionally, the PMSA003I provides information on particulate matter per 0.1L of air, categorized into 0.3μm, 0.5μm, 1.0μm, 2.5μm, 5.0μm, and 10.0μm size bins. This detailed categorization allows for a granular analysis of particulate matter distribution, offering valuable insights into the composition and potential health implications of the air. The PMSA003I significantly enhances the weather station's capability to monitor and assess air quality, making it an essential component for a holistic understanding of environmental conditions.
AS3935:
The AS3935 is a lightning sensor that detects the presence of lightning activity in the vicinity. It operates using a proprietary algorithm to distinguish between different types of disturbances and provides information such as lightning distance estimation and storm intensity. This digital sensor enhances the safety features of the weather station by providing real-time lightning data, enabling timely alerts and precautionary measures.
Wind Vane:
The Wind Vane is an analog sensor that measures the direction of the wind. It consists of a vane that rotates with the wind, and its position is converted into an analog voltage output. This analog signal is then translated into a specific wind direction. The Wind Vane provides crucial information about wind patterns, contributing to a comprehensive understanding of local weather conditions.
Anemometer:
The Anemometer is an analog sensor designed to measure wind speed. It comprises cups that rotate with the wind, generating an analog voltage output proportional to the wind speed. This analog signal is then used to quantify the wind speed. The Anemometer complements the Wind Vane, providing essential data for a thorough analysis of wind-related parameters in the weather station.
Rain Gauge:
The Rain Gauge is a sensor that measures the amount of precipitation over a specific period. It operates on a tipping bucket mechanism, where each tip of the bucket corresponds to a certain amount of rainfall. The Rain Gauge generates a digital signal, counting the tips and providing data on rainfall accumulation. This sensor is crucial for monitoring and recording precipitation levels, contributing to a comprehensive overview of weather patterns.
Power Components:
Solar Panel:
The Solar Panel is a critical power source for the weather station, converting solar energy into electrical power. This specific panel operates at 6V with a power rating of 2W, providing a sustainable and renewable energy solution. The solar panel serves as the primary source of power for charging the onboard Li-Po battery, ensuring continuous operation even in remote or off-grid locations.
Li-Po Battery:
The Li-Po (Lithium Polymer) Battery is a rechargeable energy storage component with a voltage rating of 3.7V and a capacity of 2500mAh. This compact and lightweight battery serves as an energy reservoir, storing excess power generated by the solar panel. The 3.7V output aligns seamlessly with the power requirements of the weather station components, and the 2500mAh capacity ensures extended operation during periods of low or no solar input.
Battery Charger IC:
The LP4060B5F is a Battery Charger IC specifically designed for Li-Po batteries. This IC manages the charging process efficiently, ensuring optimal charging rates and preventing overcharging, which can damage the battery. The LP4060B5F contributes to the longevity and reliability of the Li-Po battery, allowing for a sustainable and controlled charging cycle.
Battery Protection IC:
The AP6685 is a Battery Protection IC responsible for safeguarding the Li-Po battery against various risks, including over-discharge, over-current, and short-circuit conditions. This protection mechanism ensures the safe and reliable operation of the battery, especially in environments with fluctuating solar input. The AP6685 enhances the overall durability and performance of the power storage system.
LDO Regulator IC:
The XC6220B331MR is a Low Dropout (LDO) Regulator IC designed to stabilize and regulate the voltage supplied to various components of the weather station. With a voltage output of 3.3V, this LDO regulator ensures a consistent and reliable power source, preventing voltage fluctuations that could affect the performance of sensitive components. The XC6220B331MR contributes to the overall stability and efficiency of the power distribution within the weather station.
PCB Design Process:
The journey from schematic design to a fully assembled Printed Circuit Board Assembly (PCBA) for the Weather Station is a meticulous process. Leveraging the detailed schematic, the design phase involved translating the conceptualized circuitry into a functional and manufacturable layout. The schematic provided a comprehensive blueprint, specifying the connections, components, and their interrelationships.
Schematic Translation:
The schematic served as the foundation for the PCB design. Each component's placement, connection traces, and power distribution were carefully translated into the PCB layout. The design process prioritized optimal component placement for efficient signal flow, taking into account the spatial constraints of the PCBA.
Footprint Selection:
Selection of appropriate component footprints was crucial to ensure compatibility with the chosen components. The footprints define the physical space and connections required for each component on the PCB, contributing to the overall layout and functionality.
Routing and Tracing:
Routing involved the creation of pathways (traces) on the PCB to establish connections between components. Attention was given to minimizing signal interference, optimizing signal integrity, and ensuring efficient power distribution across the board.
Gerber File Generation:
The design process culminated in the generation of Gerber files – and subsequently ordering fully assembled PCBA's.
Feel free to download the Gerber files for this PCB, and update, or customize to your specific needs.
Enclosure Assembly:
All components were designed by me, using CAD, and are printed using white PETG+ material, emphasizing the project's commitment to the best environmental practices. M4 heat inserts are employed at each layer to ensure robust connections between parts, enhancing the overall structural integrity. The design choice of a Stevenson Screen was determined to be the best for striking a balance between exposing sensors to the environment while providing essential protection. This comprehensive assembly process involves nine 3D-printed parts, each playing a specific role in the functionality and aesthetics of the weather station.
Base:
The Base serves as the foundational element, designed to securely attach the weather station to a pole for mounting. It provides stability and support, forming the anchor upon which the entire assembly rests.
Fan Layer:
Attaching to the Base, the Fan Layer constitutes the bottom section of the Stevenson Screen. This layer serves as the mounting point for the 5V fan, essential for regulating temperatures within the weather station and ensuring optimal operating conditions for electronic components.
BME Layer:
Part of the Stevenson Screen, the BME Layer is specifically crafted to house and mount the BME688 sensor. Positioned strategically, this layer ensures accurate readings of temperature, humidity, pressure, and gas resistance, contributing to the station's comprehensive environmental monitoring capabilities.
PMSA003I Layer:
Also part of the Stevenson Screen, the PMSA003I Layer is dedicated to hosting the PMSA003I particulate matter sensor. This layer plays a crucial role in monitoring air quality, providing data on fine particulate matter concentrations for a more holistic understanding of environmental conditions.
AS3935 Layer:
Situated at the top of the Stevenson Screen, the AS3935 Layer is designed to mount the lightning sensor (AS3935). This strategic placement ensures unobstructed detection of lightning activity while providing additional protection to the sensor.
PCBA Enclosure:
The PCBA Enclosure represents a pivotal component that sits atop the Stevenson Screen. This enclosure houses the PCB assembly, Li-Poly Battery, and acts as a central hub where all cables congregate. Its design allows for efficient cable management and protection of critical electronic components.
Enclosure Lid:
The Enclosure Lid serves as the protective cover for the PCBA Enclosure. This lid incorporates a mount for the LTR390 light sensor on its underside. Additionally, a small clear piece of acrylic allows UV and ambient light to reach the sensor, optimizing its performance. The Enclosure Lid also serves as the mounting platform for the Solar Panel, ensuring maximum exposure to sunlight.
Rain Gauge Arm:
Attached to the side of the PCBA Enclosure, the Rain Gauge Arm plays a crucial role in mounting the Rain Gauge sensor. This strategic positioning allows for accurate measurement and recording of precipitation levels, contributing valuable data to the weather station.
Wind Sensors Arm:
Completing the assembly, the Wind Sensors Arm attaches to the opposite side of the PCBA Enclosure compared to the Rain Gauge Arm. This arm serves as the mounting point for both the Anemometer and Wind Vane, enabling the measurement of wind speed and direction for a comprehensive weather assessment.
Additional Assembly Photo's:
First 3 layers, viewed from top, showing cables, fan, and BME(ignore my part labels)
PCBA Installed(Bat in dedicated spot underneath):
PCBA Enclosure with both arms attached:
All the Stevenson Screen layers assembled, view from the side and above:
Solar Panel Mounted to the Lid, and a closeup of the LTR390's acrylic cover:
All parts, partially assembled:
Weather Station Fully Assembled, view from the side and from above:
Code Breakdown:
The sender code is the brains behind a sophisticated Weather Station. The code is designed to collect data from the sensors discussed previously. The collected data is then wirelessly transmitted to a receiver ESP32 using the ESP-NOW protocol. No calculations, or transformation of data is done on the sender side of the code. The receiver ESP32 handles all the data processing and functions for extracting additional weather parameters from the sensor data.
Libraries Used:
The code leverages several libraries to interface with different sensors and communication protocols:
- Adafruit_Sensor: Provides a common sensor abstraction layer for Adafruit sensors.
- Adafruit_BME680: Interfaces with the BME680 sensor for environmental readings.
- Adafruit_LTR390: Enables communication with the LTR390 sensor for UV and ambient light sensing.
- Adafruit_PM25AQI: Facilitates communication with the PM25AQI sensor for air quality monitoring.
- SparkFun_AS3935: Interfaces with the AS3935 Lightning Detector from SparkFun.
- SparkFun_Weather_Meter_Kit_Arduino_Library: Manages the weather meter kit components for wind and rainfall measurements.
- esp_now: Enables ESP-NOW communication between ESP32 devices.
- WiFi: Provides functionality for Wi-Fi communication.
Sensor Objects:
Instances of sensor objects are created for each type of sensor used in the project. These objects facilitate communication with the respective sensors and include Adafruit_BME680 for the BME680 sensor, Adafruit_LTR390 for the LTR390 sensor, Adafruit_PM25AQI for the air quality sensor, and SparkFun_AS3935 for the Lightning Detector.
Pin Definitions:
The code defines pin numbers for various components, including the rain gauge, wind direction, wind speed, lightning interrupt, and SPI chip select. These pins are crucial for sensor data acquisition and control.
Constants and Variables:
The code sets constants for sea level pressure, PID controller parameters (Proportional, Integral, Derivative gains), and other constants related to power, voltage sensing, and sensor configurations. Variables such as previousError and integral are used in the PID controller.
Functions:
setupLightningDet():
Initializes and sets up the AS3935 Lightning Detector. It includes configuring parameters such as noise floor, watchdog threshold, spike rejection, and lightning threshold.
OnDataSent():
A callback function triggered when data is sent via ESP-NOW. It prints the status of the last packet send operation.
Setup Function:
The setup() function is responsible for the initial configuration of various components and sensors. It includes:
- Initializing pins and setting their modes.
- Initializing sensors such as BME680, LTR390, AS3935, and the weather meter kit.
- Configuring the ESP-NOW communication parameters.
- Adding the receiver ESP32 as a peer for communication.
Loop Function:
The loop() function is the core of the code, responsible for continuous operation. It performs the following tasks:
- Reads sensor data, including temperature, humidity, pressure, UV, ambient light, air quality, and lightning detection.
- Implements PID control for adjusting fan speed based on temperature and humidity thresholds.
- Reads solar and battery voltages, entering deep sleep mode if the battery voltage is low.
- Sends the collected sensor data to the receiver ESP32 using ESP-NOW communication.
- Delays the loop for an appropriate interval before the next iteration.
The sender code is a well-organized piece of software that orchestrates the functionality of various sensors and ensures seamless wireless communication. It is a testament in integrating diverse components into a cohesive and functional system for weather monitoring. The code not only captures environmental data but also showcases efficient power management strategies, making it a robust and sustainable solution.
**Please see github repository for full code. linked below at bottom of pages.
Problems Faced and Solutions:
1. ESP-Now and WiFi Simultaneity:
Problem:
Integrating ESP-Now for communication between the weather station sender and receiver posed a challenge due to the inherent limitation of using WiFi simultaneously. This meant that the receiver could not access the internet when ESP-Now was initialized.
Solution:
To overcome this limitation, I optimized the code to allow the seamless switching between WiFi and ESP-Now functionalities. By carefully orchestrating when each module is active, the code ensures that WiFi is utilized when internet access is needed, and ESP-Now takes precedence when communicating sensor data. This dynamic allocation of resources maximizes the efficiency of both communication modes.
2. Power Optimization and Battery Management:
Problem:
Ensuring continuous operation and preventing the battery from draining excessively during periods without sunlight presented a power optimization challenge. The goal was to implement a strategy that would keep the battery charged and efficiently manage power consumption.
Solution:
To address power concerns, I implemented voltage dividers to constantly monitor the voltages of the solar panel and the battery. When the battery voltage drops below a certain threshold, the ESP32 enters a deep-sleep mode to conserve power until the battery is adequately charged. Additionally, a sensor power switch was incorporated, allowing selective activation of sensors only when necessary. This intelligent power management system ensures the longevity of the battery life.
3. PCB Design and Component Placement:
Problem:
Optimizing the PCB design for efficient component placement and ensuring compatibility with specific components posed a challenge. Understanding the requirements of each component and arranging them strategically on the PCB was crucial for a streamlined and compact design.
Solution:
To address this challenge, extensive research and reading were conducted to comprehend the specifications and requirements of each component. This knowledge guided the placement of components on the PCB, optimizing their arrangement for minimal interference and optimal performance. The result is a well-organized and compact PCB design that aligns with the project's objectives.
Lessons Learned:
The project's journey has been marked by valuable lessons in overcoming technical challenges. The solutions implemented not only addressed specific issues but also enriched my understanding of ESP32 capabilities, power management strategies, and the nuances of PCB design. These experiences have contributed to a more holistic skill set, enabling me to tackle diverse challenges in future projects.
Future Plans (V2):
Building on the insights gained from addressing challenges, future iterations of the project (V2) will prioritize a more streamlined and compact design. The following aspects will be central to the refinement process:
1. Enclosure Design:
Efforts will be directed towards optimizing the enclosure to achieve a more compact form factor. Leveraging advancements in 3D modeling and printing techniques, the goal is to create a weather-resistant housing that not only enhances aesthetic appeal but also reduces the overall footprint of the weather station. The Stevenson Screen design will be revisited, exploring innovative solutions for space efficiency without compromising sensor accessibility and protection.
2. PCB Design:
The PCB layout will undergo further optimization to accommodate a reduction in size while maintaining an efficient arrangement of components. Careful consideration will be given to the placement of sensors, microcontrollers, and other peripherals to ensure a compact and well-organized configuration. Advanced PCB design tools and methodologies will be employed to achieve a harmonious integration of components, contributing to an overall reduction in the dimensions of the weather station.
3. Enhanced Portability:
The emphasis on compactness extends to enhancing the portability of the weather station. The V2 iteration aims to strike a balance between reduced size and increased portability, making it easier for users to deploy the station in various environments. This portability aspect aligns with the evolving needs of users who may seek to deploy the weather station in diverse locations for data collection.
4. Efficiency and Sustainability:
Beyond size reduction, future developments will explore ways to enhance energy efficiency and sustainability. This includes investigating new energy harvesting methods and incorporating eco-friendly materials in both the enclosure and PCB manufacturing processes. The objective is to align the project with principles of environmental consciousness and efficient resource utilization.
As the project evolves into its next iteration, the focus on compactness, efficiency, and sustainability will drive innovations in both enclosure and PCB design.
Open-Source Collaboration:
As before, all project files are open for download, encouraging collaboration and knowledge sharing within the maker community. The challenges faced and solutions implemented serve as valuable insights for fellow enthusiasts and contribute to a collective pool of expertise. Questions, suggestions, and collaborative efforts are welcome as we explore the ever-expanding realm of DIY technology.
Esp32 Solar Weather Station-V1
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(4)
- Likes(4)
- YY Mar 17,2024
- grego33 Mar 11,2024
- Mitko Petrovik Feb 11,2024
- Engineer Jan 24,2024
- 2 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
8usability
-
8creativity
-
5content
-
8design
-
8usability
-
7creativity
-
5content
More by Daniel Scalzo
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
153 1 1 -
-