Author Topic: IC That Will Indicate When I Have Low Battery  (Read 2207 times)

0 Members and 1 Guest are viewing this topic.

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
IC That Will Indicate When I Have Low Battery
« on: September 03, 2011, 04:29:23 PM »
Hey guys,

Im looking for an IC that will send serial data to my pc indicating when my battery is low.  Im using an axon ii and a sealed lead acid battery.  Any suggestions are appreciated.

Offline garrettg84

  • Robot Overlord
  • ****
  • Posts: 187
  • Helpful? 8
  • Armchair Roboticist Extraordinaire
Re: IC That Will Indicate When I Have Low Battery
« Reply #1 on: September 03, 2011, 08:19:59 PM »
You could do that with one of the A/D converters on the axon itself and a voltage divider setup (set of two resistors) depending on your battery max voltage....

http://www.arduino.cc/playground/Main/AOneLedVoltmeter
-garrett

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: IC That Will Indicate When I Have Low Battery
« Reply #2 on: September 03, 2011, 09:33:27 PM »
Hi,

Im looking for an IC that will send serial data to my pc indicating when my battery is low.  Im using an axon ii and a sealed lead acid battery.  Any suggestions are appreciated.
The only time a voltage reading of a lead-acid battery will tell you its state of charge (SOC), is when it has been left at rest (i.e. with no charge or discharge going on) for at least 4..8 hours.
That means you have to use something like sampling at periodic (short) intervals to get the SOC, or at least an indication of its approximation.

But... Since you are unlikely to use even half the Axons resources, why by extra chips - you have ample processing power idling around?
Just use either one of the comparators, or if you want to have graded alerts, use one of the A/D-C's.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Afroman

  • Expert Roboticist
  • Full Member
  • *****
  • Posts: 50
  • Helpful? 4
Re: IC That Will Indicate When I Have Low Battery
« Reply #3 on: September 04, 2011, 11:29:31 AM »

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #4 on: September 05, 2011, 06:17:06 PM »
I am just looking for someway to let me know when I have approximately ten minutes left of charge.  How would I use one of the analog to digital converters?  This is my first experience with the Axon II so as you can tell I am a bit newbie.  Would I just set up a voltage divider circuit and connect it to the ADC pins?  Also, I am not sure how I would program/ configure it?

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: IC That Will Indicate When I Have Low Battery
« Reply #5 on: September 05, 2011, 06:34:21 PM »
Hi,

I am just looking for someway to let me know when I have approximately ten minutes left of charge. 
You cannot make a precise estimate working for any battery, but running down your specific battery 3..4 times while measuring should net you an average voltage (depends on instantaneous current draw when measuring) that it will have 10 minutes prior to running flat - assuming you have the same current draw in normal use.
Any variance on the current draw will obviously show up in the (lack of) precision.


How would I use one of the analog to digital converters?  This is my first experience with the Axon II so as you can tell I am a bit newbie.  Would I just set up a voltage divider circuit and connect it to the ADC pins?  Also, I am not sure how I would program/ configure it?
This site should hold ample tutorials and examples and reading the datasheet on the controller is a must too, so you have a lot of reading to do.
Yes, you would need a voltage divider to get the voltage within the 0..5V range. Setup can be found in the atasheet and you can find many examples (this site and on the web in general).
Did I mention that building robots takes a lot of reading?   :)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: IC That Will Indicate When I Have Low Battery
« Reply #6 on: September 05, 2011, 08:28:16 PM »
If you don't already know how to send data through UART to a computer (via an RS-232 port or a USB-TTL serial converter), now's the time to look it up. Webbotlib provides handy functions that you can use for the communication.

If you already know how to do that, you just need to connect them together with something simple, like this (pseudocode):

Code: [Select]
if voltage < measured_10min_left_voltage
  print "low voltage" to serial

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #7 on: September 05, 2011, 09:16:00 PM »
Thank you Rbtying.  That helped.  I am pretty familiar with UART.   I guess what I am trying to get it is that I don't really get how to configure the the voltage divider so it will know when I have ten (approximation) minutes left.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: IC That Will Indicate When I Have Low Battery
« Reply #8 on: September 05, 2011, 11:36:26 PM »
note: Several flame-like posts were removed, based upon a request sent to me.

