IoT Challenge 2025–26
University of Deusto
- Génesis Balcazar Escobar
- Hugo Rey Insausti
CampusConnect is an IoT prototype designed to improve social wellbeing and responsible use of shared campus spaces. The system monitors environmental and occupancy conditions in real time and provides feedback through a public dashboard called Campus Pulse and local visual indicators.
- Help students find quiet or available study spaces
- Encourage respectful behavior in shared areas
- Improve comfort and wellbeing on campus
- Provide data for campus space management
- Measures noise level, presence/occupancy, and air quality
- Sends sensor data using MQTT
- Stores data in InfluxDB
- Displays real-time data in Grafana dashboards
- Provides local visual feedback using an LED strip
| Sensor | Purpose |
|---|---|
| Noise sensor (microphone) | Measure ambient sound level |
| Presence sensor (PIR / ToF) | Detect occupancy |
| Air quality / temperature sensor (MQ-135 / DHT22 / BME680) | Measure air quality, temperature, and humidity |
| LED strip | Provide visual feedback |
- Microphone: Analog input (GPIO 34 / 35 / 36)
- PIR sensor: Digital input (GPIO 14 / 27)
- Air quality sensor: I2C (SDA → GPIO 21, SCL → GPIO 22)
- LED strip: Digital output (GPIO 5)
Power Supply:
- 3.3V for most sensors
- 5V for LED strip and some air quality sensors
- Sensors collect environmental and occupancy data
- ESP32 processes the data and publishes it via MQTT
- Backend receives MQTT messages and stores data in InfluxDB
- Grafana reads the database and updates dashboards
- LED strip shows local feedback
- Users consult the Campus Pulse dashboard
CampusConnect/
├── src/
│ ├── backend/ # Flask REST API and InfluxDB integration
│ │ ├── api.py # Main API server
│ │ └── requirements.txt
│ ├── main/ # IoT sensor controller
│ │ └── Main.py
│ ├── sensors/ # Sensor modules
│ │ ├── AirQualitySensor.py
│ │ ├── NoiseSensor.py
│ │ ├── TemperatureHumiditySensor.py
│ │ ├── UltrasonicSensor.py
│ │ └── LedBarActuator.py
│ ├── display/ # Display controllers
│ │ └── LcdDisplay.py
│ └── data/db/ # Database files
├── web/ # Web dashboard
│ ├── index.html
│ ├── style.css
│ └── script.js
├── docs/ # Documentation
└── README.md
Follow these steps in a single terminal session to start all services:
# 1. Create and activate Python virtual environment
python3 -m venv venv
source venv/bin/activate
# 2. Install Python dependencies
pip install -r requirements.txt
# 3. Start InfluxDB with Docker (persistent volume)
docker run -d \
--name influxdb2 \
-p 8086:8086 \
-v influxdb-data:/var/lib/influxdb2 \
influxdb:2
# InfluxDB default configuration:
# User: admin
# Password: admin123
# Bucket: sensors
# 4. Start Grafana using Docker Compose
cd dashboard
docker compose up -d
# Grafana default credentials:
# User: admin
# Password: admin123
# 5. Go back to the project root
cd ..
# 6. Run the backend services
source venv/bin/activate
# Start main script in the background
python3 main.py &
# Start backend server
python3 server_backend.py
# 7. Open the frontend interface
start index.html
# 8. Open Grafana in your browser and import the dashboard
# URL: http://localhost:3000
# Import JSON from /dashboard
# Select InfluxDB as data sourceThe interactive web dashboard (web/index.html) provides:
- Real-time heatmap visualization of campus activity
- Category filters: All Areas, Social, Relax, Food, Study
- Leaflet.js integration for interactive mapping
- Responsive design with modern UI
Location: University of Deusto, Bilbao (43.2711N, 2.9380W)
Backend:
- Python 3.8+
- Flask (REST API)
- InfluxDB 2.x (Time-series database)
- CORS support
Frontend:
- HTML5, CSS3, JavaScript
- Leaflet.js (Interactive maps)
- Leaflet.heat (Heatmap visualization)
IoT Hardware:
- Raspberry Pi
- DHT11/DHT22, MQ-135, HC-SR04 sensors
- I2C LCD Display, LED Bar
This project is part of the IoT Challenge 2025-26 at the University of Deusto.
For questions or collaboration:
- Génesis Balcazar Escobar - GitHub: @gnnesis
- Hugo Rey Insausti - GitHub: @HugoReyIn
Built for a better campus experience