[Tfug] OT: PIC ADCs and differential inputs

Bexley Hall bexley401 at yahoo.com
Tue Oct 20 14:28:38 MST 2009


Hi Adrian,

--- On Tue, 10/20/09, Choprboy <choprboy at dakotacom.net> wrote:

> So, I have run into my first problem. The PIC has multiple
> single-ended ADC inputs, but a common +Vref and ground on 
> the devel board. For the hobby project I'm working on, I

"Hobby".  Therefore you are really only looking at "one off"
and don't need a "mass produced" solution (different sets
of economies at work).

How are your space, time and cost constraints?
(time as in development time and "measurement time")

> want to measure multiple voltage ranges, with 
> different ground references. I.e. I want to measure 2+ 48V
> power sources (for 
> instance, a battery stack and 1 or more supplies) which may
> be fully 
> protected behind diode bridges, the 48V output to the load,
> and current shunts from/to the batteries, etc.
> 
> Circuit:

Argh!  I won't even *try* to reproduce this here...

> Measuring a single 48V power suppply is pretty straight
> forward, simple 
> resistor divider network referenced to ground. But
> measuring multiple 48V 
> where the ground reference of each is behind a diode
> creates a potential 
> short circuit loop. Trying to then measure a 100mV current
> shunt with a 48V 
> offset at the same time is pretty useless as there is no
> dynamic range in the 
> ADC (works out to about 60mV per LSB at 10bit).

The easy/cheap way that I have always done this is to use
a VFC (e.g., VCO) and just trade time for precision.
E.g., since your signals are largely DC, you could take a
big fraction of a second to measure one and end up with
millivolt resolution on signals of hundreds of volts!
Again, assuming everything is DC, you could take a peek at
one end of a shunt, then take a peek at the other end
and "do the math".  That way, you don't have to have more
than one VFC and calibrate them wrt each other.

As things creep up from DC, things get more interesting  :>

Your bigger problem is the different ground references.
*If* your output is isolataed from any other sort of ground
(e.g., optically -- as in "a display that the user reads" :> )
then you can pick any reference that is convenient.

If you had control over the design (I assume you don't)
that you are instrumenting, you could move the shunts to the
ground legs and do ground referenced measurements.
Likewise, you could "float" your whole system at the
load side of the shunt (assuming the load is not
reactive) and measure a very small signal on the
supply side of the shunt without losing much resolution, etc.
(the issue here to worry about is what happens if the
load is shorted... for a few ohnoseconds there will
be 48V across the shunt -- and directly into your 
measurement circuitry!)
 
> Does anybody have any handy-dandy circuits for this type of
> thing? What I 
> really need is some differential ADC inputs, but as I said,
> the PIC only has 
> single-ended. I can think of a couple ways to do it, some
> really ugly. It 

For a hobbyist project, get a couple of dirt cheap PICs
and put one on each measurement point.  Then let them
talk to "something" that handles the data however you want
to handle it.  (it's really hard to get much cheaper than some
of the low end PICs -- issue there will be putting it
onto some sort of board to make building it easier
and more robust).

(N.B. you can often find deals on "free" PCB fabrications
that, if you are resourceful, cyou can exploit to have
a bunch of tiny "universal" boards made.  I know there
are often "$500 off" coupons for this sort of thing.
For *real* jobs, the $500 is just a "come-on".  But, I
have known folks who have carefully designed projects
so they could get the project *built* for that "first
$500"  :>  (e.g., a real project would want at least two
layers on the board, silk screen, plated through holes, etc.
You can often live without *all* of those and still get
a nice finished product!)

> comes down to requiring no protection diodes on the
> measured source 
> (everything on a common reference bus) and isolating the
> ground of the devel 
> board from the chassis for a "simple" solution...

HTH.  Feel free to followup (on or off list) if I can be
of any help.

--don


      




More information about the tfug mailing list