Sylvestre, here is the general process:

1) Using my battery monitoring tutorial, have a voltage divider get the voltage to say half. For example, if you have a 6V batter, fully charged it may be 7.2V. But your ADC will fry above 5V. So a 1/2 voltage divider will keep the voltage below 7.2/2 = 3.6V. You generally want it closer to say 4.8V for better resolution.

2) Plug the output of the voltage divider to your ADC, have your mcu read that voltage

3) Output that voltage by USB from your Axon II, and your PC can read it using hyperterminal or whatever

4) Have it read out a low battery, and that value it gives (or anything below that) will then be known as 'low battery'.

I like to use a battery monitor on my robots as it saves me debugging time. It simply warns me of a low battery by UART before my robot starts acting funny.

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #9 on: September 06, 2011, 03:44:17 PM »
Ok thank you Admin.  One problem though, the battery I am using is 12 volts so if I used resistors of different values Would this work?
« Last Edit: September 06, 2011, 05:09:28 PM by Sylvestre »

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: IC That Will Indicate When I Have Low Battery
« Reply #10 on: September 06, 2011, 04:26:11 PM »
Ok thank you Admin.  One problem though, the battery I am using is 12 volts so if I used three resistors, instead of to would my voltage be divided by three?  Would this work?


It's not the number of resistors, rather the ratio of their resistance. You need to calculate the value of the resistors that you need, for whatever circuit you're going to use it on. You'll need different sets of resistors for different voltages. Take a look at the following, which may give you a better understanding. There are other tutorials on the web as well.

http://www.sparkfun.com/tutorials/207

Joe

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #11 on: September 06, 2011, 04:42:03 PM »
Oh ok I see.  Sorry  :P.  Which would be better for me to use, a 1000 ohm resistor and a 700 ohm resistor or a 10000 and a 7000 ohm resistor?  I am using a 12 volt 55 ah battery.  The total current draw of everything is 42 amps.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: IC That Will Indicate When I Have Low Battery
« Reply #12 on: September 06, 2011, 04:47:40 PM »
Remember Ohms Law

V = IR

or

Voltage / Resistance = Wasted Current Loss

Voltage is your battery voltage, the resistance is the sum of both resistors which you choose.

A microcontroller requires *some* current, so allowing say 1mA for current would be fine.

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #13 on: September 06, 2011, 05:08:15 PM »
Ok I am bit confused with the last statement.  I don't undertand what you mean  ???.  So which resistors should I use?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: IC That Will Indicate When I Have Low Battery
« Reply #14 on: September 06, 2011, 05:20:22 PM »
If we tell you, you won't learn how to calculate resistor values yourself :P

Look at that equation, and start plugging in numbers and see what happens. This thread has the clues you need. I bet it won't take you more than 10 minutes to have that 'ah ha!' moment. ;D

When you figure it out, but still aren't sure, post your result here and we'll verify it for you.

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #15 on: September 06, 2011, 05:37:47 PM »
I honestly do not understand this.  I don't what it is, but I find it difficult to comprehend this particular thing.  This does not seem right, but
Voltage: 12 volt
Resistance: 1700 ohms
12/1700=0.007
Final Output Voltage:4.9 volts

No idea
« Last Edit: September 06, 2011, 05:40:48 PM by Sylvestre »

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,930
  • Helpful? 98
Re: IC That Will Indicate When I Have Low Battery
« Reply #16 on: September 06, 2011, 06:00:39 PM »
12/1700=0.007 Amps = 7 milliAmps
Now go back and read Admin's post above.

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #17 on: September 06, 2011, 06:10:30 PM »
Oh now I understand!  Wow how foolish I am!  What I wasn't understanding was that 0.007 amps is 7 milliamps.  Blank moment I guess.  So the total resistance shoud add up around 9000, right?

12/9000=0.0013

