sensor read and referance state working