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 / 19042
19041  |  19043
Subject: 
Re: Voltage Sensor
Newsgroups: 
lugnet.robotics
Date: 
Tue, 17 Sep 2002 21:05:12 GMT
Viewed: 
892 times
  
Hello Tom,

With the setup you describe (option C) does the output of the op-amp go
directly to the RCX, or does it still need to be sent through a general
analog interface?

Yes. You need a low impedance output driving 0..5V into the RCX, thus
overriding its internal pullup.

How does the voltage off-set (0..5V to 10..15V) improve the accuracy of the
sensor?

Actually, I should have written "resolution" instead of "accuracy". The
10..15V range spans 5V with 256 steps, giving you a resolution of roughly
20mV. That means you will get a different RCX raw reading for every change
in voltage that is 20mV or more.

Compared to that, the 0..15V version has 60mV resolution.

And in this setup does the RCX still only receive a 0 - 5V input
range?

Yes, because exceeding this range does not give you correct raw values, and
may even damage the RCX.

(I am also assuming that the entire 0 - 12V battery range is being
monitored)

Why would you want to do this? At 10,8V the battery is totally empty. At
14,4V it is fully loaded. I think this is the interesting range, isn't it?
For simplicity, I suggested to shift (offset) the 10..15V range down to
0..5V.

Typically, what components and their corrisponding values and type would be
required to build the option C configuration?

You need an Operational Amplifier (preferrably an internally compensated,
low-power, rail-to-rail version), plus some resistors. Because what you want
to do is subtract 10V from the input voltage you intend to measure, you will
need to arrange the OpAmp in an Subtractor configuration:

  <http://homepages.which.net/~paul.hills/Circuits/Adder/Adder.html>

The above circuit may look a little complicated, but if you leave out the
Vb, Vc, V2, and V3 inputs and associated resistors, it already looks a lot
simpler. With the assumptions
  Ra = Rf / Ma
  R1 = Rf / M1
  Rs = Rf / S
the output voltage of this simplified circuit can be calculated like this:
              Ra + Rf     Rs           Rf
  Vout = V1 * ------- * ------- - Va * --
                Ra      R1 + Rs        Ra
Since we need a 9V regulator for the RCX anyway, let's assume that those 9V
are stable enough to also serve as the reference voltage we want to subtract
from our measurement voltage. We connect these 9V to the Va input, and the
unregulated battery voltage to the V1 input.

We need to amplify Va by a factor 10/9, because it has only 9V, while we
want to subtract 10V. This factor is realized through resistors Rf and Ra as
follows:
  Rf   10              10 * Ra     _
  -- = --   ==>   Rf = ------- = 1.1 * Ra
  Ra    9                 9
On the other hand, we need the whole multiplier behind V1 to be 1 (because
we just want to offset V1, not amplify or reduce its swing). Since
  Ra + Rf     _
  ------- = 2.1
    Ra
we need
    Rs       1                _
  ------- = --_   or   R1 = 1.1 * Rs
  R1 + Rs   2.1

For reasons slightly too complex to be discussed here, we also want this
condition to be true:   _
         R1           1.1 * Rs
  Ra = ------- * Rs = --_----- * Rs = 0,5263 * Rs
       R1 + Rs        2,1 * Rs

Now we have three equations to determine four resistors. This means we get
to pick the value of Rs freely (somewhere in the tens of kOhms range), and
can then calculate the others from it, using the above formulas.

Unfortunately, resistors aren't available with every possible resistance
value, so you will have to pick the actual values from the available values
to match the above equations as closely as possible. 5% tolerance resistors
will do for your purpose, unless you also use a more accurate reference
voltage. Go figure ...

One more thing: When you buy the OpAmp, make sure you also have its data
sheet. Most larger vendors have their data sheets on the WWW these days.
From that you know which pin is which of the inputs and which is the output.
Also be sure to connect the operating voltage correctly. Usually, Vcc
denotes the positive pole, and GND the negative one. Connect those to the
output of the 9V regulator that also supplies the RCX.

I live in Melbourne, Australia, and have access to a few different component
suppliers so general values and types would be OK.

Could they be more general? ;-)

I am rather new at electronics, so 'pull up resister' and 'resistive
networks' sound great but are new to me - but, I am always willing to listen
and learn from those who know.

It is late night for me now, so use the above calculation with appropriate
caution. If you think you have found a flaw in it, or haven't understood
everything, feel free to ask again ...

Greetings

Horst



Message has 1 Reply:
  Re: Voltage Sensor
 
Hello again, if you have difficulties making sense out of my previous posting, try viewing it with a fixed-width font. Otherwise all fomulas will ook scrambled. In the Web interface, "view raw message" is likely to work for that purpose, but of (...) (22 years ago, 17-Sep-02, to lugnet.robotics)

Message is in Reply To:
  Re: Voltage Sensor
 
(...) It's amazing when you get a different perspective on a problem! While not really applicable for this application the idea is indeed very elegant and saves on a precious input port. I have a spare regulator which I will modify to test this out. (...) (22 years ago, 17-Sep-02, to lugnet.robotics)

11 Messages in This Thread:




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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
9 hours ago
Custom Search

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