Close
0%
0%

City Air Quality

Developing hardware to track and assert the air quality in a city based on IOT topology.

Similar projects worth following
Environmental surveillance is a big thing, important to our health and to the integrity of the world we live in. To optimise the air quality assertion, we need better resolution (more monitoring units deployed) and better sensors. To help resolution, sensors will have to conquer more in the space of wearables but also be part of the places we live in, and that includes cities. This project will document an experimental setup to track pollution, ultimately turning to a device that can be used in cities, based on IOT topology.

This project is a solution to monitor air quality parameters in Cities, compliant to international requirements on computing the Air Quality Index. The hardware is an IOT device equipped with a laser light scattering sensor for Particulate Matter PM2.5 and PM10, and 4 electrochemical sensors for Carbon Monoxide, Nitrogen dioxide, Sulphur Dioxide and Ozone. These 6 parameters are recognised as having a significant health impact by multiple countries, and are part of processes surrounding us in our daily activities. The connectivity is implemented via Wifi and LoraWAN, with two separate PCB versions. The connectivity fits multiple usage scenarios in city deployments.

The problem

Air pollution is the single largest environmental cause of premature death in urban Europe and transport is the main source. The 2008 Air Quality Directive, now under review, obliges member states to cut exposure to fine particulate matter by an average of 20% by 2020, based on 2010 levels.
The National Emissions Ceiling Directive caps some emissions including particulate matter (PM) and nitrogen dioxide (NOx) at national level. A revised version of the directive is as of 2016 under scrutiny by the Council of Ministers and European Parliament. Across the EU in 2013, nitrogen dioxide (NO2), which is mostly produced by traffic, caused 68,000 premature deaths. The Dieselgate scandal exposed how Volkswagen had gamed NO2 emissions tests.
Ozone (O3) killed 16,000 and small particulate matter (PM2.5) caused 436,000 deaths in the same year. PM2.5 particles, microscopic specks of dust and soot caused by burning fossil fuels, can enter the lungs and bloodstream.
health_effects_banner_a3Air pollution has different particulate matter (PM) components – smoke, dirt and dust form coarse particles known as PM10 and metals and toxic exhaust from smelting, vehicle exhaust, power plants and refuse burning forming fine particles called PM2.5.


The CITY AIR QUALITY project

After several iterations, I have designed a product with 4 electrochemical sensors (4-series) for the 4 gases, and a laser scattering sensor for the fine particles. All sensors are individually calibrated in a test lab, and bare a unique serial number. Calibration data is inserted in the system, and used before presenting the data results. The electrochemical sensors have a lifespan of 2 years, so I designed the PCB with sockets where these sensors can be installed without soldering, so they can be serviced easily.

LoraWAN connectivity

This RF standard operating in 868MHz(EU) / 915MHz(US/Israel/Australia) offers low bandwidth long range data links at the cost of very low power. I had some experience with the RN2483 / RN2903 from Microchip so I went for those. While the specs indicate 15km in open field, ranges as high as 30km are achievable in some cases. The low bandwidth is sufficient for IOT applications, in this case sending 6 air quality parameters over the wireless link.

The Backend

The data goes to a server where it is modified against the calibration parameters, stored in a database for each sensor, individually, according to the test lab calibration sets. Therefore servicing sensors at the end of their life requires replacing them on the PCBs and changing the calibration numbers in a dedicated dashboard. This makes things very easy.

The server stores all data and offers it via a RESTful API interface. Plotting charts, doing stats or building City Dashboards becomes easy this way.

The final product

Here is the final product including the aluminium enclosure I designed, the PCB and the sensors mounted in the sockets:


The first prototype

This was a test device, to test sensors in the real environment, collect large amounts of data and see it linked to pollution in various places. The device was installed on a car, thus it was tested on very large distances, gathering relevant data. One such example was my trip to Ciudanovita, presented in one of the project logs.

The prototype hardware

The plan is to use a VOC air sensor...

Read more »

  • 1 × atmega328p Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × ams1117 3.3V Power Management ICs / Linear Voltage Regulators and LDOs
  • 1 × SMD 2.1mm DC Jack
  • 1 × 8MHz 3225 SMD crystal
  • 1 × MP1584

