Building an Environment Monitor for my Apartment – patsapartment.com
We moved to a new apartment this fall and I wanted to investigate ways to monitor air quality/humidity. Our new place has radiator heat that we don’t have much control over. As a result the air is incredibly dry and goes through intense temperature swings daily. The plants and my skin weren’t doing the best in the desert like environment. In short, the air temperate/humidity levels are unpredictable.
Because I’m crazy, I decided to assemble some hardware to detect various air quality metrics. Then I built a website to track this data: PatsApartment.com
I just bought a bunch of I2C sensors and I thought logging a bunch of different air quality metrics would be fun. One of the goals was to try and figure out if the radiators are set on some sort of timer/schedule or if they are responding to temperature changes in some sort of PID system. Additionally, I wanted to see what effect a humidifier might have on air quality and if my plants decrease CO2 levels throughout the day.
The main monitor was built using a Raspberry Pi. It had a bunch of sensors connected via I2C and an analog to digital converter. I setup a cron job to run a Python script that would read the sensor values for 10-15 seconds and calculate an average value from each sensor. The script would then send this data to an API I wrote using Laravel. The Laravel site shows the current sensor readings and a chart showing CO2 levels over time.
There is a tiny OLED display on the main board that gives you a readout of all the levels.
Air Quality Metrics
I got a little carried away on Adafruit/eBay and ended up with a ton of different sensors. Right now the system can sense
- CO2 Levels
- Volatile Organic Compounds (plastics, combustable stuff, certain household cleaners, other nasty stuff)
- Dust levels
- Humidity (this is a tricky one to get accurately for various reasons)
- Relative light levels
I built simple Laravel site that has an API endpoint for logging sensor values. There is a single page that loads a basic listing of current values and then a chart that shows CO2 levels and other data gathered.
Some future plans:
- Move project off bread board to some perf-board
- Add more charts to the website
- Run some sensors outside for humidity/temp
- Setup alerts when levels reach a certain threshold