I am trapped in a Arduino project, plz help me out.
I have a carbon monoxide sensor with Aruidno. Basically, I want to shutdown my generator when CO reaches a certain level plus continue for certain minutes. For example, the CO reaches xxx ppm and the generator waits for 5 mins to shut down.
I couldn't find a function in which Arduino can record time. In other words, I don't know how to write this 5 mins.
manor_royal:
As a matter of interest though, would you continue to monitor the CO in the 5 minutes and cancel the shutdown if it goes back to a safe value?
That's a good idea. My logic is : if CO is above 200 ppm, the timers starts to count and generator keeps running for 40 mins and shut down. If the CO level goes below 200 PPM, the timer stops count,but as soon as CO reaches 200 PPM again, the timer starts to count again. The idea is, as long as the timers reaches 40 mins, generator shuts down.