3 Home
Fernando Martínez Valenzuela edited this page 14 hours ago

Sensor Dashboard with Raspberry Pi 4 (HTU21D)

Overview

Air quality is a critical factor that threatens the lives and well-being of urban and rural populations around the world. According to the World Health Organization (WHO), 98% of the world's population lives in places where air quality is very poor, leading to serious public health problems, respiratory and cardiovascular diseases.Based on this, improving air quality has become a priority.

Based on this, improving air quality has become a health priority, but unfortunately fixed monitoring stations are too large, expensive and have limited coverage, usually located in urban areas and do not provide detailed data on air variation making it difficult to identify pollution hotspots.

This project represents the first functional integration of the HTU21D sensor for temperature and humidity measurement within a series of environmental sensors that will be implemented to develop an architecture and device for a network of micro weather stations to measure air quality and offer an monitoring system. This architecture and device are low-cost and easy to implement in urban areas to identify air pollutants and obtain detailed data. This data will be sent to a centralized platform (main server) in real time, enabling accurate decision-making and raising awareness about air quality.

The network that will connect these micro wheater stations is based on an IoT infrastructure, wich facilitates communication and connectivity between stations, allowing the colletion of data onchanges in the air.


System Architecture

The system follows a layered architecture where each component has a specific role:

  • The sensor captures physical data
  • The Raspberry Pi reads it via I2C
  • A C program processes and converts it into JSON
  • Nginx serves the data and web interface
  • The browser displays real-time information

What You Will Find in This Wiki

This documentation is designed to explain the project from both technical and practical perspectives. You will find:

  • System architecture explanation
  • Hardware setup and wiring
  • I2C communication details
  • In-depth C code analysis
  • Data flow (sensor to web)
  • Web interface implementation (HTML + JavaScript)
  • Nginx configuration
  • Troubleshooting and common issues

Navigation

Start exploring the following sections:

  • System Architecture → general system overview
  • Hardware Setup → physical connections
  • I2C Communication → sensor communication
  • C Code Explanation → program logic
  • Web Interface → data visualization
  • Troubleshooting → common issues and fixes

Project Goal

The main goal of this project is to integrate knowledge from:

  • Embedded systems
  • C programming
  • Low-level communication (I2C)
  • Web development
  • Linux system administration