View all 14 components

  • The Dashboard

    Radu Motisan11/11/2017 at 09:52 0 comments

    It is still work in progress, but last time I was busy building a new dashboard for the CITY units, one that uses the existing API to iterate the available sensor streams, than plot them in a visually appealing form.

    This dashboard shows all gases, as measured by the CITY hardware. The charts are dynamic and synchronised: You can zoom one and the rest will follow, to make it easy to check the data.

    I also need to add some horizontal bars to indicate the legal limits for air quality. This way we'll understand the numbers easier.

    More on www.uradmonitor.com/products

  • The sensor calibration parameters

    Radu Motisan05/14/2017 at 14:25 1 comment

    Calibrated sensors

    The electrochemical sensors used in this project, are individually calibrated in a test lab. They have a unique identifier, and so, for each - calibration data is generated after tests in the controlled environment.

    Besides the 4 sensors that I selected for this project, there are other sensors for a wide range of gases. This is one of the reasons I designed the PCB with sockets, for interchangeable sensors. The other reason is that electrochemical sensors have a lifespan of about 2 years. That is because they work in a similar way to electrochemical batteries - they generate a current when the target gas is present. So with a limited lifespan, the maintenance of these units needs to be made as simple as possible - for a practical reasons considering city level deployments.

    List of gases with compatible sensors

    Getting back to the list of gases for which there are compatible Series-4 sensors:

    Carbon Monoxide CO (0-1000ppm), Oxigen O2 (0-25%vol), Ammonia NH3 (0-100ppm), Hydrogen Sulphide H2S (0-100ppm), Nitrogen Dioxide NO2 (0-20ppm), Hydrogen Fluoride HF (0-10ppm), Sulphur Dioxide SO2 (0-20ppm), Chlorine CL2 (0-10ppm), Ozone O3 (0-20ppm), Ethylene C2H4 (0-100ppm), Formaldehyde CH2O (0-10ppm), Ethylene Oxide ETO (0-20ppm), Hydrogen H2 (0-1000ppm), Hydrogen Chloride HCL (0-20ppm).

    Now that the chemistry lesson is over, I'll take you to another favourite hobby of mine, software.


    Calibration parameters

    The datasheet indicates two ways of accessing the data. There is the Digital format that comes with registry data that compensates the readings on the fly, and the raw analogue output where the compensation parameters need to be added to the data.

    First option is the easy way, but for flexibility I went for the second. Raw data is being obtained from the 4 sensors and sent to the server. There, a database holds the unique sensor identifiers and the calibration parameters for each.

    The calculations are easy:

    Finally when you call the RESTFul API to see the actually readings from the unit, you get the final data, with the calibration parameters added to the result. Perfectly calibrated sensor readings.

    The advantage to this is that maintenance work is reduced to a minimum: in case you need to replace old sensors, you just insert them in the sockets, then change the numbers on the server, in a simple dashboard.

    The same approach should you want to configure a detector unit to work with different sensors, any from the list will work, you can even use 4 sensors for the same gas, for maximum redundancy.

  • Putting everything together

    Radu Motisan05/14/2017 at 13:55 0 comments

    The first assembled PCBs were a beauty:

    The sensors fitted the sockets perfectly. After spending a few hours trying to access sensor data, it became clear that unfortunately, the device didn't work. On each of the 4 electrochemical sensors, the voltage output was a constant value, no matter the fluctuations in test gases (SO2).

    What happened was that I did a mistake when drawing the sensor footprint for the PCB design: the positions were mirrored, so the pins were all wrong. A stupid mistake that rendered the PCBs useless.

    I had no choice but to start over again. The PCBs were redesigned with the proper sensor footprint, and some additional improvements I had in mind.

    This time the performance was as expected. Putting everything together was fun - the PCB connectors and the aluminium enclosure holes fitted perfectly:

    Looking good so far!

  • The aluminium enclosure

    Radu Motisan05/14/2017 at 12:59 3 comments

    To finalise this product I had to design an enclosure and I opted for anodised aluminium profiles. These can be cut to various lengths to match the PCB, you just need to make sure that the other sizes fit. Luckily the manufacturers offer a large set of profiles to choose from, and I was able to find one that matches the height of the sensors, but also gives some space at the bottom where the copper sockets are soldered, protruding the PCB limit.

    Using the existing profile as a starting point, I had to identify PCB position and sensor sizes to do the holes, logos, and other silkprint elements. I opted for a black anodised aluminium finish with a white silkprint. As the design includes an air pump, holes for air intake and exhaust where added:

    Due to the shape of the PCB, the width of the aluminium profile became the length of final enclosure. This was sent to the factory for machine processing, mainly cutting and cnc milling. About 2 weeks later, the first enclosures were ready:

    These came out very nicely, and exceeded my initial expectations. The thickness of the aluminium and the proportions of the box give a nice overall feel to this product.

  • Designing the product

    Radu Motisan05/11/2017 at 18:15 0 comments

    This construction started as a prototype, and I used it a lot in its initial form. I decided to make the next step, and use the field data and sensors tests to build a product out of them. For air pollution in cities, I checked the requirements on Air Quality Index and it became evident that many international evaluation standards go for 6 main parameters. These are Ozone, Carbon Monoxide, Sulphur Dioxide, Nitrogen Dioxide, Particulate Matter PM2.5 and Particulate Matter 10.

    As I said my sensor homework was done, so I knew exactly what to go for. I designed a board with 6 electrochemical sensors and a laser light scattering PM sensor. The 6 electrochemical sensor slots would allow two additional gases to be detected, optionally.

    Then, checking the BOM it was clear the costs are too high. 6 4Series electrochemical sensors in a box is not exactly cheap. And talking about the box, that became rather large too. So I removed 2 slots to meet just the Air Quality index requirements. Next was a few hours of fun, doing the PCB traces manually (like I always do):

    As this will have built in Internet connectivity, the final device will be an IOT detector. I went for two connectivity options, one was LoraWAN and the second Wifi, to cover multiple usage scenarios in City deployments across various ranges and with different power requirement. Here is the LoraWAN:

    And this is the Wifi variant:

    I used some interesting new tools for part of the design, the online tools from EasyEDA. I also used their services to order the PCBs, as my DIY toner transfer attempts failed on this.

  • Ciudanovita, the people and the uranium

    Radu Motisan05/11/2017 at 17:35 2 comments

    I had the chance to visit the former uranium mining colony of Ciudanovita in Romania, while having the detector installed on my vehicle. This is a story of what I saw, combined with the data recorded by the device.

    Every gain comes at a price, and so the comfort of technology claims its cost at some other end. For nuclear energy – what it gives is known, modern living conditions, heating, illumination, transportation and all in one the civilised world as we know it. Yet what it takes sometimes remains in the shade, like what an environmental mess irresponsible uranium mining can be, and how hard it is to clean that up?

    Ciudanovita in March, 2017

    Ciudanovita, in the Caras-Severin county, is one such example. Sadly, it’s a mix of grey Romanian history under Russian occupation, radioactive contamination of a piece of heaven and the struggle for a normal life of those that are still living there.
    Ciudanovita surroundings

    Under Russian occupation, the Soviets had interest in this area. After the initial prospections in the 1950s, they began uranium ore mining in the 1952, using their own equipment and local workers. This lasted up until 1957 when the SOVROMs were disbanded. Then the Romanians continued the operations until 1964 finalising the country’s debts of war to Russia. All this time, the uranium ore was simply loaded in containers and shipped to the East by train. The mining required signifiant resources, and as a direct result the colony of Ciudanovita grew in population, reaching as high as 35000 people. There was a local hospital, a cinema, restaurants, places with live music and draft beer and many shops.
    Ciudanovita today

    When one approaches the area today, will first notice the difficult access. The roads are poor, unmaintained. The Geiger counter will sound its alarm in various places while getting closer to the former mines.
    The colony is in the immediate vicinity of the mines. The problem is people are living in a valley, and one of the slopes right next of the village is where the ore residue has been deposited. It is obvious this forms a channel for rain water to infiltrate the groundwater, not to mention the strong winds blowing contaminated fine dust over the populated area at only a few hundreds of meters in the valley. The surface readings in the residue area, called “Golgota” are rather high, surpassing 1uSv/h in many places.
    Highly radioactive uranium ore residue dumps nearby the populated area

    Elevated readings on the Gamma Scout Geiger Counter

    Ignorance or neglijence, the mining project cared little about keeping the place clean. Radioactive ore was carelessly loaded in trains, but from the mine to the train station, some of it also padded the roads and the surroundings. Some of that it is still there, throwing invisible ionising radiation to anything in the area.
    Contamination map

    Readings detail in the uranium ore residue dumps

    It was bad enough to see a village in poverty due to its main source of income – mining collapsed. There are so many similar areas in Romania, but for this one in particular, add the dangerous invisible enemy lurking around, for a nightmarish scenario. Those that have their homes there live it everyday. There were some plans to clean the area, but no proper action was taken so far.

    As for the device, this short trip proved its utility.

    Additional resources:
    Fosta mina de uraniu de la Ciudanovita neecologizata nici acum
    Ciudanovita locul din Romania unde radiatiile de uraniu depases de 100 de ori limita de alerta
    Moartea poarta numele de Ciudanovita
    Marturisiri din Ciudanovita

  • The first results

    Radu Motisan11/09/2015 at 00:34 1 comment

    To collect enough data I drove for a few hours across the city of Timisoara. Thanks to my beautiful assistant I got to have a demo video of the entire procedure:


    To better analyse the results of this first test, I had to built a web interface that plots all data across an OpenLayers map of Timisoara. While the sensor unit only features 5xSBM19 for sensitive radiation detection, a BME280 sensor mounted inside the unit's case (for temperature, barometric pressure, humidity), a BME680 sensor (temperature, barometric pressure, humidity, VOC) mounted inside the air tube, a Sharp GP2Y1010 dust sensor, the smartphone also adds GPS details including latitude, longitude, altitude and speed. All this together results in valuable information regarding the environmental quality, mapped geographically to exact location. The data can be accessed on the interactive map.
    city_airq_webdata_1city_airq_webdata_2The Dust and VOC parameters need some additional work, so as said, this entire project so far is experimental, and has the purpose of identifying the starting point for providing this kind of environmental surveillance at a city level. A very interesting discovery is a raised radiation measurement, in the North side, where increasing readings are consistent to approaching to a radiation source, while departing the area shows the expected decrease, unlike an isolate spike in readings. See the second photo below for a closer look:
    city_airq_webdata_3city_airq_webdata_4
    I'm definitely curious about the elevated radiation readings in that area, while the numbers are not big, there must be a cause, especially given the increased detection distance. Here the sensitive Geiger detector played its role. I will research the phenomenon further and report back with more details.

  • The software

    Radu Motisan11/09/2015 at 00:30 0 comments

    There are three software components. One is the firmware running on the device, then a mobile application running on the smartphone (most likely an Android app) and finally the server side software that receives the data via HTTP Post, stores it in a mysql database and draws a heatmap for the frontend. The firmware is mostly focused on the sensors drivers and reading the data, the mobile app works as a relay getting the data over bluetooth and sending it to the server (the phone is a good solution for Internet connectivity) and the server component shows the results in a visual form.

    Here are a few pictures showing a mobile app I wrote, that works as a Bluetooth relay, taking the data from the sensor unit and sending it only to the server:
    city_airq_android

    It's obvious this was designed for Android OS, with a nice Bluetooth discovery option, a connect button, and lots of text boxes for showing sensors output. There are even 3 buttons to control the unit, the shutdown, and two for audio effects since the sensor board, based on uRADMonitor-D, also has a speaker: https://hackaday.io/project/4977-portable-environmental-monitor

