Pollution Watcher

IoT platform to monitor pollution levels.

GitHub repository

Commit your changes and pull request when a new feature has been added. If any doubt or question you can create an issue and we'll be there to help you.

Problem

Pollution is a real problem in cities from all over the world. For example, Madrid ranks first on the list of European cities with more deaths due to pollution. We need better measurements to know where are the critical areas of pollution to act much intelligently and cost-effectively as possible and with expensive equipements and stations I'm afraid it'll take longer.

How we solve it

We want to solve 3 problems related to that:

  • Price: setting up a pollution station can be really expensive. City councils cannot always afford to spend huge amounts of their budgets. Therefore, it becomes difficult or almost impossible to have many of those stations in the cities so we can get better data on the state of every neighborhood.

  • Scalability: another important aspect is to make the system able to easily increase the number of sensors without changing the physical architecture, making it kind of a plug-and-go solution.

  • Easiness of use: it has to be easy to use and understand.

Technical description

Collect pollution levels from different sensors and create an API to display an interactive map in real-time with the obtained values.

We can use O3, CO, CO2, NO2 or SO2 sensors connected to a Raspberry Pi to obtain the data and upload it to a database such as MongoDB. Then implement an API to represent on an interactive map, for example, using the OpenStreetMap, the location of each station and the data obtained in real-time.

The goal of this project is to make a fully functional platform as cheap as possible.

Elements

  1. MongoDB

  2. Data

    • Temperature

    • Humidity

    • O3 sensor (Ozone)

    • CO sensor (Carbon Monoxide)

    • CO2 sensor (Carbon Dioxide)

    • NO2 sensor (Nitrogen Dioxide)

    • SO2 sensor (Sulfur Dioxide)

get
Get all stations

http://localhost:3000/api/stations
Request
Response
Request
Response
200: OK
[
{
coordinates: "40.4066,-3.6524", // Decimal degrees format
status: [Ok, Warning, Error],
data: {
CO2: "20",
O3: "8",
.
.
.
}
},
{
coordinates: "40.0000,-4.1545", // Decimal degrees format
status: [Ok, Warning, Error],
data: {
CO2: "2000",
O3: "2",
.
.
.
}
}
]

get
Get info from a specific station

http://localhost:3000/api/stations/:station_id/getInfo
Request
Response
Request
Path Parameters
station_id
required
string
ID from station
Response
200: OK
{
coordinates: "40.4066,-3.6524", // Decimal degrees format
status: ["Ok", "Warning", "Error"],
data: {
CO2: "20",
O3: "8",
.
.
.
}
}

get
Get data from a given station's sensor

http://localhost:3000/api/stations/:station_id/:sensor_name
Request
Response
Request
Path Parameters
station_id
required
string
ID from station
sensor_name
required
string
Sensor's name
Response
200: OK
{
CO2: "20"
}

put
Update new coordinate for a given station

http://localhost:3000/api/stations/:station_id/newCoordinates
Request
Response
Request
Path Parameters
station_id
required
string
ID from station
Body Parameters
coordinates
required
string
New coordinates of the sensor
Response
200: OK
{
success: "Coordinates updated successfully"
}