Skip to content

wsen-pads: Add pressure sensor driver.#3

Merged
nedseb merged 7 commits intomainfrom
wsen-pads
Mar 12, 2026
Merged

wsen-pads: Add pressure sensor driver.#3
nedseb merged 7 commits intomainfrom
wsen-pads

Conversation

@Charly-sketch
Copy link
Copy Markdown
Contributor

@Charly-sketch Charly-sketch commented Mar 9, 2026

Closes #8

Add WSEN-PADS MicroPython driver

This pull request introduces a new MicroPython driver for the Würth Elektronik WSEN-PADS absolute pressure sensor.

The driver provides an easy-to-use API for reading pressure and temperature via the I²C interface, and follows the structure used by the other drivers in the repository.


Features

  • I²C communication support
  • Device detection using DEVICE_ID
  • Pressure measurement
  • Temperature measurement
  • One-shot acquisition mode
  • Continuous measurement mode with configurable ODR
  • Raw data access
  • Status helpers (pressure_available, temperature_available, is_ready)
  • Sensor reset and reboot support

Sensor specifications

  • Pressure range: 26 kPa – 126 kPa
  • Pressure resolution: 24-bit
  • Temperature resolution: 16-bit
  • Maximum Output Data Rate: 200 Hz

Driver API

from wsen_pads import WSEN_PADS

sensor = WSEN_PADS(i2c)

pressure = sensor.pressure()
temperature = sensor.temperature()

pressure, temperature = sensor.read()

Additional features:

sensor.read_one_shot()
sensor.set_continuous(odr=ODR_10_HZ)

sensor.soft_reset()
sensor.reboot()

Examples

The driver includes several examples demonstrating common use cases:

  • Basic pressure and temperature reading
  • One-shot measurement
  • Continuous measurement mode
  • Altitude estimation based on pressure

Structure

wsen-pads/
│
├── README.md
├── manifest.py
├── examples/
│
└── wsen_pads/
    ├── __init__.py
    ├── const.py
    ├── device.py
    └── exceptions.py

@nedseb nedseb requested a review from Copilot March 10, 2026 08:24
@nedseb nedseb added the enhancement New feature or request label Mar 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new MicroPython driver library for the Würth Elektronik WSEN-PADS pressure/temperature sensor, including constants, exceptions, packaging manifest, documentation, and runnable example scripts.

Changes:

  • Introduces WSEN_PADS driver implementation with I2C helpers, one-shot and continuous modes, and basic configuration/reset support.
  • Adds sensor register/bitfield constants and a small exception hierarchy for driver errors.
  • Adds a library manifest.py, README documentation, and multiple example scripts (plus a full “test” script).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
lib/wsen-pads/wsen_pads/exceptions.py Defines driver-specific exception types.
lib/wsen-pads/wsen_pads/device.py Implements the WSEN-PADS driver (I2C operations, reading, configuration).
lib/wsen-pads/wsen_pads/const.py Adds register map, bit masks, ODR values, and conversion/timing constants.
lib/wsen-pads/wsen_pads/init.py Exposes WSEN_PADS as the package public API.
lib/wsen-pads/manifest.py Declares package metadata and packaging entry.
lib/wsen-pads/exemples/test.py Adds a comprehensive manual test script for the sensor/driver.
lib/wsen-pads/exemples/one_shot_reader.py Adds a one-shot reading example.
lib/wsen-pads/exemples/continuous_reader.py Adds a continuous mode reading example.
lib/wsen-pads/exemples/basic_reader.py Adds a basic read loop example.
lib/wsen-pads/exemples/altitude.py Adds an altitude estimation example based on pressure.
lib/wsen-pads/README.md Documents features, usage, and repository layout for the new driver.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/manifest.py Outdated
Comment thread lib/wsen-pads/README.md Outdated
Comment thread lib/wsen-pads/README.md
Comment thread lib/wsen-pads/examples/test.py
Comment thread lib/wsen-pads/exemples/basic_reader.py Outdated
Comment thread lib/wsen-pads/README.md Outdated
@Charly-sketch Charly-sketch force-pushed the wsen-pads branch 5 times, most recently from 04532d6 to 5098385 Compare March 10, 2026 09:30
@Charly-sketch Charly-sketch changed the title wsen-pads wsen-pads: Add pressure sensor driver. Mar 10, 2026
Copy link
Copy Markdown
Contributor

@nedseb nedseb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review du driver WSEN-PADS

Globalement un driver bien structuré.

Quelques points à corriger avant merge.

Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/examples/test.py
Comment thread lib/wsen-pads/examples/basic_reader.py
Comment thread lib/wsen-pads/wsen_pads/device.py
Comment thread lib/wsen-pads/examples/altitude.py
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wsen-pads: Add WSEN-PADS pressure and temperature sensor driver

3 participants