Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

FransOv
Copy link
Contributor

@FransOv FransOv commented Oct 27, 2023

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
@@ -239,6 +319,7 @@ void PmsSecond(void) // Every second
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
Owner

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -217,20 +283,34 @@ void PmsSecond(void) // Every second
// 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
Owner

Choose a reason for hiding this comment

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

Ditto

Copy link
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
Owner

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -171,6 +184,59 @@ bool PmsReadData(void)
return true;
}

bool ZH03ReadDataPassive() // process the passive mode response of the ZH03x sensor
Copy link
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
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -27,6 +27,8 @@
* 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
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
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
63 checks passed
@arendst
Copy link
Owner

arendst commented Oct 27, 2023

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 <[email protected]>
Co-authored-by: FransOv <[email protected]>
Co-authored-by: Theo Arends <[email protected]>
Co-authored-by: Andreas Ziemer <[email protected]>
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