complete registerSensor example