add sensor.cpp