Great work. Thanks for the write-up !
Best posts made by Spottyq
Latest posts made by Spottyq
RE: Detect Generator running
Why is the input switching when the generator is on ? Is it switching at 50Hz (or 60Hz) or for an other reason ?
If it is switching at 50Hz, simply require the signal to stay low for >0,02s before considering the generator is off. (As a general rule, it is a good idea to have these debounce timers.)
If it is switching for an other reason, you'll have to find why it is doing so. A multimeter will probably of great help (or just use Serial.println(), comment the sleep() function and connect your computer to the Arduino.)