# How to extend the range of an ADC

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by ADWSystems, Aug 5, 2017.

Joined:
Mar 14, 2008
Messages:
711
Likes:
5
Location:
USA
What's the second opamp for? Inverting 1:1 gain?

2. ### Nigel GoodwinSuper ModeratorMost Helpful Member

Joined:
Nov 17, 2003
Messages:
39,218
Likes:
640
Location:
Derbyshire, UK
Simple maths - for example if you multiply your result by 5 (to scale it) then the last digit can only be either 0 or 5. So it looks horribly messy, hence you truncate the last digit.

The same applies to all scaling factors, some are worse than others - get your calculator out and give it a try.

By doing the scaling in the attenuators, and using a final FSD reading of 102.3 (or any other variant of 1023), you get a perfect result.

Joined:
Mar 14, 2008
Messages:
711
Likes:
5
Location:
USA
It's either really early, or I'm still not following. Where is 102.3V coming from (other than 1/10th of 1023)? What relevance does it have on the 0-25V input signal?

I have never understood the reasonings put forth on ADC scaling to drop digits within the displayed value. I find it odd this topic only ever seems to come up on the forums. I have never had this discussion in the workplace or with any customers.

WHy do you keep mentioning 1%? Where does the 1% come from?

P.S. There are multibillion dollar companies that don't think 0 and 5 as LSD look horrible.

Last edited: Aug 7, 2017

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### crutschowWell-Known MemberMost Helpful Member

Joined:
Mar 14, 2008
Messages:
10,592
Likes:
477
Location:
L.A., USA Zulu -8

Yes.

6. ### Nigel GoodwinSuper ModeratorMost Helpful Member

Joined:
Nov 17, 2003
Messages:
39,218
Likes:
640
Location:
Derbyshire, UK
It's scaling the input to match the resolution - so make the maximum input to the analogue input equal to 102.3V at the input of the attenuator. This gives you a nice display, with no scaling required (other than inserting the decimal point in the correct place).

When you input 25V the output of the ADC will be 250, you simply stick the decimal point between the 5 and the 0 to give the correct reading. No maths involved, and it gives you 0.1V resolution.

When you use your multimeter does the last digit only display some values? - I thought not

If you don't understand the basic principles it's unlikely you would be discussing it with customers, or indeed if you should be talking to customers at all?.

Because it's difficult to manage 1% accuracy (and calibration), and my suggestion gives better than 1% accuracy (depending on the rest of the circuit). In fact for your 25V requirement it gives 0.4% accuracy.

Pretty crappy companies then - and bear in mind that's only ONE example of poor scaling, and the most useable one - if you're scaling by other values it gets worse.

As I said before, get your calculator out and do some sample readings - as we're talking about a 10 bit conversion, try the 13 values from 500 to 512 and apply your scaling maths to them, and see what results you get - perhaps then you'll understand the issues.

Joined:
Mar 14, 2008
Messages:
711
Likes:
5
Location:
USA
Nigel.

Here are your 500-520 values computed based on a 5V maximum and a 25V maximum.

Count 5V 25V
500 2.441 12.207
501 2.446 12.231
502 2.451 12.256
503 2.456 12.280
504 2.461 12.305
505 2.466 12.329
506 2.471 12.354
507 2.476 12.378
508 2.480 12.402
509 2.485 12.427
510 2.490 12.451
511 2.495 12.476
512 2.500 12.500
513 2.505 12.524
514 2.510 12.549
515 2.515 12.573
516 2.520 12.598
517 2.524 12.622
518 2.529 12.646
519 2.534 12.671
520 2.539 12.695

I see exactly what I expect, very close to what I see on the bench (quick wiring, not neat, somewhat noisy). What are you talking about?

How are you defining accuracy (what vs. what)?

Joined:
Mar 14, 2008
Messages:
711
Likes:
5
Location:
USA
Why 20k and 20k for the unity inverting opamp? Why not 0 and 0? (I assume it has something to do with the 20k used in stage one, but don't see the relation or impact)

9. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,253
Likes:
961
Location:
Loveland, CO USA
0=short or a piece of wire.
20k and 20k = gain of -1 in this case. (inverting) Not 1 but -1.
The first amp inverts the signal and the second one also inverts. -1 X -1 = 1
Use any two resistor of the same value. (ok not any...) but 200k or 100k or 51k.... It is a good idea to use the same parts all over the design.

If you don like the last amp .... Do the inverting in software.
(for 8 bits; 0=5 volts and 255 = 0 volts)

Joined:
Mar 14, 2008
Messages:
711
Likes:
5
Location:
USA
Oh. I haven't a problem with the last opamp. Even understand that it is gain -1. I thought there was an opamp configuration (inverting buffer) that did not have any resistors in the feedback loop.

11. ### ronsimpsonWell-Known MemberMost Helpful Member

Joined:
Apr 17, 2007
Messages:
7,253
Likes:
961
Location:
Loveland, CO USA
You can get a gain of +1 with out resistors.

Joined:
Mar 14, 2008
Messages:
711
Likes:
5
Location:
USA
Oops.

Joined:
Mar 14, 2008
Messages:
711
Likes:
5
Location:
USA
Hey wait a minute. The voltage reference is -4.5V. Where I am I supposed to get that?!

I just spent the entire afternoon putting together one huge simulation of the entire system. Unfortunately, the offset is also needed in the third stage but adding instead of subtracting. I'm not sure the project managers are going to like the design very much. Crutschow's tagline pretty much hit this on the head (inside every little problem there's a big problem trying to get out). I'm dumping this on the manager to find out how far the customer is willing to push out their limits and requirements.

I also know see the "pile of resistors" that has been mentioned. I was only thinking of the resistors for creating the offset. I was not thinking of the resistors that form the differential opamp. Once upon a time, I ran into a differential opamp design and don't recall having to deal with "a pile of resistors". After nearly two hours of searching and review, I found out why. That circuit didn't use a differential opamp, is used an instrumentation opamp. No pile of resistors. Ok. Back to step 1.

Last edited: Sep 29, 2017
14. ### crutschowWell-Known MemberMost Helpful Member

Joined:
Mar 14, 2008
Messages:
10,592
Likes:
477
Location:
L.A., USA Zulu -8
I used -5V.
You can get that from the negative supply and a LT1634-5 shunt reference along with a resistor, as shown here.

What does that stage do?

Last edited: Aug 7, 2017
15. ### PommieWell-Known MemberMost Helpful Member

Joined:
Mar 18, 2005
Messages:
10,016
Likes:
317
Location:
Brisbane Australia
Is there a reason why a through hole 14 bit ADC can't be used?

Mike.