NOTE:
This circuit is designed for extremely low level voltages in the nano
and microvolt range. If your sensor outputs a voltage in the high
millivolt range or volt range you will need to change the gain of the
first stage op amp (LTC1052 with a gain set at 1000 as shown in this schematic) and adjust the code gain to low numbers such as
"GAIN = 1;" to start. Since the second op amp has a biased output of
2.5 volts with a zero volt input on pin 2, The code variable OFFSET will
need to be adjusted to calibrate your
ADC reading
to agree with your sensor reading. In this schematic, the ADC sees 2.5
volts as the zero point (half way between zero and + 5 volts) and will
add your signal to 2.5 volts. So if your signal is + 0.3 volts, the ADC
output will be 2.5 + 0.3 or 2.8 volts. |
By
setting the offset in the code to make the 2.5 volt ADC output read
zero, you would then read your 0.3 volt input as 0.3 output from the
ADC. The same is true of negative voltages up to -2.5 volts. Any
signal or sensor voltage greater than
± 2.5 volts
will simply read 5 volts or zero volts out of the ADC. The second op
amp is single ended and will go to its rails with input voltages
greater than ± 2.5 volts. The good news it that you will probably not damage the ADC with a
reasonable over voltage. Working Arduino code is below the schematic. |
This schematic is shown as the design that is wired
for the
Schäfer
code (below)
where the ADC SDI (Pin 7) is controlled by the Arduino board. If you prefer
to use the
Beale code,
(goes to code on the main page)
either hard wire Pin 7 to ground where the sample rate is 880 sample per
second or wire Pin 7 high (to +5 VDC) for a sample rate of 6.7 samples per
second. The pin 1 and pin 8 caps are critical and
leaving pin 1 and pin 7 open can destroy the chip. Examples of op amp gain calculations There are two devices to shift the measurement of voltage in the circuit above. The first device is the op amp gain, the second device is the ADC zero shift. As a place to start an op amp gain, it is best to assume a zero shift to be used by the ADC. If we start with a 3 place zero shift in the ADC, we can calculate the additional gain needed in the op amp. setup assumptions... If you plan to use this circuit with various inputs you need to set the gain of the op amp to supply the ADC with zero to +/- 0.250 volts input volts - MAX. Lets assume you want to measure a one microvolt signal. That would be a source voltage of 0.000001 volts. Or SOURCE VOLTS = 1. Lets also assume you want a reading in microvolts so you want an output from the ADC to be "1.000". Or ADC OUTPUT READING. We will also assume you want a zero shift in the ADC to be 3 places. Or ADC GAIN = 1000. With these limits in mind we can calculate the gain of the op amp. Or OP AMP GAIN. Since we will get a decimal shift of 3 places from the ADC, our output from the op amp is 0.000001 x (3 decimal place shift) or x 1000. This gives us the final value to the ADC to be .000001 x 1000 or .0001 volts. If the original voltage into the op amp is .000001 and the output (or ADC input) is .0001 the gain of the op amp needs to be .0001/.000001 or 100. Another way to think of this is to call the ADC shift a "gain" and then multiply your OP AMP GAIN times your ADC GAIN. In this case OP AMP GAIN times the ADC GAIN is 1000 and the final reading from the ADC is 1.000. As a word equation this would be (SOURCE VOLTS) * (ADC GAIN) * (OP AMP GAIN) = ADC OUTPUT READING. In this case OP AMP GAIN is: 1/(ADC GAIN) * (SOURCE VOLTS) * ( or 1/(1000 * .000001) = 1/.001 = 100. Or OP AMP GAIN = 100 General "word" equations for this circuit A general statement would be: ADC OUTPUT READING = (SOURCE VOLTS) * (ADC GAIN) * (OP AMP GAIN) from this statement we can say: OP AMP GAIN = (ADC OUTPUT READING) / [(ADC GAIN) * (SOURCE VOLTS)] and the critical ADC input is:ADC input = (SOURCE VOLTS) * (OP AMP GAIN) Which needs to be no more negative than - 0.250 volts By the way - It is possible to measure microvolts directly with a 24 bit ADC and use a 6 place shift of the source voltage. This would change the ADC reading from 0.000001 with a 6 decimal shift to 1 as an output of the ADC. This is one of the great benefits of 24 bits. The problem here is that a 6 place shift is approaching the accuracy limit of the ADC. The 1 value is all you would get. Where amplifying the source voltage by 100 with an op amp would give at least a 3 place accuracy or 1.00. Amplifying by 1000 would give an accuracy to 4 places or 1.000. And the op amp output in volts is still safe for the ADC input at 0.001 volts. When I say ADC zero shift I am talking about a kind of gain in the ADC program. There is NO amplification in an ADC but the code below acts like a gain setting. So setting the GAIN variable in the code below to 1,000,000 will shift the source voltage by six places. CODE TO USE WITH THIS SCHEMATIC - Schäfer code Copy the code between the page lines (below this line to the next line) and enter the code into a new Arduino program blank page. It is critical that the libraries are added to the program just as they appear in this sample code. This code does not supply the libraries, the "Linduino" libraries must be downloaded as the text below describes. |
DK7FC
// end code here
END CODE above this line