Skip to content

Support of Winsum ZH03B sensor Dust particle sensor in xsns_18_pms5003.ino - #19850

Merged
arendst merged 2 commits into
arendst:developmentfrom
FransOv:development
Oct 27, 2023
Merged

arendst merged 2 commits into
arendst:developmentfrom
FransOv:development

Conversation

@FransOv

@FransOv FransOv commented Oct 27, 2023

Copy link
Copy Markdown
Contributor

Support of Winsen ZH03B Dust particle sensor in xsns_18_pms5003.ino

Description:

The Winsen ZH03B sensor is quite similar to the Plantower PMS3003 sensor. The main difference is the response in passive mode. With these changes xsns_18_pms5003.ino can support the ZH03B sensor when PMS_MODEL_ZH03X is defined in the configuration file.

Related issue (if applicable): fixes #

Checklist:

  • [x ] The pull request is done against the latest development branch
  • [ x] Only relevant files were touched
  • [ x] Only one feature/fix was added per PR and the code change compiles without warnings
  • [ x] The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.14
  • [ x] I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

The Winsum ZH03B sensor is quite similar to the Plantower PMS3003 sensor. The main difference is the response in passive mode. With these changes xsns_18_pms5003.ino can support the ZH03B sensor when PMS_MODEL_ZH03X is defined in the configuration file.
@arendst arendst self-assigned this Oct 27, 2023
Comment thread tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino Outdated
Pms.valid--;
if (Settings->pms_wake_interval >= MIN_INTERVAL_PERIOD) {
PmsSendCmd(CMD_READ_DATA);
AddLog(LOG_LEVEL_DEBUG_MORE, "ZH03x: Read command issued (2)");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

// wakeup sensor WARMUP_PERIOD before read interval
Pms.wake_mode = 1;
PmsSendCmd(CMD_WAKEUP);
AddLog(LOG_LEVEL_DEBUG_MORE, "ZH03x: Wake up command issued");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

if (Pms.time >= Settings->pms_wake_interval) {
// sensor is awake and warmed up, set up for reading
PmsSendCmd(CMD_READ_DATA);
AddLog(LOG_LEVEL_DEBUG_MORE, "ZH03x: Read command issued (1)");

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

return true;
}

bool ZH03ReadDataPassive() // process the passive mode response of the ZH03x sensor

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Place this function within #ifdef PMS_MODEL_ZH03X

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

* You can either support PMS3003 or PMS5003-7003 at one time. To enable the PMS3003 support
* you must enable the define PMS_MODEL_PMS3003 on your configuration file.
* For PMSx003T models that report temperature and humidity define PMS_MODEL_PMS5003T
* This module can also support de Winsum ZH03x series of dust particle sensors,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It's Winsen. Not Winsum, places in the Netherlands (yes there are more than one)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, Thank you for the comments.

@arendst
arendst merged commit 0130ce9 into arendst:development Oct 27, 2023
@arendst

arendst commented Oct 27, 2023

Copy link
Copy Markdown
Owner

Thx.

Jason2866 added a commit to Jason2866/Tasmota that referenced this pull request Oct 28, 2023
* Rectified Typos (arendst#19841)

* Rectified Typos

* Update settings.json

* Support of Winsum ZH03B sensor Dust particle sensor in xsns_18_pms5003.ino (arendst#19850)

* Update xsns_18_pms5003.ino

The Winsum ZH03B sensor is quite similar to the Plantower PMS3003 sensor. The main difference is the response in passive mode. With these changes xsns_18_pms5003.ino can support the ZH03B sensor when PMS_MODEL_ZH03X is defined in the configuration file.

* Update xsns_18_pms5003.ino

* Update change logs

* Update be_lexer.c (arendst#19856)

Added check for unterminated block comments

* Refactoring of storing safeboot bin (arendst#19858)

* Folder for storing safeboot is now configurable
* Platform 2023.10.06
* Platform 2023.10.12

---------

Co-authored-by: Dellucifer <84488210+dellucifer@users.noreply.github.com>
Co-authored-by: FransOv <57999223+FransOv@users.noreply.github.com>
Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
Co-authored-by: Andreas Ziemer <aziemer@a-z-e.de>
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.

2 participants