The Adafruit MPRLS Sensor Breakout is a compact and versatile board designed for measuring pressure with precision. It utilizes the MPRLS ported pressure sensor, capable of measuring both absolute and differential pressure within a specified range. This sensor is ideal for a variety of applications, including weather stations, medical devices, and any system requiring accurate pressure measurements.
Pin Number | Name | Description |
---|---|---|
1 | VIN | Supply voltage (3.3V to 5V DC) |
2 | GND | Ground connection |
3 | SCL | I2C clock line |
4 | SDA | I2C data line |
5 | SHDN | Shutdown pin (active low) |
#include <Wire.h>
#include <Adafruit_MPRLS.h>
// Create MPRLS object
Adafruit_MPRLS mpr = Adafruit_MPRLS(-1, -1);
void setup() {
Serial.begin(9600);
while (!Serial) { delay(10); } // Wait for serial console to open
if (!mpr.begin()) { // Initialize MPRLS sensor
Serial.println("Failed to initialize MPRLS sensor!");
while (1);
}
}
void loop() {
float pressure_hPa = mpr.readPressure(); // Read pressure
// Check if reading was successful
if (pressure_hPa != NAN) {
Serial.print("Pressure: ");
Serial.print(pressure_hPa);
Serial.println(" hPa");
} else {
Serial.println("Failed to read pressure!");
}
delay(500); // Wait half a second between readings
}
Q: Can the sensor measure liquid pressure? A: The sensor is designed for gas pressure measurement and should not be used with liquids directly.
Q: What is the maximum pressure the sensor can measure? A: The sensor can measure pressures up to 25 PSI (1724 millibar).
Q: How do I put the sensor into low-power mode? A: Pull the SHDN pin low to put the sensor into shutdown mode, reducing its power consumption.