[Tfug] OT: PIC ADCs and differential inputs

Choprboy choprboy at dakotacom.net
Tue Oct 20 16:41:43 MST 2009


On Tuesday 20 October 2009 14:28, Bexley Hall wrote:
[snip]
> "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")

It is a "hobby" project for work, mostly for my own learning. Time constraints 
are "when I get around to it", cost is whatever I feel like spending on my 
own learning. For all practical purposes, this is a one-off. If it works 
well... it may become a "dozen or two"-off, paid for by work, at which point 
I may design a dedicated board. Of course.. at that point I may just add a 
real differential ADC chip read off I2C/etc. by the PIC. Until then its just 
rough breadboarding with what I have on hand.


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

In fixed-width font it comes out fine ;)


> > 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.

Hmmm.. It is all DC I am trying to measure (at the moment), and I was probably 
going to put a resistor/cap front end filter on it to remove high frequency 
switching noise from the PS/load. I hadn;t thought of a VCO, but it would 
probably work pretty well. I had thought about building a pseudo-differential 
switching front end, but discarded it as I didn;t really want to try and mess 
with the timing issues at this point.

[snip]
> Your bigger problem is the different ground references.

Yep... At some point you can pretty much guarantee the -48V side will be 
grounded to the rack by some piece of equipment. My measuring box will sit in 
the rack, so its case may become that ground potential.


> 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.

I don't... Basically, that is the solution I came up with. Move the shunts to 
the ground legs of the supplies and remove the diodes on the ground to create 
a common supply reference. But then I would have to float that reference up a 
volt or two relative to the measurement board ground so I can measure current 
thru the shunt, in both directions, otherwise during battery charging the 
shunt voltage becomes negative. Making sure the measurement board ground is 
isolated from the chassis becomes important then...

> 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.

Yep... The big advantage in starting out was that I am using a 
Olimex "PIC-WEB" board. Built in ethernet, web, telnet, SMTP, SNMP, etc. from 
the TCP/IP stack provided by MicroChip. I haven;t tried recompiling yet, but 
the source looks *mostly* straight forward and simple to strip down to the 
bare minimum I need/want. The disadvantage is that the ADC references are 
already hard-wired for the onboard temp/etc. sensors.

My second plan of attack was to get a stand-alone differential ADC or two on a 
serial bus and do the measurement there. If it ever scales up to 
the "dozen-off" model that might infact be a better plan as I could then 
integrate additional remote sensors dozens/hundreds of feet away.


Adrian





More information about the tfug mailing list