Skip to content

feat(wsen-hids): Add examples.#160

Open
Charly-sketch wants to merge 4 commits into
feat/wsen-hids-driverfrom
feat/wsen-hids-examples
Open

feat(wsen-hids): Add examples.#160
Charly-sketch wants to merge 4 commits into
feat/wsen-hids-driverfrom
feat/wsen-hids-examples

Conversation

@Charly-sketch
Copy link
Copy Markdown
Contributor

Summary

Adds multiple standalone real-world Arduino example sketches for the WSEN-HIDS humidity and temperature sensor driver, covering environmental alerting, condensation monitoring, and comfort classification scenarios. Closes #158.

The DAPLink-backed persistent logging example has been split into a dedicated follow-up issue: relates to #159.

Depens on #131

Changes

  • Added HumidityAlert example:

    • continuously monitors ambient humidity
    • triggers the onboard buzzer when humidity exceeds a mold-risk threshold
  • Added DewPointMonitor example:

    • computes dew point from temperature and relative humidity
    • warns when condensation risk becomes high
  • Added ComfortZone example:

    • classifies the room as comfortable / too dry / too humid / too cold / too hot
  • Kept BasicReader as the baseline serial environmental readout example

  • Updated README.md example table and usage documentation to reference the new sketches

  • Deferred HumidityLogger persistent flash logging example to follow-up DAPLink integration issue examples(wsen-hids): Add practical usage examples with daplink. #159

Checklist

  • make lint passes (clang-format)
  • make build passes (PlatformIO)
  • make test-native passes (if native tests exist)
  • make test-hardware passes on a connected STeaMi (if hardware tests exist)
  • README updated (if adding/changing public API)
  • Examples added/updated (if applicable)
  • Commit messages follow conventional commits format

- ComfortZone : Classify environment as comfortable/dry/humid using temperature-humidity chart
- DewPointMonitor : Calculate and display dew point, warn when condensation risk is high
- HumidityAlert : Trigger buzzer when humidity exceeds a threshold (mold prevention)
@nedseb
Copy link
Copy Markdown
Contributor

nedseb commented Apr 28, 2026

@Charly-sketch Titre !

@Charly-sketch Charly-sketch changed the title Feat/wsen hids examples feat(wsen-hids): Add examples. Apr 28, 2026
@nedseb nedseb requested review from Copilot and removed request for nedseb April 28, 2026 13:43
Copy link
Copy Markdown

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 several new real-world Arduino example sketches for the WSEN-HIDS driver and updates the driver README to reference them, helping users adopt the sensor in practical scenarios (alerts, condensation monitoring, comfort classification).

Changes:

  • Added three new standalone example sketches: HumidityAlert, DewPointMonitor, and ComfortZone.
  • Updated lib/wsen-hids/README.md examples table to reference the expanded set of sketches.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lib/wsen-hids/examples/HumidityAlert/HumidityAlert.ino New humidity-threshold alert example using buzzer.
lib/wsen-hids/examples/DewPointMonitor/DewPointMonitor.ino New dew point / condensation risk example.
lib/wsen-hids/examples/ComfortZone/ComfortZone.ino New comfort classification example based on temp/RH.
lib/wsen-hids/README.md Updated examples table to mention new sketches.

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

Comment thread lib/wsen-hids/examples/DewPointMonitor/DewPointMonitor.ino Outdated
Comment thread lib/wsen-hids/README.md Outdated
Comment thread lib/wsen-hids/examples/HumidityAlert/HumidityAlert.ino Outdated
Comment thread lib/wsen-hids/examples/DewPointMonitor/DewPointMonitor.ino Outdated
Comment thread lib/wsen-hids/examples/ComfortZone/ComfortZone.ino Outdated
Example names are now consistent with their directory names (e.g. BasicReader)
Fixed the typo BasicRead → BasicReader
Table entries now link directly to the example directories
Naming aligned with the expected structure (examples/<ExampleName>/<ExampleName>.ino) as defined in the contributing guidelines
DEWPOINT : Humidity can indeed reach 0%, which would result in log(0) and produce -inf. We now clamp the humidity to a small positive value before applying the logarithm to ensure numerical stability. setContinuous() currently expects a frequency in Hz (e.g. 1, 7), while WsenHidsConst::ODR_* values represent register bitfields. Passing WsenHidsConst::ODR_1HZ works by coincidence (value = 1), but would be incorrect for other values like ODR_7HZ.

COMFORT ZONE : setContinuous() currently expects a frequency in Hz (e.g. 1, 7), while WsenHidsConst::ODR_* values represent register bitfields. Passing WsenHidsConst::ODR_1HZ works by coincidence (value = 1), but would be incorrect for other values like ODR_7HZ.

HUMIDITY_ALERT: setContinuous() currently expects a frequency in Hz (e.g. 1, 7), while WsenHidsConst::ODR_* values represent register bitfields. Passing WsenHidsConst::ODR_1HZ works by coincidence (value = 1), but would be incorrect for other values like ODR_7HZ.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants