Pandabyte BMP580 Sensor Module: Pressure and Temperature Guide

by pandabyte in Circuits > Arduino

20 Views, 0 Favorites, 0 Comments

Pandabyte BMP580 Sensor Module: Pressure and Temperature Guide

bmp580pic.png

Pandabyte BMP580 Sensor Module is a high-precision environmental sensing module used for learning atmospheric pressure and temperature measurement with microcontrollers such as Arduino compatible boards, ESP32, or Raspberry Pi Pico.

The module uses the BMP580 sensor, which supports both:

  1. I2C communication
  2. SPI communication

The BMP580 provides highly accurate pressure and temperature measurements suitable for:

  1. weather monitoring
  2. environmental sensing
  3. altitude estimation
  4. IoT applications

In this guide, you will learn:

  1. Module pin configuration
  2. Temperature measurement
  3. Pressure measurement
  4. I2C and SPI communication
  5. Arduino programming examples


Supplies

item list.png

Hardware:

  1. PandaByte BMP580 Sensor Module
  2. Development Board (We will use PandaByte xC3m ESP32C3 Dev board)
  3. Breadboard / Grove Expansion Board
  4. Cables: Dupont, USB, and Grove

Software:

  1. Arduino IDE
  2. SparkFun BMP581 Library

Library Link:

SparkFun BMP581 Arduino Library GitHub

Circuit Connections

bmp580i2c.png
bmp580spi.png

The BMP580 sensor supports both:

  1. I2C communication
  2. SPI communication

I2C communication can be used through:

  1. Male header pins
  2. Grove connector

SPI communication requires 6 total connections:

  1. VCC
  2. GND
  3. SCK
  4. MISO
  5. MOSI
  6. CS

Since the Grove connector provides only 4 pins, SPI mode is not supported using Grove connector.

Front side of the module: I2C naming (SCL, SDA)

Back side of the module: SPI naming (SCK, MISO, MOSI, CS)

Also, if your module has a slide switch (SPI-I2C), make sure to set the switch to appropriate mode before connection and programming.

For SPI communication, use:

  1. Male headers
  2. Dupont jumper wires only

Install the Library

Open Arduino IDE

Go to:

  1. Sketch → Include Library → Manage Libraries

Search for:

  1. SparkFun BMP581

Install the library

Programming

Program 1: BMP580 Using I2C Interface

Read temperature and pressure using I2C communication.


#include <Wire.h>
#include "SparkFun_BMP581_Arduino_Library.h"

BMP581 pressureSensor;

uint8_t i2cAddress = 0x47;

void setup()
{

Wire.begin(); // SDA, SCL
Serial.begin(115200);
Serial.println("BMP581 Example1 begin!");
while(pressureSensor.beginI2C(i2cAddress) != BMP5_OK)
{
Serial.println("Error: BMP581 not connected, check wiring and I2C address!");
delay(1000);
}

Serial.println("BMP581 connected!");
}

void loop()
{

bmp5_sensor_data data = {0,0};
int8_t err = pressureSensor.getSensorData(&data);
if(err == BMP5_OK)
{
Serial.print("Temperature (C): ");
Serial.print(data.temperature);

Serial.print("\t\t");

Serial.print("Pressure (Pa): ");
Serial.println(data.pressure);
}
else
{
Serial.print("Error getting data from sensor! Error code: ");
Serial.println(err);
}
delay(1000);
}


Program 2: BMP580 Using SPI Interface Read temperature and pressure using SPI communication.


#include <SPI.h>
#include "SparkFun_BMP581_Arduino_Library.h"

BMP581 pressureSensor;

uint8_t chipSelectPin = 3;
uint32_t clockFrequency = 100000;

void setup()
{

Serial.begin(9600);
SPI.begin();
while(pressureSensor.beginSPI(chipSelectPin, clockFrequency) != BMP5_OK)
{
Serial.println("Error: BMP581 not connected, check wiring and CS pin!");
delay(1000);
}
Serial.println("BMP581 connected!");
}

void loop()
{

bmp5_sensor_data data = {0,0};
int8_t err = pressureSensor.getSensorData(&data);
if(err == BMP5_OK)
{
Serial.print("Temperature (C): ");
Serial.print(data.temperature);
Serial.print("\t\t");

Serial.print("Pressure (Pa): ");
Serial.println(data.pressure);
}
else
{
Serial.print("Error getting data from sensor! Error code: ");
Serial.println(err);
}

delay(1000);
}

Output

  1. For both I2C and SPI programs, the Serial Monitor will display:
  2. temperature in °C
  3. atmospheric pressure in Pa

Important Info

The module uses the BMP580 high-precision environmental sensor.

The BMP580 measures:

  1. temperature
  2. atmospheric pressure

The sensor supports:

  1. I2C communication
  2. SPI communication

Common I2C addresses:

  1. 0x46
  2. 0x47

On PandaByte xC3m Dev Board:

  1. SDA → GPIO1
  2. SCL → GPIO0

SPI pins used:

  1. SCK → GPIO4
  2. MISO → GPIO5
  3. MOSI → GPIO6
  4. CS → GPIO3

BMP580 provides higher precision and stability compared to older BMP280/BMP180 sensors.

Grove connection supports only I2C communication.

Use short wiring connections for reliable SPI communication.