# Need help very urgently with DC Level shift Op-amp Circuit

#### Hasin

Joined Feb 4, 2015
7
Hi, there.
I need a help on how to figure out and build a DC level-shift circuit. Basically I have voltage supply range between (11-18V) and I want to shift it down to (0-7V) and amp/attenuate that to (0-3.3V) ADC.
I'm totally new to this and have no idea how to design the circuit and which Op-amps, Resistors, Capacitors..etc I should use.
So, simply I looking for a circuit design that can shift the voltage level ranges (11-18V) down to (0-3.3V) ADC.

Thanks

#### MikeML

Joined Oct 2, 2009
5,444
Why a two step reduction?

What supply voltages do you have available?

How stable are the supplies? (Shifting implies subtracting a fixed voltage, but the fixed voltage has to be as accurate and stable as the ultimate measurement you are making with the ADC).

#### Hasin

Joined Feb 4, 2015
7
It doesn't have to be in two steps reduction. It can be basically linearly shifted from (11-18v) DC supply to (0-3.3V) ADC.
The supply voltages are 11-18V rages.
I'm not sure if i understand the stable part well. however, I'm basically using a 12V Wall wart to power my block. but the wall wart rage is in between (11-18V) and that's what I want to shift it down to (0-3.3V) to ADC.

Thank u

#### WBahn

Joined Mar 31, 2012
30,034
Is the intent to be able to measure what the supply voltage is with the ADC?

#### Hasin

Joined Feb 4, 2015
7
Is the intent to be able to measure what the supply voltage is with the ADC?

It is a voltage sense circuit what i need to build. the changes in ranges between (11-18V) will be reflected on the (0-3.3V)ADC. For example, 11V corresponds to 0V, 14.5V corresponds to 1.65V, and 18 corresponds to 3.3V.

So, in other words I need a circuit that can take (11-18V) as inputs and spits out (0-3.3V) as outputs. This can be done using DC level shift methods.

#### WBahn

Joined Mar 31, 2012
30,034
Do you have bipolar supplies available to your shifting circuit?

#### Hasin

Joined Feb 4, 2015
7
Do you have bipolar supplies available to your shifting circuit?
No

#### WBahn

Joined Mar 31, 2012
30,034
What kind of accuracy/precision/resolution do you need (notice the use of the word "need" and not "want")?

#### Hasin

Joined Feb 4, 2015
7
What kind of accuracy/precision/resolution do you need (notice the use of the word "need" and not "want")?
It needs to be high accuracy possible within mV.

#### WBahn

Joined Mar 31, 2012
30,034
Why on earth are you using a wall wart that walks over a 7V range to power something that you need a voltage accuracy of a millivolt? That's like using a chainsaw to cut something that you need to the nearest mil.

#### wayneh

Joined Sep 9, 2010
17,498
Because it's very urgent.

#### ronv

Joined Nov 12, 2008
3,770
The problem is the "few millivolts". If you think about it just a couple of resistors could easily give you a 50 mv error.
What will you use the A to D reading to do? You may have better accuracy with a smaller DAC range and fewer parts.

#### GopherT

Joined Nov 23, 2012
8,009
Assume true rail to rail output, you could do this

#### MikeML

Joined Oct 2, 2009
5,444
This is what it takes in theory:

In practise, the opamp must be capable of driving its output within mV of its Vss pin. Only a few opamps can do this.

The 5.200V reference voltage must be very precise. A 1mV change causes a -1mV error at the AD input. You could make the reference voltage using a TL431 adjustable Zener.

Here is a way of doing it with a 5.00V reference.

Last edited:

#### MikeML

Joined Oct 2, 2009
5,444

#### Hasin

Joined Feb 4, 2015
7
This is what it takes in theory:

In practise, the opamp must be capable of driving its output within mV of its Vss pin. Only a few opamps can do this.

The 5.200V reference voltage must be very precise. A 1mV change causes a -1mV error at the AD input. You could make the reference voltage using a TL431 adjustable Zener.

View attachment 79953

Here is a way of doing it with a 5.00V reference.

View attachment 79954

Thank you so much...This is works just perfect. I wonder how you got the values of the resistors and which equations and calculations did you use?
thanks

#### MikeML

Joined Oct 2, 2009
5,444
You could find the required gain and offset. Then to create that using the opamp stage, you can solve some simultaneous equations in several unknowns to find the resistors.

I did it by trial and error using LTSpice as a calculator. I just played with the resistors and the offset voltage to get the function to fit at the end points. I've done this before, so I can get it to converge pretty fast... LTSpice has an easy way of selecting standard 1% resistor values.

A lot of uProcessors that have an onboard AD converter have a pin where the AD's internal reference voltage can be exported off the chip. You might be able to redo my circuit using only the AD reference voltage (3.3V?), which would mean that the level shifter is ratiometric with respect to only the AD reference voltage, reducing thermal drift and improving accuracy.

Last edited:

#### Hasin

Joined Feb 4, 2015
7
This is what it takes in theory:

In practise, the opamp must be capable of driving its output within mV of its Vss pin. Only a few opamps can do this.

The 5.200V reference voltage must be very precise. A 1mV change causes a -1mV error at the AD input. You could make the reference voltage using a TL431 adjustable Zener.

View attachment 79953

Here is a way of doing it with a 5.00V reference.

View attachment 79954

I have a question:
How I'm supposed to connect the diode in the circuit. From data sheet the diode has three pins (Cathode, Anode, and Ref) how are theses pins connect on the circuit. Also, for the 5.2 Voltage Reference, should I provide that as a voltage supply input into the zener diode, or does the diode itself creates the voltage reference?

thank you

#### MikeML

Joined Oct 2, 2009
5,444
Paragraph 10.2.2 of the TL431 data sheet shows how to use two resistors, R1 from cathode to ref, and R2 from ref to gnd, to program any fixed voltage greater than 2.495V. A third resistor Rsup from cathode to the unregulated input limits the current through the TL431 to be greater than Imin when the input is at 11V.

Last edited: