SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By cschwemin
#128645
Hi all!

I am making my own lipo tester to check cell balance and the percentage of available power on my battery packs.
The problem i am having is that i want it to be universal for a 2s thru 6s pack, but when nothing is connected to one of the ADC ports the value floats around. Would using a diode to ground the adc channel, bringing it to zero be the correct way to fix this ? Then if a cell was connected to that ADC port, power would flow through the ADC and not right to ground. From what i have read on diodes this seems like it would work. Am i correct, or is there a better way ?

thanks
By cschwemin
#128667
itikhonov wrote:
waltr wrote:Use a resistor, 2 to 5k Ohm should work.
I vote for something like 50k just in case.
so would a diode be a better choice ? Or am i completely off on how a diode works.
User avatar
By itikhonov
#128672
cschwemin wrote:
itikhonov wrote:
waltr wrote:Use a resistor, 2 to 5k Ohm should work.
I vote for something like 50k just in case.
so would a diode be a better choice ? Or am i completely off on how a diode works.
Well guys will correct me if i am wrong but that's how i see it:

For atmega32u4 diode to ground circuit will look like this:
Code: Select all
| Vcc/2 ---||---'\/\/\.- |--|>--- GND
It will charge sample and hold 14pF capacitor through 1k to 100k resistor. To get zero you need to drive charge out of cap into GND that's why diode is that side to it. If you put voltage to the pin you diode will be hot as a hell.

Btw how you are going to put 22.2V onto adc pin?
By cschwemin
#128684
for the 22.2 v to the ADC i am using a voltage divider. I currently have this working with a 3s pack as i do not have a 6s to test with. One of the problems i am running into is i didn't realize was that resistors are not as close to there stated value as compared to what they actually provide. The other problem with this is as the voltage increases my accuracy decreases when scaling the voltage down that far.

Edit. just to be clear i am also using voltage dividers on all of the cells but the first as it should never exceed 4.2 volts.
User avatar
By itikhonov
#128710
cschwemin wrote:for the 22.2 v to the ADC i am using a voltage divider. I currently have this working with a 3s pack as i do not have a 6s to test with. One of the problems i am running into is i didn't realize was that resistors are not as close to there stated value as compared to what they actually provide. The other problem with this is as the voltage increases my accuracy decreases when scaling the voltage down that far.

Edit. just to be clear i am also using voltage dividers on all of the cells but the first as it should never exceed 4.2 volts.
You also need voltage clamps as protection from polarity reverse and accidental overvoltage: http://hades.mech.northwestern.edu/inde ... tage_Clamp

As for resistors precision - carbon film ones are usually sold with 5% from nominal precision (this means that 100kohm resistor is somewhere from 95kohm to 105kohm) but you can get ones with 1% or even 0.005% precision but just cost a bit more (or crapload more for 0.005 ones).

Also you can build autorange with digital potentiometer like MCP4017.