Skip to Content
Author's profile photo Marcus Conrad Behrens

Measure Air Quality in your Office for 9€ (and analyze it on your phone for another 20€)

This is another blog that shows how to learn about HCP and come up with a useful IoT application at the same time. You might want to refer to this earlier post to find out how to post data to HCP in detail: Measure the Sun with Hana Cloud Platform – E2E Tutorial available – now in version 2.0.

To start you need a microcontroller with Wifi. Your Cheapest option is the Nodemcu Lua based on the ESP 8266. You can find those on ebay for as low as 6€ shipped directly from China to your doorstep. Or you can pick up another similar device from your local fablab or d-shop.

Next you need a sensor. The expensive ones measure only CO2, the cheap MQ135 for about 2.5€ measures CO2 but also other gases. As long as the only gas “exhaled” in your office is CO2 you are fine with the MQ135. It provides an analog voltage between 0 and 3.3V which is easy to measure with above device or any microcontroller with an analog to digital converter. As this sensor requires to have the internal heating on for a long time before you can get good measurements and the heating requires 150mA its best to power sensor and board from USB and not from a battery.

Lastly you want to show the air quality. Cheapest way to do this is a few LEDs directly connected to the pins of the microcontroller. You can also use an LED matrix or an LED ring as in the picture below.


Now you can solder or breadboard together the pieces – instructions can best be found when searching for “Arduino MQ135” or “ESP8266 LED” on google. The firmware is super-simple for local operation and works like this:

loop() {

     int value = analogRead(PinWithMQ135Attached); // value will be between 0 and 1023 for a 10bit analog to digital converter

     lightUpLEDs(value/100); // will light up from 0 to 10 led’s


As the finishing touch for the Hardware you might want to pront a 3D case as shown below – but this is really up to you.

Lets get to the interesting bit which is to log the data online and analyze it. One great option for this to us the HCP trial accounts and the IoT Device Services available at

Once you signed up for an account you can post the data into the table. But what do you do with it after it sits there.

The simple option is to use your familiar excel, power bi or other analytics tool. Most of them offer a way to import data from an OData feed and use the tools capabilities to visualize it. The IoT Device Services offer you already an out of the box OData service described here: (SAP HANA Cloud Platform Internet of Things (IoT) Services)

But what if I end up with 15 Gigabyte of data in HCP after some time – how can I analyze the data? The classical analytics tools fail in this case. My suggestion is then to spend 20€ for a great little app that does NOT load the data but queries as required. This allows you to filter and scroll through the data without downloading it and you always look at the current, real time data set. You can find the link to the app on this blog: OData to analyze data “buried” in HCP?


Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.