Comparing difference between on/off readings for detection

This means it's possible to make the sensor more sensitive, but at the
same time still (hopefully fairly noise resistance).  Previously was
using an abitrary threshold.  Also made loop run quicker.