Fast, versatile and low-cost interface circuit for electrochemical and resistive gas sensor