Sampling air daily

I’m using a sketch that came with the dust sensor which samples every so many seconds.

But I will want to sample 3 times a day at most.

Is using the delay() the best way to accomplish this?

No, use millis().
Check out the blink without delay example.

delay() is the worst way to accomplish this.

How precise do you need it? Can you allow the sample time to drift off by a few hours after a year's operation? Can it drift by a few minutes over a year?

If a few hours is acceptable then use millis() to tell the time.

If a few minutes is acceptable then you need a Real Time Clock (RTC) hardware module.

If you need it more precise than that then a GPS module will keep your time synchronised to the GPS master clock which is more accurate than the rotation of the Earth itself.

Well now that I think about it, I'd like to sample the air at least 1x an hour.

I originally thought I should sample it 3x a day but that wouldn't be very representative.

blink without delay holds the key.

you can set the timer to perform you sample each time period.

there are two schools of thought.

record each hour. the other is to record each time the value changes by some number