A single chip general purpose circuit for sensor interfacing and characterization