saves sensor data to sqlite database