Inspiration

The inspiration for this project stemmed from the global environmental crisis caused by microplastic pollution. These tiny particles are found in oceans, rivers, and even the air, causing harm to ecosystems. However, predicting and tracking their spread is a complex task, influenced by various environmental factors like temperature, humidity, and wind speed. Most current models don’t fully consider the impact of weather on microplastic spread, leading me to explore a solution that integrates real-time weather data to simulate microplastic pollution more accurately.

What it does

This project simulates microplastic pollution levels based on real-time weather data from the OpenWeather API. By analyzing factors such as temperature, humidity, and wind speed, the program calculates and displays the potential levels of water and air pollution caused by microplastics in a given location.

How I built it

  1. Research and Setup: I researched how weather conditions influence microplastic pollution and chose the OpenWeather API to gather real-time weather data.
  2. Coding and Integration: I wrote the program in C, using the cJSON library to parse the JSON data from the API. Weather data (temperature, humidity, wind speed) was then used to simulate microplastic pollution in water and air.
  3. Simulation Logic: The pollution model was designed where water pollution depends on temperature and humidity, while air pollution is influenced by wind speed and humidity.
  4. Testing and Refining: I tested the program with various city names and API keys, fine-tuning the logic to ensure accurate simulations.

Challenges i ran into

  1. API Integration: Fetching and parsing real-time weather data using cURL and the OpenWeather API in C posed several challenges, including handling missing or incorrect data.
  2. Linking External Libraries: Properly linking the cJSON library was tricky, requiring adjustments in file paths and library management.
  3. Pollution Simulation Accuracy: Designing a realistic simulation that effectively translated weather data into pollution levels required iterative adjustments to balance simplicity and accuracy.
  4. Error Handling: Ensuring that the program handled API errors, missing data, and invalid responses without crashing was another key challenge.

Accomplishments that we're proud of

  1. Real-Time Data Integration: Successfully fetching and parsing live weather data from the OpenWeather API in C was a significant achievement.
  2. Accurate Simulation: I created a functional simulation that provides real-time insights into the potential spread of microplastics based on weather conditions.
  3. Practical Application: This project contributes a practical tool that can assist researchers, environmentalists, and policymakers in understanding how weather conditions affect microplastic pollution.

What I learned

  • External Library Integration: I gained experience working with external libraries like cJSON and integrating APIs in C.
  • Weather Data Interpretation: I learned how various weather conditions like temperature, wind speed, and humidity influence pollution levels.
  • Problem-Solving Skills: The project honed our problem-solving skills, especially in areas like error handling and simulation design.
  • Building a Real-World Application: I learned how to turn environmental science into a real-world software tool, bridging the gap between theory and practical application.

What's next for Weather-Driven Microplastic Pollution Simulation

The project could be expanded in several ways:

  • Improved Pollution Models: Incorporating more detailed factors, such as ocean currents or local pollution sources, to enhance simulation accuracy.
  • User Interface (UI): Developing a graphical user interface (GUI) for easier interaction and visualization of the data.
  • Data Logging: Implementing a feature to log and track microplastic pollution over time for better long-term analysis.
  • Global Coverage: Expanding the simulation to cover more global regions with more diverse weather conditions.

Built With

Share this project:

Updates