Self-Reset if sensor data is garbage.
Some refactoring of function and variable names.