-
Notifications
You must be signed in to change notification settings - Fork 21
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
Sleep mode #2
Comments
It should be on passive mode between reads, but I'm not sure it really works. Not all available datasheets show the configuration commands. If you want to be sure the sensor goes to sleep, you could ground the SET pin (3rd pin on the header). |
I've tried to ground 3 pin, but it did not work. The fan in the sensor was still working. |
That is strange. Which sensor are you working with? |
PMS5003 |
@avaldebe the model is: PMS5003-2018041303330 |
I'm trying to modify your library and send sleep/wake commands. According to datasheet (http://www.aqmd.gov/docs/default-source/aq-spec/resources-page/plantower-pms5003-manual_v2-3.pdf) it should look like this: Functions in PMserial.cpp:
But the sensor is still working after pms.sleep();. Am I doing something wrong? |
It looks like it should work. Maybe the cksum (check code, last 2 bytes of the message) is wrong, and the sensor is rejecting the command. As I wrote before, I'm not sure that the PMSx003 sensors actually accepts the commands the library is sending. |
It seems I miscalculated the cksum codes. I think the codes should be as follows: //cfg[msgLen] = {0x42,0x4D,0xE1,0x00,0x01,0x01,0x71}, // set active mode
cfg[msgLen] = {0x42,0x4D,0xE1,0x00,0x00,0x01,0x70}, // set passive mode
trg[msgLen] = {0x42,0x4D,0xE2,0x00,0x00,0x01,0x71}; // passive mode read
slp[msgLen] = {0x42,0x4D,0xE4,0x00,0x00,0x01,0x73}; // sleep
wak[msgLen] = {0x42,0x4D,0xE4,0x00,0x01,0x01,0x74}; // wake Note that DATAH (4th byte) can have any value. I set it to 0x00 on all messages for simplicity. It would be great, if you could try this new codes. As I wrote before, I wont have time to work with this sensors until next weekend. |
@avaldebe it worked. Thank you for your help :) |
How to turn on sleep mode in this sensor?
The text was updated successfully, but these errors were encountered: