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

More sensor modes #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

More sensor modes #7

wants to merge 4 commits into from

Conversation

Zanop
Copy link

@Zanop Zanop commented Feb 12, 2018

Hi, Ive done this for a project of mine(portable PM sensor). I thought you might like it.

img_3277

Zanop and others added 4 commits February 12, 2018 15:40
Set working period:
* Continuous
* 1 Minute
* 5 Minute
* 4 HoursA
Set reporting mode
* Active
* Query mode
The sensor will sleep for working period-30sec, in the last 30 seconds the fan will work to circulate the air and take 1 mesurement at the end.
Rewriten command send method to wait for the actual reply. If we don't get proper reply within time we send the command again. This is needed bc the sensor would not respond somtimes.

TODO:
Query the sensor for 1 mesurement in query mode.
format fix
@goggel
Copy link

goggel commented Feb 27, 2018

I've tested this branch and it's working quite well. The working period seems to more or less solve the issue with sending the esp to deep sleep and waking up the sensor while doing so. The timing on the sds seems to be rather irregular, because while sending the esp to sleep for 5 minutes the sensor needs between 10 to 20 additional seconds the get the result.
A few comments on the code it's self:

  • mode_dsleep/mode_mon_300/mode_mon_60 should be one method allowing you the set the working period (needs calculation of the checksum, which should not be a big problem)
  • the mode* methods do completely different things and are quite confusion. Would propose something like setWorkingPeriod and reportAfterQuery/reportActive
  • If setting the sensor to mode_query a active query should be send when calling read
  • I'm always getting a timeout for the first sensor read. It's quite confusing for a user.
  • The documentation should be extended, because without reading the "Laser Dust Sensor Control Protocol" the different working modes and working periods are quite confusing and even worse some of the settings are persisted and setting the working mode to query is seemingly "bricking" the sensor

I'm working on addressing these issues and will create a different PR.
Any details an your sensor box?

@Zanop
Copy link
Author

Zanop commented Feb 27, 2018

Hi, meanwhile I've added some more, namely query function to actively query in query mode. I've noticed that in working period/active mode the sensor still consumes quite a lot of power even when waiting. Forcibly putting it to sleep and then waking it consumes a lot less power.
As for mode_dsleep/mode_mon_300/mode_mon_60 methods, I started this way with the idea to only do a few mods but things progressed quite a lot ;)

@Zanop
Copy link
Author

Zanop commented Feb 27, 2018

The sensor box is just a lunch box I found in the shop. I think its this one https://www.rothoshop.de/Kueche/Premiumdose-LOFT-0-5-l.html
The sensor fits perfectly on the bottom.

@ssz157
Copy link

ssz157 commented Mar 7, 2018

Hi There,
I m using SDS011 and CO2 sensor with Arduino mega. The only issue I have is that I cant get the SDS011 to sleep mode. It keeps on streaming all time. I need it to wake up for 30 secs and then again wake up after 5 mins.
Can anyone please help as I'm totally new to programming.

@Mogway28
Copy link

Mogway28 commented Mar 6, 2019

Could You write example for query mode. I cannot get it work.

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.

4 participants