# More accuracy from analog multiplication?

Let's say I want to detect a voltage signal that's guaranteed to be between 0V and 1V through an ADC whose upper range is 5V. I can hook the signal up to the ADC directly, but then I'll only be using 1/5th of the ADC range. Or, I can multiply the signal by 5 through an amplifier to have the signal extend to the entire ADC voltage range. Then, I would divide the signal by 5 (using software) to get the signal back to a number between 0 and 1. Would this latter approach offer better accuracy? Intuitively, I would think that extending the signal to match the entire ADC range would offer better accuracy, but I wonder if I'm just fooling myself.

• What ADC are you using? – awjlogan Apr 18 '18 at 8:49
• A 10-bit ADC on an AVR. – pr871 Apr 18 '18 at 8:50
• Then, I would divide the signal by 5 (using software) ... no, you would not .... with 10bit ADC ... full scale reading would be 1023 decimal ... you could simply adjust gain so that 1V input would read a value of 1000 – jsotola Apr 18 '18 at 8:52
• @awjlogan ATmega168. Do you think it would be better to set the ADC reference to 1 V so that the signal naturally falls between the lower and upper bound of the ADC? – pr871 Apr 18 '18 at 9:08
• It should be noted that analog multiplication is generally used to mean something different from what you're using it to mean; analog multiplication is multiplying two signals together, and multiplying a signal by a constant is just called amplification. – Hearth Apr 18 '18 at 12:51

## 3 Answers

From a bit more information in the comments, you are using an ATMega168. This microcontroller has three options for the ADC reference voltage:

1. $V_\mathrm{CC}$ - usually 5 or 3.3 V.
2. Internal 1.1 V bandgap reference
3. External reference (< $V_\mathrm{CC}$)

With the 10bit ADC, you then split this into $2^{10}$ bins (LSB). To avoid the need to prescale your signal in order to use the maximum dynamic range of the ADC, you can also select a more appropriate reference.

In your case, the internal 1.1 V reference gives LSBs of ~1.1 mV and is very easy to use. Simply set ADMUX[7:6] = b11 and put a capacitor on the AREF pin. If you want to use an external 1.024 V reference, this gives LSBs of 1.0 mV; set ADMUX[7:6] = b00.

Another advantage of using the bandgap or an external reference is that you are not directly using the noisy $V_\mathrm{CC}$ rail as your reference voltage. Typical reference ICs will include lots of filtering, and will give you the lowest noise of the options.

• It's a good answer from OP's specific problem, but couldn't it be improved with a discussion of instrumentation amplifiers? – Sclrx Apr 18 '18 at 9:22
• @Sclrx Potentially, yes, but that seems like another wholly different set of questions and issues to deal with. – awjlogan Apr 18 '18 at 9:26

It is a valid operation and often must be done (e.g. what if you want to measure a signal which is 0-1mv) There are ADC with built-in Op-amps just for this reason.

As always: beware of adding noise by amplification.

Amplifying a signal in the analogue domain to match the full-scale range of your analogue-to-digital converter will give you a measurement with better resolution. A 10-bit ADC can (in principle distinguish 2^10 = 1024 different input values, spaced approximately 5 mV apart, so if your signal ranges from 0 - 1 V you will only be able to distinguish about 200 different levels of your signal. Amplify your signal to cover the full 0 - 5 V range and you will be able to distinguish 1024 different levels approximately 1 mV apart.

The catch is that the analogue signal amplification may introduce errors in your measurement:

• error in the gain may mean that the signal is not amplified exactly by 5 but by (say) 4.93 or 5.02
• an offset may be introduced so that a 0 V input doesn't give exactly 0 V out
• there may be nonlinearity, so that the gain is not exactly the same for all input and output voltages
• there may be additional noise, either intrinsic to the amplifier or picked up from neighbouring circuitry or the general environment, which will alter what you measure
• any of the above factors may themselves drift over time or with temperature.

So the choice of whether to use an external amplifier or not depends on how confident you can be that the improvement in resolution will be worthwhile given the possible additional error. As an obvious example, if you make a simple op-amp amplifier whose gain is set by a pair of resistors with 1% tolerance, you will only know what its gain is to within 1% (unless you calibrate or trim it).

As awjlogan's answer notes, with many ADCs there is an alternative option which is to alter the ADC's input range by selecting a different reference voltage. Of course if you supply this reference voltage yourself, your measurement accuracy will only be as good as the external reference.