Code Monkey home page Code Monkey logo

Comments (8)

avaldebe avatar avaldebe commented on June 28, 2024

Are you using the lua module to read the PMS7003?
I do not recognize the output format.

I wrote this proyect long time ago, before we had Arduino for the esp8266,
and I only tested it on the PMS3003 sensor. Since then I wrote PMserial, a generic Arduino library
for the PMSx003 sensors. Maybe you should try that instead of this old/stale modules.

The messages from the PMS7003 are longer than the messages from the PMS3003 (32 bytes vs 24 bytes). Therefore you need the right sensor type on the module configuration

You can find the message description here.

The PM1, PM2.5 and PM10 parts of the message are on ug/m3 and the particle count in number/100cc,
see here.

Where are you located? Those values are way too high for Europe, unless you're measuring next to an open fire place or on a kitchen next to a frying pan.

If you are getting high fluctuation on the values, it could be that you are missing the beginning of the message.

from aqmon.

ronakdedhia18 avatar ronakdedhia18 commented on June 28, 2024

Hi Alvaro,
I am using my own python code with Raspberry Pi for getting values from PMS7003.
I am based in India and this readings are from my bedroom at room temperature.
Ill send my code can you please run and check if i am doing it correct?
Thankyou in advance.

New folder.zip

from aqmon.

avaldebe avatar avaldebe commented on June 28, 2024

Can I see the full output of your script?

In the meantime, it looks like your checksum calculation is wrong:

            # Calculate the payload checksum (not including the payload checksum bytes)
            inputChecksum = 0x42 + 0x4d
            for x in range(0, 27):
                inputChecksum = inputChecksum + data[x]

Here, range(0, 27) will only give you the first 27 indexes ([0, 1, ..., 26]).
You need the first 28 indexes, as the last 2 are the checksum.
Instead you can write the checksum calculation as:

            # Calculate the payload checksum (not including the payload checksum bytes)
            inputChecksum = 0x42 + 0x4d + sum(data[:-2])

BTW, if you do not want to create a full repository for your script,
you can create a gist.
That would make easy to comment on the particular lines...

from aqmon.

ronakdedhia18 avatar ronakdedhia18 commented on June 28, 2024

Hi Alvaro,
Below is the output of my script :
PMS7003 Sensor Data:
PM1.0 = 104 ug/m3
PM2.5 = 163 ug/m3
PM10 = 176 ug/m3
PM1 Atmospheric concentration = 69 ug/m3
PM2.5 Atmospheric concentration = 108 ug/m3
PM10 Atmospheric concentration = 117 ug/m3
Count: 0.3um = 18084 per 0.1l
Count: 0.5um = 5227 per 0.1l
Count: 1.0um = 1020 per 0.1l
Count: 2.5um = 90 per 0.1l
Count: 5.0um = 20 per 0.1l
Count: 10um = 6 per 0.1l
Version = 151
Error Code = 0
Frame length = 28

Let me know if i am still wrong in calculation.
And sorry i am in little rush so not creating gist as of now.
Need to get this sensor up and running for my project.
Thank you.

from aqmon.

avaldebe avatar avaldebe commented on June 28, 2024

The output looks right. Remeber to use the "Atmospheric concentration" version of the PM values.

from aqmon.

ronakdedhia18 avatar ronakdedhia18 commented on June 28, 2024

Hi Alvaro,
Can you please try this code out and check your output as well because i am confused right now after you said that i have did wrong calculations.
Please let me know.

Thank you.

from aqmon.

avaldebe avatar avaldebe commented on June 28, 2024

I wont test and debug your code. This is not stack overflow, it is the issue tracker for a project that you are not using.

What I said is that the checksum calculation looks wrong. The checksum will tell you if you revived the message correctly or not. You can decide yourself if my assessment about your checksum calculation correct or not. For example, if every message you read and decode triggers a checkum warning, it is quite likely your checksum code is wrong.

from aqmon.

ronakdedhia18 avatar ronakdedhia18 commented on June 28, 2024

No problem.
Thank you for all your help.

from aqmon.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.