PDA

View Full Version : Help with battery tester for robot??



Jay-Bob
06-04-2005, 07:59 PM
Hello all,

I am entering the wonderful world of STAMPing!! http://forums.parallax.com/images/smilies/yeah.gif

I am building a robot Tank with 2 STAMPs, one on the Tank end and one on the Remote end. I am going to build transceivers on each side, so I can relay information back to my STAMP in the Remote for a status readout on the Remote Control.

I want to have the ability to test the status of the batteries in the Tank and transmit that back to the Remote. I have found the ADC0831 to test the battery status digitally and then I can send it back serially to the Remote. I was wondering if it would be easier to use a resistor/cap diagram to test the voltage? or would it be safer (for the STAMP) to use the ADC?
I am going to use 9.6V NiMH batteries with a 5 voltage regulator for my STAMP and TTL circuits and a 3V regulator for the motors. I think that the 9.6V should last a little while under these conditions, so I would want to relay back to the Remote the status as the voltage drops. I will use some LED's on the Remote to give me a status of Voltage.

I studied Electronics and MicroControllers (PICs) in college for two years, I know some, but not all...... will you guys help me out??

J
US Army
Mannheim, Germany

Jon Williams
06-04-2005, 10:48 PM
I'd stick with the ADC0831 since it will give you better precision than an RC circuit, but it's a 5-volt device so you'll want to run the raw battery voltage through a precision divider to take to the input of the ADC0831.

Thanks for serving ... I was a Radar/ECM guy in the USAF.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Jay-Bob
06-04-2005, 10:55 PM
I enjoy it... wish I would have joined the Air Force, but hind sight is 20/20 http://forums.parallax.com/images/smilies/smile.gif LOL

What would you recommend for the voltage divider?
a POT?
but won't the output fluctuate due to voltage drop? so therefore, it won't be a true divider?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
J

Jon Williams
06-04-2005, 11:02 PM
You want to monitor the battery voltage, right? I would use two precision resistors (say 50K each) and take the center tap to the input of the ADC0831. When your battery is fully charged you should get about 4.8 volts to the ADC. If you're using your regulated 5 volts as the ADC reference, 4.8 volts would give you 244 (4.8 / 5.0x 255) counts from the ADC. Let's say you want to do something when the battery voltage drops below 7 volts -- you'd read your ADC periodically and when it fell below 178 you'd do something about it.

Assuming you use a divider with both resistors being the same value, you can calulate the counts from you ADC for a given voltage like this:

(raw_volts / 2) / 5.0 x 255

So from my example above, (7 / 2) / 5 x 255 = 178

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Post Edited (Jon Williams (Parallax)) : 6/4/2005 3:05:02 PM GMT

Tracy Allen
06-04-2005, 11:52 PM
If you do want to try the RCtime route, there's a tutorial here...
http://www.emesystems.com/BS2rct.htm#B_voltage

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

Jay-Bob
06-07-2005, 02:52 PM
Thank you so much Jon!!!!

Putting two 50K between the 9.6V and GND will give me the situation that I want, plus will keep me from dropping very much current out of the batteries....

Thanks again,


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
J

Brian Carpenter
07-29-2005, 11:08 PM
jon,

so based on your equation. (raw_volts / 2) / 5.0 x 255
if i am using a 11.1 v lithium battery that i want to monitor the math would be. ( 11.1 / 2 ) / 5.0 x 225. is this correct? for this voltage would i also use the same 50k resistors?

Brian Carpenter
07-29-2005, 11:14 PM
jay-bob, could you post how you make that circuit. what pins and where the resistors go?

Jon Williams
07-29-2005, 11:20 PM
In your case you should use a lop-sided divider. If you use a 100K and 50K (the 50K is on the "bottom") a voltage of 11.1 volts at the "top" (to the 100k) should give you about 3.6 volts at the junction -- this falls below the 5v reference you'd typically use for the ADC0831. Adjust the equation like this:

(raw_volts / 3) / 5.0 x 255

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Brian Carpenter
07-30-2005, 01:21 AM
Jon, i am sorry for the ignorance. is it possible to show me a diagram of how these resistors wire with the taps for power?

Jon Williams
07-30-2005, 01:51 AM
Here it is. Note that if this doesn't make sense, you may want to work on your electronics skills a bit before proceeding (or get a friend to help). We'd hate to have you misconnect something and damage your BASIC Stamp.

Note that V_Mon is your 11.1 volt input. If you need more information on the ADC0831 this article may help:

http://www.parallax.com/dl/docs/cols/nv/vol6/col/nv118.pdf

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Post Edited (Jon Williams (Parallax)) : 7/29/2005 6:00:15 PM GMT