Skip to content

7semi-solutions/7Semi-BMV080-Particulate-Matter-Sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

7Semi BMV080 Arduino Library

Arduino library for the Bosch Sensortec BMV080 particulate matter sensor
(PM1, PM2.5, PM10).

This library is a 7Semi wrapper around the official Bosch BMV080 SDK and supports both I2C and SPI interfaces.


Features

  • Supports I2C and SPI
  • Continuous measurement mode
  • PM1 / PM2.5 / PM10 output
  • Obstruction and range status flags
  • Designed for Arduino

Important Note (Bosch SDK Required)

Bosch does not provide the BMV080 driver as open-source.

You must download the Bosch BMV080 SDK and copy required files into this library, otherwise compilation will fail.

Required Bosch files:

  • bmv080.h
  • bmv080_defs.h
  • lib_bmv080.a
  • lib_postProcessor.a

Connections

I2C

BMV080 Pin Connect To (MCU)
VCC 3.3V (or as per module spec)
GND GND
SDA I2C SDA
SCL I2C SCL

SPI

BMV080 Pin Connect To (MCU)
VCC 3.3V (or as per module spec)
GND GND
SCK (SCL) SPI SCK
MISO(SDA) SPI MISO
MOSI(SDO) SPI MOSI
CS Any GPIO (Chip Select)

Basic Usage Flow

Initialize the sensor using begin()

Start measurements using startContinuous()

Call getSensorData() repeatedly in loop()

Read PM values from the output structure


Example (I2C)

#include <7Semi_BMV080.h>

BMV080_7Semi bmv;
bmv080_output_t data;

void setup()
{
  Serial.begin(115200);

  // Initialize BMV080 over I2C (default Wire, default address)
  if (!bmv.begin(Wire)) {
    while (1); // Initialization failed
  }

  // Start continuous measurement
  bmv.startContinuous();
}

void loop()
{
  // Read data when a new sample is available
  if (bmv.getSensorData(data))
  {
    Serial.println(data.pm2_5_mass_concentration);
  }
}

Common Errors

bmv080.h not found

Bosch headers not copied correctly

Include path missing

undefined reference to bmv080_*

Bosch .a files not linked

Wrong library selected for your MCU or toolchain


License

7Semi wrapper code: MIT (or your chosen license)

Bosch SDK files: Bosch Sensortec license

⚠️ When redistributing Bosch SDK binaries, make sure to include the original Bosch license files.