View all 8 project logs

  • 1
    Step 1

    Order the PCBs to a PCB manufacturer, or if you're good at toner transfer on dual layer boards, build your own (I failed on that, while I usually have very good results making my own boards in the kitchen). Be careful that there are two PCB variants, one for Wifi and one for LoraWAN. Probably you want the former.

  • 2
    Step 2

    Populate the board with the few components listed. You will need soldering paste and a hot air rework station like this one. Solder the electrochemical sensor connectors (4x5 pieces) for the Winsen electrochemical sensors (ZE03-XX). Solder the ZH03A (PM) sensor connector. You'll only need 3 wires out of the original connector (Vcc, GND and Vout), and you can make two connectors out of one, by cutting it in half.

    Plugin the electrochemical sensors and the PM sensor. Use 2mm screws to fix the PM sensor to the board.Connect the PM sensor to the board with the 3 wire connector.
  • 3
    Step 3

    Compile the code. Use usbAsp programmer and the avrdude to write the hex and the fuse settings to the microcontroller, via the 6PIN isp connector.

View all 3 instructions

Enjoy this project?

Share

Discussions

uuwen wrote 07/20/2020 at 04:06 point

Very nice project! Can you provide the PCB files for reference?

  Are you sure? yes | no

Shubham Saraf wrote 03/20/2020 at 19:49 point

