When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network.
Could be a corroded or otherwise poor electrical connection at the sensor too. The OP doesn't say how long the on and off conditions persist. If they have a fairly long duration, I'd suspect the connection.