Battery voltage sensing using TIVAC123 microcntroller - Page 1
Forum section: electronics / general

author: muthukural001
author_rank: Regular Contributor
timestamp: July 22, 2019, 12:45:14 pm
content: Hello All,I want to measure a 14.8V LiPo battery and it has a cutoff voltage of 12.8V at which I want to disable the motor driver and other peripherals...Since the MCU ADC's vref 3.3v, I used a voltage divider to divide the 14.8V with100Kohm and 20 Kohm, these resistors gives 2.96V for 14.8V and 2.56V for 12.8V...I read the TIVAC123 datasheet for ADC input resistance, which is 2.5Kohm only...If you calculate the thevenin resistance for the voltage divider, it is approximately 16.6Kohm...The source impedance the TIVAC123 wants is less than 500Ohm but what I am feeding is 16.6Kohm...The impedance mismatch needs a opamp based buffer in between the voltage divider and ADC...My question is that, should I use a RC filter at the input the OP-AMP?.If yes, what cut-off frequency I should select as the input is battery voltage?.what op-amp to do this job?Thanks,Muthu

author: rstofer
author_rank: Super Contributor
timestamp: July 22, 2019, 02:14:53 pm
content: If you study Chapter 4 of "Op Amps For Everyone" (Google for it), you will find out how to offset and scale the input to allow an expanded range at the ADC as well as provide a low impedance output. It takes 4 resistors and a single supply op amp.

author: muthukural001
author_rank: Regular Contributor
timestamp: July 22, 2019, 04:28:45 pm
content: Hi rstofer,Thanks for the reply...I have read but I found nothing related to Lowpass filter at the op amp input side...Right now, my concern is, Do I need a low pass filter at Op-amp input side?.Because, battery voltage is getting divided and coming to the op-amp.As we know, battery source is pure DC.So there will be no need for filter that I think...Please correct me if I am wrong?

author: rstofer
author_rank: Super Contributor
timestamp: July 23, 2019, 01:06:28 am
content: I think you're right but...Assume for a moment that the output impedance of the op amp is 0 Ohms. Then suppose the ADC on the uC requires a driving impedance of 2.2k Ohms. That means we can put a 1k resistor in series with the pin and hang a capacitor to ground without worrying about the effect on the Op Amp. The cap can be anything. 1 ufd? 0.1 ufd?Breadboard it and see how it works. As you said, the battery is pretty solid but if there are DC motors involved somewhere there can still be trash on the input to the op amp. You can hang some small capacitors on the inputs after the divider. 0.1 ufd?I would think that capacitors on the op amp inputs would be sufficient. The only value in having a capacitor on the ADC input is to lower the driving impedance.Don't forget that you will be using a running average of ADC readings. There are a bunch of ways to do this but, in the end, you probably want to average several. You really don't want to see 'last digit bobble' if you hook the uC to a display of some kind.

author: muthukural001
author_rank: Regular Contributor
timestamp: July 23, 2019, 02:28:29 am
content: Hi,In the TIVAC123 datasheet, they have given that Max analog source resistance of 500 ohm...If I put 1k in series with the pin, I will violate it right?... Instead, I have to put <=500 ohms?...Thanks