Skip to content

Repository files navigation

Polverine Environmental Monitoring System

Hardware Overview

The Polverine board is a mikroBUS™ sensor board developed by BlackIoT featuring the Bosch BMV080 particulate matter sensor and the Bosch BME690 gas sensor connected to a ESP32-S3 microcontroller.

Firmware Overview

This repository contains a firmware that transforms the Polverine board into a complete IoT environmental monitoring solution with web-based configuration, MQTT connectivity, and Home Assistant integration.

Key Features

🌐 WiFi Provisioning

  • Zero-code setup: No need to hardcode WiFi credentials
  • Web-based configuration: Intuitive browser interface for setup
  • Automatic fallback: Creates WiFi hotspot if connection fails
  • Persistent storage: Credentials stored in NVS flash memory

📊 Real-time Sensor Monitoring

  • Dual sensor support: BME690 + BMV080 integration
  • High-frequency sampling: Continuous environmental monitoring
  • Data validation: Built-in sensor error detection and reporting
  • Sensor dashboard: Live web interface showing real-time values

🏠 Home Assistant Integration

  • Auto-discovery: Automatically publishes MQTT discovery messages to Home Assistant's homeassistant/ topic prefix
  • Device registration: Creates a unified device "Polverine XXXXXX" with manufacturer, model, and unique identifier
  • Rich entities: 15+ sensor entities including environmental, air quality, and system health metrics
  • Entity classification: Proper device classes (temperature, humidity, pm25, etc.) with units and icons
  • Status monitoring: Device availability topic, sensor health states, and system diagnostics

⚙️ Advanced Configuration

  • Web interface: Complete configuration through browser
  • MQTT settings: Broker, authentication, topic customization
  • Network management: WiFi scanning, connection monitoring
  • Factory reset: Hardware button for configuration reset

Supported Measurements

SensorMeasurementUnitHome Assistant Entity
BME690Temperature°Csensor.polverine_xxxxx_temperature
BME690Humidity%sensor.polverine_xxxxx_humidity
BME690PressurehPasensor.polverine_xxxxx_pressure
BME690IAQ Index0-500sensor.polverine_xxxxx_iaq
BME690CO2 Equivalentppmsensor.polverine_xxxxx_co2
BME690VOC Equivalentppmsensor.polverine_xxxxx_voc
BME690Gas Resistance%sensor.polverine_xxxxx_gas_percentage
BMV080PM10µg/m³sensor.polverine_xxxxx_pm10
BMV080PM2.5µg/m³sensor.polverine_xxxxx_pm25
BMV080PM1µg/m³sensor.polverine_xxxxx_pm1
SystemWiFi RSSIdBmsensor.polverine_xxxxx_wifi_rssi
SystemFree Heapbytessensor.polverine_xxxxx_free_heap
SystemUptimesecondssensor.polverine_xxxxx_uptime
SystemCPU Temperature°Csensor.polverine_xxxxx_cpu_temperature

Quick Start Guide

First Time Setup (WiFi Provisioning)

  1. Power on the Polverine device
  2. Connect to WiFi network: Polverine-XXXXXX (password: 12345678)
  3. Open browser and navigate to: http://192.168.4.1
  4. Configure your WiFi and MQTT settings
  5. Save configuration - device will restart and connect automatically

Configuration Reset

  • Hold BOOT button for 5 seconds to clear all settings
  • Device will restart in provisioning mode

Web Dashboard Access

Once connected to your network:

  • Configuration:http://[device-ip]/config
  • Live Dashboard:http://[device-ip]/dashboard
  • Device IP shown in router's DHCP table or Home Assistant discovery

Development Setup

🔧 Prerequisites

System Requirements

  • Python 3.7+ (for PlatformIO)
  • Git (for version control)

📥 Initial Setup

# Clone the repository
git clone <repository-url>cd polverine
# Install PlatformIO CLI
pip install platformio
# Verify installation
pio --version

📦 SDK Dependencies

⚠️ Important: Due to Bosch Sensortec licensing restrictions, SDKs must be downloaded separately after agreeing to their terms.

  1. BMV080 Particulate Matter Sensor SDK v11.2.0

    • 🔗 Download:BMV080 SoftwareSDK Download
    • 📁 Extract to:deps/bosch-sensortec/BMV080-SDK/
    • Expected structure:
      deps/bosch-sensortec/BMV080-SDK/
      ├── api/
      ├── api_examples/
      ├── CHANGELOG.md
      ├── LICENSE.md
      └── README.md
      
  2. BME690 BSEC Gas Sensor Library v3.2.0

    • 🔗 Download:BME690 SoftwareBSEC Download
    • 📁 Extract to:deps/bosch-sensortec/bsec_library_v3.x/
    • Expected structure:
      deps/bosch-sensortec/bsec_library_v3.x/
      ├── algo/
      ├── examples/
      └── README.md
      

🔨 Build & Flash

Quick Start (Recommended)

The fastest way to get started is using the provided Makefile:

# All-in-one: build, upload, and monitor
make
# Or step by step:
make build # Build firmware only
make upload # Flash to device
make monitor # View serial output

Available Make Targets

CommandDescriptionUse Case
makeBuild + upload + monitorDeploy and test
make buildCompile firmware onlyTesting compilation
make uploadFlash to deviceDeploy new build
make monitorStart serial monitorDebug & testing
make deployBuild + upload onlyProduction deployment
make cleanRemove build filesFix build issues
make rebuildClean + buildForce complete rebuild
make helpShow all targetsReference

Manual PlatformIO Commands

If you prefer direct PlatformIO commands:

# Build for Polverine board
pio run -e polverine
# Upload to connected device
pio run -e polverine -t upload
# Monitor serial output (Ctrl+C to exit)
pio device monitor --baud 115200
# Clean build artifacts
pio run -t clean

⚙️ Configuration Options

Runtime Configuration (Recommended)

The device creates a WiFi hotspot for first-time setup - no pre-configuration needed!

  1. Connect to Polverine-XXXXXX network (password: 12345678)
  2. Navigate to http://192.168.4.1
  3. Configure WiFi and MQTT settings via web interface

Build-time Configuration (Optional)

For development convenience, create credentials.ini in the project root:

[credentials]wifi_ssid = "YourWiFiNetwork"wifi_pass = "YourWiFiPassword"mqtt_uri = "mqtt://your-broker.local:1883"mqtt_user = "your-mqtt-username"mqtt_pass = "your-mqtt-password"

Note: Build-time credentials are used as defaults but can be overridden via the web interface.

Support

Acknowledgments

  • BlackIoT Swiss for the Polverine hardware platform and the POLVERINE_HOMEASSISTANT_DEMO example that this firmware is originally based on
  • Bosch Sensortec for BME690 and BMV080 sensors
  • Espressif for ESP32-S3 microcontroller platform
  • Home Assistant community for integration standards

About

The Polverine project is a mikroBUS™ board designed for environmental sensing and monitoring applications.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages