
Cognitive Comfort Index
Problem and Motivation
My main workspace is my bedroom in a cheap apartment in downtown Athens. No natural light, fluorescent LEDs, paper-thin walls, and a bar directly below that makes the floor shake on weekends. I knew this environment was hurting my focus, but I had no data to prove it.
That question turned into this project. What are the actual, measurable conditions that drive cognitive performance? And could I build something that quantifies them in real time? The Cognitive Comfort Index (CCI) is my answer: an IoT-based environmental monitoring system that collects live sensor data, benchmarks it against real productivity research, and outputs a single composite score reflecting a workspace's capacity for focused work.
The broader problem is real and underappreciated. Students and professionals increasingly work from non-traditional spaces, with little visibility into how their environment is affecting them. The CCI gives them that visibility.
Approach and System Design
The system is built around a Raspberry Pi 4 connected to a Pimoroni Enviro Mini, a compact sensor board that reads temperature, humidity, light levels, and sound. Data flows from the sensors through a Flask web server running on the Pi, which exposes API endpoints that serve fresh readings on demand rather than pulling from stored values.
Each raw sensor reading required meaningful processing before it could be used. Temperature, for example, reads artificially high due to CPU heat bleed-off and needed calibration. Please check out the technical report above for more information on how I process each reading. Once processed, each factor is normalized against scientific thresholds drawn from environmental research and converted to a score from 1 to 100.
The four scores are then combined into the CCI as an equally weighted average. Readings and scores are logged to a local SQLite database, and a lightweight HTML/CSS/JavaScript frontend served through Flask displays the live scores and sensor values, updated in real time. The frontend also featured a live leaderboard to track environmental conditions across various locations.
Challenges and Tradeoffs
The project ran into hardware trouble early. My original Enviro+ board failed during setup, likely due to user error on first configuration. Replacing it with an Enviro Mini meant losing the air quality sensor, which removed CO2 tracking from the final build. That was a genuine loss given how central air quality research was to the original proposal.
Beyond hardware, the scoring methodology was the hardest intellectual problem. Some factors, like temperature and lighting, have well-established quantitative thresholds in the literature. Others have limited quantitative data available, making it difficult to define precise scoring curves with confidence. The tradeoff was between scientific rigor and shipping something functional. I chose to build a working, research-grounded MVP and flag where the model has lower confidence, rather than stall on precision I could not yet achieve.
Outcomes and Impact
Shipped a fully functional IoT system end-to-end: real-time sensor data collection, a calibrated multi-factor scoring model, with a live web interface.
Demonstrated the CCI across multiple real-world study locations, validating that the system produces meaningfully differentiated scores across different environments.
Limitations and Next Steps
The current version is a strong MVP with clear room to grow. Re-integrating a CO2 sensor is the highest-priority hardware improvement, as air quality has some of the strongest research support for cognitive impact. On the scoring side, collecting self-reported productivity ratings alongside sensor data would allow the model to validate and refine its benchmarks at the individual level.
Longer term, I want to explore connecting the system to controllable devices (smart lamps, air purifiers) so it can not only diagnose a workspace but actively help correct it. That closes the IoT loop in the most satisfying way possible.