Complete Sensor code