I'm using ZE03-o2 sensor with arduino uno in my project. I don't know how to calibrate it and get proper output. Can you please guide me?

email: shubhamsaraf2@gmail.com

  Are you sure? yes | no

johnhardmann wrote 01/19/2020 at 17:02 point

how can I obtain the pcb image for manufacture

  Are you sure? yes | no

pranjal.rtv wrote 04/29/2019 at 06:23 point

i am HAVING issue while operating the sensor its always give me 00 value in UART

  Are you sure? yes | no

Radu Motisan wrote 09/15/2019 at 13:18 point

Can you provide more details please? 

  Are you sure? yes | no

Reinhard wrote 07/27/2017 at 19:12 point

Hr Radu, great project!

Would you share the BOM (bill-of-material)?

Thanks

  Are you sure? yes | no

Radu Motisan wrote 09/08/2017 at 07:07 point

Sure, please see the Components section Components 14

  Are you sure? yes | no

Lars Englund wrote 07/16/2017 at 20:29 point

Hi Radu, could you please provide a source for your initial statement "Air pollution is the single largest environmental cause of premature death in urban Europe"?

Thanks in advance!

  Are you sure? yes | no

Lars Englund wrote 09/08/2017 at 07:38 point

Thanks!

  Are you sure? yes | no

Radu Motisan wrote 09/08/2017 at 07:44 point

