Hello Fredy,
To further elaborate on the comments of Peter -
There seems to be two possibilities using a single op amplifier for each channel, one using an inverting configuration, and the other using a non-inverting configuration. If you are not already familiar with these terms, most text books on analog topics should cover these basic configurations. To keep things simple, the op amp will need to be of the output "rail-to-rail" type, and operate from the same supply as the MCU.
For the non-inverting configuration, the input signal would be applied to the non-inverting :smileyplus: input. There will be a feedback resistor between output and inverting :smileyminus: input, plus a source resistor typically returned to ground. However, to provide the necessary voltage offset in this case, the source resistor will need to be returned to a fixed, negative reference voltage, equal to one half the positive Vdd value, assuming equal resistor values. Because the non-inverting input will swing negative, the amplifier will need a negative supply voltage.
For the inverting configuration, the input signal will be applied to the source resistor. and a fixed, positive reference voltage would be applied to the non-inverting :smileyplus: input. Again, assuming equal value resistors, the reference voltage would be one half the Vdd voltage. For this method, your code will need to allow for the ADC input voltage swing towards zero as the input voltage increases above zero, and vice versa. This method also has the disadvantage of a lower input resistance (the source resistor value) compared with the non-inverting method. However, I prefer this method, where possible, because the reference voltage can be derived directly from Vdd, using a voltage divider. Additionally, the amplifier does not require a negative supply voltage.
For either method, since the resistor values will have a tolerance (1 percent resistors should be used), the input voltage level may differ slightly from one-half Vdd, when the input voltage is zero. If the offset error can be predetermined, and a correction value stored in non-volatile memory, the firmware can compensate for the error.
Regards,
Mac
Message Edited by bigmac on
2008-01-14 11:26 PM