Will these two resistors work, then?

r1: 5500 ohm

r2: 3500 ohm 

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: IC That Will Indicate When I Have Low Battery
« Reply #18 on: September 06, 2011, 06:13:49 PM »
Those would be fine IF your battery's max voltage was really 12.00v - but that's somewhat unlikely. The fully-charged voltage of a lead-acid battery is more in the range of 13 or 14 volts - recalculate your resistors' ratio based on that.

But you're on the right track - good to know that you're learning things!

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #19 on: September 06, 2011, 06:28:22 PM »
Well this is actually the output voltage of a switching regulator that I am feeding to the electronics (everything besides the motor).  My initial voltage is 24 volts 55 ah (two 12 volt batteries connected in series).  Switching regulators are usually accurate so I should be fine.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: IC That Will Indicate When I Have Low Battery
« Reply #20 on: September 06, 2011, 06:32:50 PM »
I'm confused . . . is this what you have?

24V battery -> switching regulator -> 12V output -> to electronics

If you are measuring the 12V, it won't tell you your battery is low until it's nearly dead (in which case your mcu might fail, anyway). You'd need to measure the voltage before the regulator to get a good reading.

What electronics do you have?

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #21 on: September 06, 2011, 06:41:58 PM »
Quote
24V battery -> switching regulator -> 12V output -> to electronics
Yes that is correct.

Quote
What electronics do you have?
Electronics:
Video transmitter and receiver
camera
Axon II
hardware connected to Axon II (I dont think matters)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: IC That Will Indicate When I Have Low Battery
« Reply #22 on: September 06, 2011, 07:00:00 PM »
In this case, you need to measure the voltage at the 24V battery end. Your voltage divider would have to give you an output no greater than 5V, even with a fully charged battery.

Basically the same thing you already did in your previous calculations.

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #23 on: September 06, 2011, 07:24:09 PM »
So according to your previous post I have to put the voltage divider setup before the regulator?  How will I send serial data then or will it be still hooked up to the ADC on the microcontroller?

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: IC That Will Indicate When I Have Low Battery
« Reply #24 on: September 06, 2011, 08:08:45 PM »
You just need to have the high end of the voltage divider connected to +24v - everything else should come after the regulator, and the ADC input should connect to the center of the voltage divider.

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #25 on: September 06, 2011, 08:27:32 PM »
Ok sounds good.  I still need to change my resistor values though because they have correlate with 24 volts rather than 12 volts.  I drew up a real amateur schematic (don't have that much time) just to double check my answer.  It is attached.  The lettering is backwards because I used a webcam, but most of it is readable except for where it says voltage regulator in the middle.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 375
  • Helpful? 32
  • Your success is in your hands.
Re: IC That Will Indicate When I Have Low Battery
« Reply #26 on: September 07, 2011, 04:55:57 AM »
No, the schematic is incorrect.
The resistors should connect to negative on one end and not in-series with supply to the regulator input.


 |------ + -|------------ to regulator input
24V          R
 |             +--- to ADC
 |             R
 |------ - -|-------

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #27 on: September 28, 2011, 08:47:34 PM »
I just realized that my resistor calculations are flawed because I didn't take into account that I had a 24 volt battery.  If you guys could quick verify this, that'd be great. 

Resistor 1: 16,000 ohms
Resistor 2: 4,000 ohms

4,000/20,000=0.2

0.2*24= 4.8 volts

24/20,000= 1.2 ma wasted

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: IC That Will Indicate When I Have Low Battery
« Reply #28 on: September 29, 2011, 12:45:30 AM »
Correct  :)
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline SylvestreTopic starter

  • Robot Overlord
  • ****
  • Posts: 221
  • Helpful? 13
Re: IC That Will Indicate When I Have Low Battery
« Reply #29 on: November 19, 2011, 01:06:45 PM »
If I am hooking up my two sealed lead acid batteries in series to produce 24v, will I get a little over 24 volts?  Should I recalculate my resistor values for 24 or 25 volts?

 


Get Your Ad Here

data_list