I know that mathematically the k-V analog input on an A to D converter could be converted to the digital code of \$\dfrac{k(2^n-1)}{VDD}\$. But I really don't understand where it comes from and the logic behind it. Any help would be appreciated.
Ratiometric ADC
adc
Related Solutions
Consider this a theoretically biased answer - I've not dealt with multiple ADCs and a separate ground plane. This will (hopefully) not be your star answer but may raise some issues worth noting. Also - if any of this sounds like hogwash or ill advised (variations on the same theme :-) ) please say so (preferably gently) - leaving uncommented advice which you consider misleading reduces the worth of the material as a resource for others. .
What you have done sounds close to ideal. A second ground plane is a luxury not always available in "lesser" systems.
One may be tempted to partition the ground plane into N segments radially expanding from the single common ground point, but that has good and bad points.
Considering where and how you return the grounds of the signal sources can be an interesting exercise.
If possible you return the sources' grounds to the analog ground plane, but that then raises issues re sources which are powered but which do not themselves have separate power and analog grounds. How do you return the source power ground to the power ground plane and the source analog ground to the analog ground plane?
In the case of eg instrumentation amplifiers this may be easy as the analog ground is conceptually separate from the power ground.
In the case of single ended sources you may need to look closely at what happens to ground currents between power and analog. If the local power ground has a potential dc offset relative to analog ground you may wish to isolate this component from analog ground. To do this you may even go as far as providing an AC filtered DC feed to power ground for the sources analog portion and an AC ground path to the analog ground plane. This effectively creates a local analog ground for the source's circuitry - eg perhaps an inductor from power ground plane to local analog ground with a capacitor from local analog ground to analog ground plane.This sort of magic is liable to be needed only in extreme cases - it is to be hoped that in cases where DC components are large enough to matter that the device designers have accommodated it (as they have done with your dual gnd ADC's.
An example where this may not be the case is eg a microcontroller with internal DAC being used as a signal source for an ADC. For this arrangement to make sense (DAC-ADC) there will probably be some other analog function or convolved signal as well as the DAC output. In this case, how do you treat the microcontroller ground and what differences do the choices make.
Both ground planes will probably be interrupted by vias interconnecting other planes. In extremely demanding cases, which yours sounds like, care needs to be taken re unbalancing of go and return signal paths for critical analog signals. An analog signal track which crosses a break in it's analog ground plane creates a slot antenna which may be both a radiator and a receiver. In many cases the effect may be small enough to be neglected but you need to know that this is so by design and not by good (or bad) luck. Ground plane breaks also provide increased loop area which can be important in critical cases. (Loop area between go and return can occur in fully balanced cases when tracks are used for both paths - usually eliminated by proper groundplane use.)
It would be good if you characterised the signal from the pH probe. I've never used one so am not familiar with the type of signals they put out. I think they are a few mV and quite high impedance, but am not sure. I could look it up, but this is your project and therefore your job.
Let's assume you have a very high impedance signal to amplify, and the voltage range is +-100mV.
First, the 741 opamps you show are totally inappropriate. They have way too low input impedance. Please return them to whatever museum you found them in. There are plenty of good high impedance amps out there to chose from, but watch the input offset voltage.
As for the differential part, you have one side of the probe connected to ground, so you only have a single ended signal to start with. Ultimately you need a single ended signal if you're going to feed it into a microcontroller A/D. Some stand alone A/Ds can take differential signals in, but once you add your own amplification you will generally have a single ended signal anyway.
Your circuit only has a overall gain of 3 as shown. That would only result in 300mV peak if the input is really limited to 100mV. I expect the micro's A/D to want more than that for full resolution.
One characteristic of pH signals is that they are slow. This means you can apply significant low pass filtering, and can use a high resolution but slow A/D like a delta sigma type. These have enough resolution over the 100mV range that you don't need any amplification.
However, since pH probes aren't cheap and this is unlikely a high volume product, I'd make it easy on yourself. Get a decent instrumentation amplifier. These can be had with high input impedance, fixed and accurate gain, low input offset, and can generally level shift the result. A gain of 20 would give you a 4V output range, which should be about right for a 5V A/D. Level shift the output so that the 0 signal is at half the A/D range, and the rest is firmware.
Best Answer
My problem was that I didn't realize that the value of the 1024 level is 1023 because it is all ones.