Air pollution events––both large scale and small––have a daily impact on our lives. From the recent fires in California to everyday vehicle exhaust, there's often a lot more in what we breath than just air. After consulting with professors, we learned that current sensor products can't often account for local air quality variability. For example, there's really no good way to affordably determine how exhaust from a nearby highway affects the air in your home or workplace. For both public health research and personal concern, we believe there should be a portable, simple solution: Bairea.

What it does

Bairea is a compact sensor package magnetically mountable on a car. The module measures respiratory irritants, carbon monoxide (CO), and carbon dioxide (CO2) (all products of combustion) every few seconds, and then wirelessly logs and displays location-indexed and time-indexed data on your web dashboard. By continuously collecting data as you drive, from day to day, the module will start to build a picture of how air quality varies among the places you go most.

How we built it

Bairea is controlled by a Raspberry Pi 3 connected to a digital respiratory irritants sensor, as well as analog CO and CO2 sensors via an Arduino Uno. Upon reading sensor data from the serial port, the Pi sends the the pollutant information to our Google App Engine-driven database and server.

The backend is written using Flask and runs on Google App Engine. The server continuously logs data from the Pi to Google Datastore.

We wrote a front end using D3.js and the Google Maps Javascript API to visualize pollutant information taken from the backend and place it on a map.

Challenges I ran into

We had trouble finding some of the necessary hardware components, such as a GPS module, so we had to simulate some location data for the sake of demonstration. Getting all the serial communications aligned proved challenging, as each of the three sensors had a different communications protocol.

There were a ton of issues getting Google App Engine and Datastore to work as a data logger, because Google's Protobuf API in Python doesn't work well with non standard data such as GeoPoints (Google's representation of latitude/longitude).

Most hackathon projects are software hacks simply because software is much easier to work with. Because we decided to do a hybrid hardware-software hack, we ran into a bunch of small issues in trying to get the sensor module to upload to the backend, and then for the backend to get that data to the front-end visualization.

Accomplishments that I'm proud of

We were able to lasercut an enclosure for Bairea, which was a fun process and resulted in a nice looking final product.

We think that this project serves as a really cool proof-of-concept for a cheap, mobile air quality sensor.

We're also really proud of making a successful hardware hack!

What I learned

We learned a ton about building a reliable sensor module that uploads to a backend database.

We gained a lot of experience using D3.js to build powerful, informative data-visualizations.

What's next for Bairea

We'd like to turn this proof of concept prototype into a real marketable product that people or researchers can attach to vehicles.

We'd also like to extend this sensor for use on drones, so that we can build 3D maps of air quality data.

Share this project: