code for sensors