recently i got an arduino project to prove my worth as a micro-controller laboratory assistant.
however, at the time, when i was trying to use the sensor, suddenly my arduino became unresponsive because the sensor was producing a negative output.
the best way to escape from the problem is to restart the device by itself. luckily, someone had added the function from assembly instruction inside the watchdog library.
the functions are wdt_disable
and wdt_enable
which you can use both like this:
#include <avr/wdt.h>
void
myreset(void) {
wdt_disable();
wdt_enable(WDTO_15MS);
while(1) {}
}