Our Sensor Workshop assignment this week was to test air quality. Manuela and I teamed up, and we decided to test the air quality at her apartment. We used the MQ-135 air quality sensor, which measures levels of Ammonia, Sulfide, and Benze steam, and other harmful gases. In order to calibrate the sensor’s readings, we also needed to measure the temperature and the humidity, so we also used a TMP36 temperature sensor and an HIH4030 humidity sensor. We took measurements inside Manuela’s apartment and outside in her backyard.
We measured first in Manuela’s living room, from 12:00 – 12:10 pm, taking readings every 10 seconds. Next we measured in her backyard from 12:40-12:50, again every 10 seconds. It took about 20 minutes for the temperature and humidity sensors (but not the MQ-135) to adjust when we moved outside. They need a solid 10-20 min to get accurate readings in a new environment.
Here is our code. To calculate the voltage, we used code to measure the arduino’s internal voltage rail. This gives us more accurate results because it takes into account that the voltage coming into the sensors is not exactly 5V. We used code from the Secret Voltmeter.
Here is a photo of our setup, using the Arduino DueMilaNove.
Here are the graphs of our readings:
Here are graphs of the readings while the sensors were adjusting to the new outdoor environment. The temperature readings fall slowly, while the humidity rises, and the gas readings are a bit erratic:
Our biggest impediment was understanding how to interpret the sensors’ output. We didn’t initially understand why one sensor’s output should be converted to another unit of measurement while another can be left as a value from 0-1023. Through talking to our teacher, Tom, and one of the residents, Zeven, we came to understand that some values need to be converted to human readable values. For example, the TMP36′s readings are much easier to understand if they are converted to Farenheit or Celsius. The MQ135′s output does not need to be converted necessarily. We are more interested in relative change for the MQ135, so the values can be read with any unit of measurement.
Images from the Serial Monitor. This shows readings from all three sensors:
Readings from TMP36:
Readings from HIH4030:
Readings from MQ135: