Hi there, I am looking at building one for monitoring my indoor conditions.
However, I see that it runs the PM sensor continuously. Since the laser diode has a finite lifetime, I would like to have it wake up to run for 30sec (recc’d period for fan spooling), take reading, and then sleep for 2mins, repeat. I went through the library to see it has Passive Mode included.
I’m not very well-versed in coding, so I don’t really have a clue how to set it up this way.
At the same time, I’d like to have the rest of the sensor readings being taken at a different interval (e.g. every 5 sec) compared to the PM sensor (every 2 mins). How may I implement these two concurrent “loops” as well?
Has anyone managed to implement something similar?
Any help is appreciated, thanks!
EDIT: Found if-statements with millis() can let me run concurrent events at different intervals. But I’d have to use delay() during the warmup process, which would hold up the loop anyway, since the process will get stuck at that line until it is done waiting. What other ways can make it work?