remove errors in readings

If I wanted to know if the fan is running, I'd use a light and a phototransistor to detect that.