To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 19049
19048  |  19050
Subject: 
Re: Voltage Sensor
Newsgroups: 
lugnet.robotics
Date: 
Wed, 18 Sep 2002 12:02:15 GMT
Original-From: 
PeterBalch <peterbalch@compuserve+Spamless+.com>
Viewed: 
508 times
  
A) Make up a resistive network from the internal 10k pullup resistor and
  2 external resistors (one pulldown to ground, one to the battery to be
  measured), and calculate output voltage as a function of input voltage
B) Extend the range from 0..5V to  0..15V by a resistive divider followed
  by an Operational Amplifier
C) Offset the range from 0..5V to 10..15V by an Operational Amplifier

I presume you're using a 12V lead-acid or NiCd battery. As the battery
discharges, the output voltage drops, slowly at first but then faster when
it gets close to being empty. By the time it reaches, say, 10V, it's time
to recharge it. So when you're monitoring batteries, you only bother with
the "top" few volts. The advantage of the "offset" is that you can apply
the full range of the RCX input sensitivity to these "top" few volts and so
get better resolution.

But do you really care about resolution? The usual question you want
answered is "Is it time to recharge". And the answer is "yes" if the
battery voltage has fallen significantly. You don't really care if it's
fallen to 11.2V or 10.7V. But perhaps you do care about accurracy and
resolution - maybe you're monitoring the battery voltage to see whether a
motor has stalled.

(No doubt someone else will have explained this in a separate posting by
the time this one gets posted.)



Rather than use an Op amp to offset the range, use a Zener diode instead of
the upper resistor of the potential divider described in (A). I'd use a 10V
Zener which means the you can measure battery voltage in the range
10V..15V.

So the circuit is:
        Battery +terminal to Zener +terminal;
        Zener -terminal to resistor-1 terminal A and to resistor-2 terminal
A
        resistor-1 terminal B to ground
        resistor-2 terminal B to the RCX sensor input

What value for resistor-1? I'd say a couple of thousand ohms. If you use a
smaller one, you're throwing away more current from the battery. If you use
a larger one, you get a bigger effect from the input impedance (and pullup)
of the RCX.

But then comes the next worry. If you're charging a car battery then, the
charger might produce more than 15V (unlikely but better safe than sorry).
In which case the voltage at the Zener -terminal would rise above 5V. I
imagine that the RCX sensor input has an internal diode to stop the voltage
rising above 5V. The battery charger can produce a huge current and you
don't want it to flow through the RCX sensor input diode. So limit the
current using resisor-2. Lets say you limit it to 2mA if the charger
reaches 20V (extremely unlikely!). That implies resistor-2 should be 2.5k
(2.7k is the nearest you can buy).

Which terminal of the RCX input do you connect to? What if you get it wrong
and connect to the ground terminal instead of the actual sensor terminal?
Don't worry, no damage will be done - you wn't measure the battery voltage,
that's all.

Be careful when you're experimenting. If you connect the 12V battery
directly to the RCX input, you might damage the RCX. Always have resistor-2
in place.

I'm no RCX expert - does that sound reasonable to everyone else?

Peter


Take care. Do it at your own risk. Don't blame me if it all goes horribly
wrong. Mileage may vary. Always read the label. Investments may go down as
well as up. Etc., etc.

But don't be too paranoid. I'm forever hacking electronics and I only
destroy something once every six months or so!



Message has 2 Replies:
  Re: Voltage Sensor
 
(...) Thanks Peter, Yes, it was brought to my attention that the useful portion of a 12V battery is at the top end of the voltage range. I don't think I thought about it to be honest - I guess the learning curve just keeps pointing up at this stage. (...) (22 years ago, 18-Sep-02, to lugnet.robotics)
  Re: Voltage Sensor
 
Hello, (...) This is a really interesting idea. Make sure to allow a current of roughly 10% of the Z-Diode's maximum rating, even for the lowest battery voltage you are interested in. Then you will have little effect of the pullup or the variation (...) (22 years ago, 19-Sep-02, to lugnet.robotics)

3 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR