Added functions to read sensor data