sensor.start() in wrong loop