Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 1.99 KB

File metadata and controls

73 lines (51 loc) · 1.99 KB

Adafruit WF100DPZ Arduino Library CIDocumentation

Arduino library for the WF100DPZ low-cost MEMS gauge pressure sensor with integrated temperature output.

Features

  • I2C interface (address 0x6D)
  • 24-bit pressure reading in kPa (gauge mode)
  • 16-bit temperature reading in °C
  • Single-shot and periodic conversion modes
  • 16 configurable sleep/periodic intervals
  • Status register with error flag decoding

Installation

Search for Adafruit WF100DPZ in the Arduino Library Manager, or clone this repository into your Arduino libraries folder.

Dependencies

Usage

Periodic Mode (simplest)

#include <Adafruit_WF100DPZ.h>

Adafruit_WF100DPZ wf100dpz;

void setup() {
  Serial.begin(115200);
  wf100dpz.begin();
  wf100dpz.setSleepMode(WF100DPZ_SLEEP_125MS);
  delay(150);
}

void loop() {
  float pressure, temperature;
  wf100dpz.readTempPressure(&pressure, &temperature);
  Serial.print(temperature, 2);
  Serial.print(" C, ");
  Serial.print(pressure, 2);
  Serial.println(" kPa");
  delay(125);
}

Single-Shot Mode

wf100dpz.triggerConversion();
wf100dpz.waitDRDY();
float pressure = wf100dpz.readPressure();
float temperature = wf100dpz.readTemperature();

Sensor Variants

The WF100DPZ comes in multiple pressure ranges (5–300 kPa). The conversion constants are defined as macros and can be adjusted for different variants:

#define WF100DPZ_PRESSURE_SCALE   250.0
#define WF100DPZ_PRESSURE_OFFSET  25.0

Credits

Conversion formulas derived from CodeyNacke/WF100DPZ (MIT license).

License

MIT license — see license.txt for details.