I'm having a problem when I measure a voltage from a lead battery. I provide my circuit so you can understand better whats happening.
For example I measure a 24 V battery, goes to a resistor divider and then to an operational amplifier (+ terminal). On the other side (- terminal) there is a stable voltage through a TL431. The output of this goes to my PIC.
If I connect a variable supply instead of a battery and "mimic" how it would be, all function perfectly. The problems appear when I connect a real battery. I think that the problem is the ripple because while I'm measuring the battery the voltage does not exceed the reference voltage in the negative terminal of the AO but it activates the input of the PIC, therefore the output of the AO.
Summing up, what its the best option? An LC filter? An active filter with an AO? An AO as integrator?