add sensor reading code