my pleasure. Sorry for the delay.

  Are you sure? yes | no

Goering Eduardo Coffey wrote 07/13/2017 at 20:30 point

Hello Radu, nice work and congratulation with what you have done, i was wondering if you can provide some kind of guidance or mentoring about this? I'm looking to build something similar and use this in our country. Our air is 100% contaminated and no one is doing much to monitor and solve the situation. I want to start doing the monitoring.

  Are you sure? yes | no

Radu Motisan wrote 09/08/2017 at 07:13 point

Absolutely, let me know what I can do to help!

  Are you sure? yes | no

Tindie wrote 06/23/2017 at 00:24 point

Hey Radu, well done on being one of the Internet of Useful Things Hackaday Prize Finalists!

  Are you sure? yes | no

Radu Motisan wrote 06/26/2017 at 08:04 point

Thank you! I'm so happy for that.

  Are you sure? yes | no

Chris wrote 06/20/2017 at 17:45 point

Really interesting project, are the sensors accurate enough to use for residential road monitoring? From the looks of the comments above it seems not, but I would hope that they work since I would love to try this project. Also it is hard to find those sensors from a quick search, do you have any tips?

Thanks

  Are you sure? yes | no

Radu Motisan wrote 06/26/2017 at 08:06 point

Yes, these are digital sensors, each with a unique serial number, being tested individually in a specialised lab. This also makes them more expensive, added to the fact that these are electrochemical sensors. The calibration data is provided in a technical inspection sheet. So the accuracy is guaranteed. See more on the calibration in the last log: https://hackaday.io/project/8334/log/59572-the-sensor-calibration-parameters

  Are you sure? yes | no

angel.imaz wrote 05/14/2017 at 20:47 point

Hello! I think the project is great! I want to replicate for my local community! Is there a github repo with the files? Thank you so much!

  Are you sure? yes | no

Radu Motisan wrote 06/26/2017 at 08:06 point

Yes, I will post all relevant links soon.

  Are you sure? yes | no

Miguel Davila wrote 02/11/2017 at 20:45 point

Hi. It's a really nice project endeed.  But, in my experience, the problem with this kind of project (not yours in particular but every open source air quality ones) is that the sensors used have very low sensitivity. I work as an electronics engineer in my city's air quality department.  We use high end equipment (TAPI and Thermo) for our measurements, and every piece of equipment can measure a minimum of 1ppb or 1ug/m3 of polulant,.  Units used in diy projects often are in the 1mg/m3 or 1 to 10 ppm zone, so It's not ambient air quality at all.  Nevertheless keep up with this awesome project and the good work.

  Are you sure? yes | no

rjh427 wrote 09/28/2017 at 18:50 point

Following up on what Miguel said, did you select sensors based on cost, sensitivity, or size/shape/pinouts packaging? I wonder if more sensitive sensors are available and if yes, at what cost. I'm particularly interested in VOC sensors, to put a tangible measurement on the obnoxious odors we are routinely subjected to in the workplace and elsewhere. Such as formaldehyde, the scents added to laundry detergents, etc.

  Are you sure? yes | no

Radu Motisan wrote 07/22/2016 at 09:26 point

thank you, this is part of the bigger www.uradmonitor.com . For suggestions, I'd say that it would help you to do the right choices on sensors right from the start, because in the end the important thing you are building is the data collection. And that needs to be as accurate as possible , if it is to have any value. Good luck!

  Are you sure? yes | no

yawar wrote 07/22/2016 at 15:32 point

Thank you for your reply. I wasn't too keen on sensors. Your suggestion sure is helpful.  Thank you - yawar

  Are you sure? yes | no

yawar wrote 07/21/2016 at 12:43 point

A really nice project and intuitive. I am currently planning on building a similar thing. I am using Arduino as my base. I am intending to measuring air quality and radiation. Do you have any suggestions or any thing that I should keep in mind in regard.  - yawar

  Are you sure? yes | no

Radu Motisan wrote 05/11/2017 at 17:40 point

Hello Yawar, it might be easier to start with this other project instead: https://hackaday.io/project/7935-open-source-iot-platform

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates