Software apps and online services
Living in Almaty, Kazakhstan, it is obvious that clean air is a scarcity. Looking over a balcony you could see a large cloud of smog hovering over the city. The discomfort from walking in such a polluted city urged me to create a compact device that can measure the air quality of a region. This device became the MeteoStation. The device works by collecting data from four different sensors and then saving it to an SQLite database. The data can then be used to analyze and evaluate the overall air quality of your region.
One problem that I encountered whilst working on this project was that the HM3301 and SHT20 share the same I2C address. This was a problem because, out of the box, Raspberry Pi 3 has only one accessible I2C bus (i2c-1). To fix this issue, I needed to access the hidden I2C bus that is used for the built-in video controller (i2c-0). This can be achieved by adding this line in /boot/config.txt:
Another problem that I stumbled on was that the CCS811 sensor can only read data if the I2C bus is configured to a certain baud rate. To fix this problem I added this line in /boot/config.txt:
Lastly, I discovered that the CCS811 sensor needs to be periodically reset in order for it to collect the most accurate data. To address this issue, I programmed a method in the ccs811_linux repository that resets the sensor, and I also added a command line option that would reset the sensor before executing which can be found attached below in runner.cpp.
Since the device is intended to be mounted somewhere, it is strongly advised that your Raspberry Pi is also connected to the internet. A good tutorial on how to setup Wi-Fi on the Raspberry Pi 3 can be found here: