Circuit and method for acquiring alternating signal based on microcontroller

The invention relates to a circuit and a method for acquiring alternating signals based on a microcontroller. The circuit comprises a microcontroller and an operational amplifier. A non-inverting input end of the operational amplifier is connected with the alternating signals to be acquired. An inverting end of the operational amplifier is connected with two reference power supplies through a resistor. A relay is connected to an I/O (input/output) interface of the microcontroller. The relay is connected with the two reference power supplies and used for choosing one of the reference power supplies. When the microcontroller with an embedded A/D (analog to digital) converter is used to sample the alternating signals, increasing of A/D digits is not needed, relative accuracy of sampled values can be improved by increasing corresponding circuits, accuracy requirement needed by a system is satisfied, and convenience is brought to use.