Interfacing sensors with microcontrollers