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

checksum #1

Open
DaveDavenport opened this issue Jul 16, 2021 · 13 comments
Open

checksum #1

DaveDavenport opened this issue Jul 16, 2021 · 13 comments

Comments

@DaveDavenport
Copy link

I am trying to read the data by snooping the read line (not sending command)

I think the checksum is:

256-(head+len+data)
This seems to match.

looking at other products the 3rd byte returned is the command?

@bertrik
Copy link
Owner

bertrik commented Jul 16, 2021

Yes, I think so too, this is the way it is currently been prepared in the code, but I haven't been able to confirm that myself.

@DaveDavenport
Copy link
Author

I did find it in datasheet of other sensor, but actual commands for this one i have not found.

I see it send 0x0b and 0x02 (if I remember correctly) being send to the sensor and 16 bytes of data coming back.

(looks a bit like raw values, but not completely clear to me).

@DaveDavenport
Copy link
Author

I get this back:

0 0
1 0
2 0
3 9
4 0
5 0
6 3
7 31
8 0
9 0
10 0
11 9
12 1
13 0
14 0
15 0

(first is index, 2nd dec. value).

I see 2,3 - 6,7 - 10,11 rise up sharply when I agitate it.

But no clear conversion to what is what and how to convert.
(other sensors give near 0 for pm 1.0,2.5 and 10 in this room atm).

maybe I will log it for a while and correlate it.

@bertrik
Copy link
Owner

bertrik commented Jul 17, 2021

Cool, thanks for sharing the results of your experiments.
I was wondering if the other data in the response could perhaps be a raw particle count (not a ug/m3 value).

Are you actually using the code from this repository to test?
Do you have a level-shifter or something like that in the serial tx/rx lines?

I updated my code to make it a bit easier to send other commands, with variable length command data (assuming that the second byte is the payload length). I'm still unable to test this myself.

@DaveDavenport
Copy link
Author

I currently only snoop the tx line (via 10k resistor to a ftdi cable attached to laptop).

I was thinking of popping off the small mcu on the pcb and attach a wemos to it.

@DaveDavenport
Copy link
Author

DaveDavenport commented Jul 17, 2021

1594108275370_4598.pdf
datasheet of mcu.. (need to translate).

@DaveDavenport
Copy link
Author

DaveDavenport commented Jul 17, 2021

https://github.com/Hypfer/esp8266-vindriktning-particle-sensor just found this.
(I don't think that code is valid.)

@bertrik
Copy link
Owner

bertrik commented Jul 17, 2021

Maybe the other command is to read out the temperature.

@bertrik
Copy link
Owner

bertrik commented Jul 17, 2021

My pm1006k.cpp should be pretty universal Arduino code. It doesn't contain any processor-specific code and should be easily portable to other microcontrollers with arduino. I didn't bother to strictly split the protocol code from the code that assembles the command and sends it to the device.

@DaveDavenport
Copy link
Author

I wonder how ikea parses the values, what I get from snooping is not a ug/m^2 but it does correlate with other sensor I have.

@DaveDavenport
Copy link
Author

image

blue/yellow is value 1 and 3 I read back..

the other 2 lines is the pm25 from 2 other sensors I have. (they where not close to eachother).

@DaveDavenport
Copy link
Author

its seems a lot more sensitive and 'quick'. I also have not seen it drop below 8. (even next to an air purifier.)

@DaveDavenport
Copy link
Author

DaveDavenport commented Jul 18, 2021

I compared my old sensor (I have 4 in total) and they line up (2 brands). the one sitting outside also seems to line up pretty close to official weather station close by.

The two ikea seems to never drop below '8' and seem in general to indicate around '9' to high compared to my other ones.

Ones offset applied they seems pretty close when sitting next to eachother.

(weirdly me soldering the 3 pads damaged the background light sensor (in one) as they don't go full power..)
image

(green vs blue).

I have multiple air-purifiers in house running, since I have them the particle count does drop to close to zero pretty quick.
Not sure what is a good way to validate who is correct :D. (I am more concerned in relativer then absolute numbers, so not too concerned.)

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

No branches or pull requests

2 participants