C3 Analog Port Header usage
Rsadeika
Posts: 3,837
I will be using the C3 on my mobile robot, and I would like to keep track of the charge state in the two 6VDC (8 and 10) amp hour batteries. I have used a voltage divider setup to bring the voltage down to the 5VDC level, and then try to figure what the actual voltage of the batteries are. Is there a better way of doing this with the C3? Anybody have some slick solutions or examples out there?
Thanks
Ray
Thanks
Ray
Comments
The top side of the divider is a 14.7K resistor, the bottom side is a 1.62K resistor. It works well.
Ray
There is no formula per se, just ohms law really. V=I*R and the voltage divider equation. So, in this case, you have a number of variables and not enough constraints, this is fine, just set up some node or loop equations for the circuit and then pick a value, and then let the other value fall out of that constraint, then pick another value and adjust until you find the values that give you the max range you want, have the correct impedance and satisfy what you are trying to do. Basically, just use a heuristic algorithm and a few values. Of course, there always is away to do the calculations, but its not needed if you use some rough guestimates and trial and error on paper or spread sheet.
Andre'
I have not checked my battery values after a full charge, but I think it was 6.25V. Using the above mentioned calculator, it shows r1 - 250, r2 - 1000 would get me 5V output. I chose 250, and 1000, because I have those resistors available. I guess what I am thinking is, I check the charged value of the battery, and use the highest value, then pick the resistor values that I have on hand. Then I can use JonnyMac formula with my values, is this correct?
Ray
I suspect your batteries could charge somewhere north of 6v so you should prepare for this. For example, use 8v. In an ideal situation you'd like to have a divider that gives you pretty close to 5v (full-scale input of the adc) at the tap when you have 8v on the input. With arrangement the ration of the stack (both resistors) to the one below the tap is 8 / 5. You may have to select empirically to find the best combination, and building a little spreadsheet will help.