write sensor data to tmp file