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

Concentration to AQI calculation for US and China. #12

Merged
merged 10 commits into from
Dec 23, 2024

Conversation

jiangyi1985
Copy link
Contributor

@jiangyi1985 jiangyi1985 commented Jul 23, 2022

Concentration to AQI calculation for US and China.
Add fail reason and verbose info.
Check start byte more strickly.
Parse version and error code.

Tested on PMSA003I-C

…d verbose info. Check start byte more strickly. Parse version and error code.
@jiangyi1985
Copy link
Contributor Author

image

@brentru
Copy link
Member

brentru commented Nov 1, 2023

@tyeth Want to take a look at this?

@tyeth
Copy link
Contributor

tyeth commented Nov 3, 2023

Hi @jiangyi1985 and thanks for your contribution!

I saw that the way your segmenting for PM2.5 (12 and <12.1 meant to be up to and including 12) compared to PM10 (55 + 55 meant to be upto and including 54), seem to be different, the latter should probably follow the former.
image

I'm using this reference from the US EPA https://www.airnow.gov/sites/default/files/2020-05/aqi-technical-assistance-document-sept2018.pdf however I cannot find a reference for calculating the Chinese AQI. Most information seems very old, like before 2018, and unofficial.
Where did you get the values for the AQI for China?

@jiangyi1985
Copy link
Contributor Author

@tyeth When I wrote the code last year, I referenced this wiki page:
https://en.wikipedia.org/wiki/Air_quality_index

Now that I've checked where the data of China & US are referenced, the sources seem to be legit.

Here's the reference of China's data:
https://www.mee.gov.cn/ywgz/fgbz/bz/bzwb/jcffbz/201203/t20120302_224166.shtml

Copy link
Contributor

@tyeth tyeth left a comment

Choose a reason for hiding this comment

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

Changes requested, but minor.

Adafruit_PM25AQI.cpp Show resolved Hide resolved
Adafruit_PM25AQI.cpp Outdated Show resolved Hide resolved
Adafruit_PM25AQI.cpp Show resolved Hide resolved
Adafruit_PM25AQI.h Outdated Show resolved Hide resolved
examples/PM25_test/PM25_test.ino Outdated Show resolved Hide resolved
@jiangyi1985
Copy link
Contributor Author

@tyeth Conflict resolved

@tyeth tyeth self-assigned this Dec 20, 2024
@tyeth tyeth self-requested a review December 20, 2024 20:13
@tyeth
Copy link
Contributor

tyeth commented Dec 20, 2024 via email

@brentru brentru self-requested a review December 23, 2024 16:00
Copy link
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

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

@jiangyi1985 This PR looks good and you've made the corrections Tyeth asked. I don't see any glaring issues with it and will merge in.

@brentru brentru merged commit bad1074 into adafruit:master Dec 23, 2024
1 check passed
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