Global warming, also referred to as climate change, is the observed century-scale rise in the average temperature of the Earth's climate system and its related effects.
In 2013, the Intergovernmental Panel on Climate Change (IPCC) Fifth Assessment Report concluded that "It is extremely likely that human influence has been the dominant cause of the observed warming since the mid-20th century. The largest human influence has been the emission of greenhouse gases such as carbon dioxide, methane and nitrous oxide.
To try to increase people's awareness I thought of a simple IoT device that compares the temperature and CO2 emissions with those of 1-10-50 years before. This comparison is possible thanks to the existence of online databases that keep the data related to the measurements of the last centuries.
the first step of the project is to obtained the co2 level data. To do this, I choose to use the HTTPThing app from thingspeak, that allow to fetch data from every site and make it disponible trough an API.
The MCU that i choose to use is the well know ESP8266. Thanks to the ESP8266HttpClient library i can simply send a GET request to the thinghttp link and receive the daily data from www.co2.earth.
#include <ESP8266WiFi.h>#include <ESP8266HTTPClient.h>constchar* ssid = "MYWIFI";
constchar* password = "*******";
voidsetup(){
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting..");
}
}
voidloop(){
if (WiFi.status() == WL_CONNECTED) { //Check WiFi connection status
HTTPClient http; //Declare an object of class HTTPClient
http.begin("http://api.thingspeak.com/apps/thinghttp/send_request?api_key=YAOX15VANMLMYH4S"); //Specify request destinationint httpCode = http.GET(); //Send the requestif (httpCode > 0) { //Check the returning code
String payload = http.getString(); //Get the request response payload
String todaydate = payload.substring(62,76);
String todayco2 = payload.substring(118,128);
Serial.print(todaydate);
Serial.print(" CO2 Level: "); //Print the response payload
Serial.println(todayco2);
httpCode == 0;
}
http.begin("http://api.thingspeak.com/apps/thinghttp/send_request?api_key=3TKGGW5Z5CHH7G0S"); //Specify request destination
httpCode = http.GET(); //Send the requestif (httpCode > 0) { //Check the returning code
String payload = http.getString();
String agodate = payload.substring(36,50);
String agoco2 = payload.substring(92,99);//Get the request response payload
Serial.print(agodate);
Serial.print(" CO2 Level: "); //Print the response payload
Serial.println(agoco2); //Print the response payload
}
http.end(); //Close connection
}
delay(30000); //Send a request every 30 seconds
}
However co2.earth only maintain data histories about last year. So for the decade CO2 data i will use a text file downloaded from noaa server that contain world CO2 data from start of 20th century.
I like when projects are aimed to help. Climate change is a very important problem that needs our active action. I research this topic for my college project and use a great variety of resources, including https://envrexperts.com/ to get more materials. These free essays on the environment contain interesting thoughts on how to reduce the level of global warming, pollution, and so on. People need to do something and it's great that there are such projects.
I like when projects are aimed to help. Climate change is a very important problem that needs our active action. I research this topic for my college project and use a great variety of resources, including https://envrexperts.com/ to get more materials. These free essays on the environment contain interesting thoughts on how to reduce the level of global warming, pollution, and so on. People need to do something and it's great that there are such projects.