# How to Design OPAMP circuit for this requirement

#### Santhakumar

Joined Mar 17, 2015
33
Hi all,
i've been looking for a circuit may be based on OP AMP solution.
My requirement is that i am feeding varying input voltage (0 to 24V) to an circuit (could be op amp) it's output would be 0 to 3.3V.
So thing is my output should be correlated with input that means
1. Say input is 0% (0V) my output shout be 0% (0V).
2. Say input is 50% (12V) output should be 50% (1.65V)
3. Say input is 100% (24V) output should be 100% (3.3V)

Do anyone have idea on how to have circuit for this.
Thanks,
-Santhakumar.

#### crutschow

Joined Mar 14, 2008
25,263
All you need is a two resistor voltage divider if the 3.3V load is a high impedance.
For such a load you could use a 1.62kΩ resistor to ground connected to a 10.2kΩ resistor going to the 0-24V source. The junction of the two resistors gives you 0-3.3V (nominally 0-3.29V).

#### Dodgydave

Joined Jun 22, 2012
9,313
Two resistors in a voltage divider across the 24v supply, 16K, 100K, will give you 1.65v @12v, 3.31v at 24v.

#### crutschow

Joined Mar 14, 2008
25,263
Two resistors in a voltage divider across the 24v supply, 16K, 100K, will give you 1.65v @12v, 3.31v at 24v.
My resistor ratios give an output slightly closer to the desired.

#### AnalogKid

Joined Aug 1, 2013
8,536
My resistor ratios give an output slightly closer to the desired.
My resistor is better than your resistor-? Really?!?!? Are you running for president?

ak

#### Kermit2

Joined Feb 5, 2010
4,162
Those old resistors are losers.
We'll build a better resistor. You'll love it. It will be great!

#### #12

Joined Nov 30, 2010
18,210
1% resistors almost always arrive at a more accurate solution, but I have a 100K and a 16K in my parts bin. It's a matter of convenience vs accuracy. Pick one.

#### atferrari

Joined Jan 6, 2004
4,069

#### ronv

Joined Nov 12, 2008
3,770
You can tell from the size of the capacitors.

#### crutschow

Joined Mar 14, 2008
25,263
My resistor is better than your resistor-? Really?!?!? Are you running for president?
Hell no. How did politics get into this?

But for those interested nit pickers (and I assume you're not one), for an arbitrary resistor attenuation using 1% resistors there are generally many combinations of resistor values that give close to the desired value but some are closer than others. To determine the optimum combination I wrote a short visual basic program a number of years ago that looks at the combinations and lists them according to how close they are to the desired.
Here is a screen shot of the values to get the desired attenuation of 3.3/24 = .1375
The optimum is 1.62k and 10.2k.
Of course that delta doesn't include the effect of the 1% resistor tolerance.

#### ifixit

Joined Nov 20, 2008
650
How about: 24V to 18K+2.7K with 3.3K to gnd. The output (0 to 3.3000V) across the 3,3K can be buffered with a X1 op-amp if needed.

#### Santhakumar

Joined Mar 17, 2015
33
Hi All,

Thanks for the Answers and i can use it in my circuit.
Is there any other ways we can make it without resistor divider. May be by using OPAMP comparator.

#### #12

Joined Nov 30, 2010
18,210
Is there any other ways we can make it without resistor divider. May be by using OPAMP comparator.
No. A comparator is not a voltage divider.
Why do you want to avoid the cheapest, simplest, most accurate way to do this?
I think I can do this with an op-amp, but why add the extra parts?

Last edited:

#### Santhakumar

Joined Mar 17, 2015
33
Hi #12,

Any way i'm gonna use opamp in my circuit so that i just want to hear more suggestion on this to have other options.

-SK

#### Dodgydave

Joined Jun 22, 2012
9,313
Last edited:

#### #12

Joined Nov 30, 2010
18,210
Ok go ahead and use an op amp, like this circuit
My circuit has more useless parts than your circuit.
and it requires a dual voltage power supply.

#### Attachments

• 7 KB Views: 14

#### Dodgydave

Joined Jun 22, 2012
9,313
@#12,, me thinks he wants to make it more useless, may need a Bigger op amp like a TDA2040

#### #12

Joined Nov 30, 2010
18,210
@#12,, me thinks he wants to make it more useless, may need a Bigger op amp like a TDA2040
I think he's learning about op-amps and just has to see one in action.

#### Santhakumar

Joined Mar 17, 2015
33
Hi #12,

I would use resistor divider rather using dual opamp and dual supply.

And this output of divider would goes to ADC.. I would like read consistent values from the divider and so ADC.
care can be taken at software level. but hardware level how effective i can accomplish it..

thanks.

#### #12

Joined Nov 30, 2010
18,210
The consistent values start with your power supply. I don't know whether the ADC tracks the power supply voltage or not. I don't know whether to instruct you on generating a stable voltage reference or expect the ADC to adapt if it is connected to the same 5V line as the resistors. You just stepped outside my limitations.