Op Amp based attenuator - Page 1
Forum section: electronics / projects

author: garvind25
author_rank: Regular Contributor
timestamp: May 15, 2025, 06:46:53 pm
content: Hi,I need to make a simple non inverting op amp attenuator to attenuate a 5v DC to 1v DC. I tried using a op amp based attenuator with Rf=1K and Ri=5K. Using LTSpice and LM324 macro-model I tried to simulate the ckt as in attachment 'op_amp_attenuator.jpg'.However, the signal is not getting attenuated. This is the waveform I am getting is a flat dc voltage of about 4.9v (pls see attachment 'attenuator_waveform.jpg')Can anyone pls point out where I am going wrong/ what else I need to do?Thanks in advance,Arvind Gupta.

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: May 15, 2025, 06:53:03 pm
content: You only have a 5 volt supply, so the input won't be able to reach 5 volts. The common mode range does include ground, but I think the high end is Vcc-2 volts. Do you need a very high input impedance? If it's not too high you could use a simple passive divider and buffer the output. I think there may be other opamps that can do this, where the input range includes the supply voltage, but you'd have to do a search. Maybe TLV246x to start.

author: macboy
author_rank: Super Contributor
timestamp: May 15, 2025, 07:28:10 pm
content: For the classic non inverting opamp circuit, gain is 1+(Rf/Ri). Therefore with Rf equal to zero and Ri equal to infinity, you get the classic opamp follower/buffer with gain equal to 1.For non-inverting attenuator, first attenuate, then buffer. Or first buffer then attenuate. It depends on whether you need/prefer very low output impedance or very high input impedance, respectively.

author: TimFox
author_rank: Super Contributor
timestamp: May 15, 2025, 07:36:06 pm
content: As drawn, you have a +5V single supply, but your input generator goes positive and negative.Three problems:The circuit has a positive (non-inverting) gain of 1 + (1000/1250) = 1.80 V/V , not an attenuationThe output voltage is positive definite due to the single supply: the op amp output cannot swing negative.The input voltage probably exceeds the common-mode voltage in the negative direction.

author: Zero999
author_rank: Super Contributor
timestamp: May 15, 2025, 09:04:24 pm
content: Use a potential divider. An op-amp buffer can be added to the output, if a low output impedance is required.https://earmark.net/gesr/opamp/case10.htm

author: garvind25
author_rank: Regular Contributor
timestamp: May 16, 2025, 06:19:42 pm
content: Thanks for your reply. I plan to use simple, old-school amplifiers like LM324 for the project (which needs this op amp attenuator).As of now, I will prefer keeping the output impedance to be low (to source/sink max current to the next stage)I tried using a potential divider plus a buffer. It works. Is there any other way to attenuate so that I can reduce the component count pls (especially the passive components)?BTW, can I not use a non inverting op amp as an attenuator? If I keep 1+Rf/Ri = 1v/5v, I get Rf /Ri = 0.8 (neglecting the sign). So, if Rf=1K, Ri is 1.25K. Is it not this way?Thanks again,Arvind.

author: Zero999
author_rank: Super Contributor
timestamp: May 16, 2025, 06:42:30 pm
content: Quote from: garvind25 on May 16, 2025, 06:19:42 pmWell if you're fine with the higher output impedance, you can skip the op-amp and just use resistors.QuoteNo, because the 1 + in the formula means the minium gain is one.

author: garvind25
author_rank: Regular Contributor
timestamp: May 18, 2025, 04:32:23 pm
content: Quote from: Zero999 on May 15, 2025, 09:04:24 pmThough this works, it draws a lot of power. The resistor R2 puts a lot of current into the gnd making the ckt power hungry.

author: TimFox
author_rank: Super Contributor
timestamp: May 18, 2025, 05:55:38 pm
content: Quote from: garvind25 on May 18, 2025, 04:32:23 pmNot a useful statement. You can choose R2 at will while maintaining the ratio of R2/R1 if power from the input is crucial. The feedback resistors in the first diagram dissipate power according to the same laws.If your signal is AC, without an important DC component, you can reduce the voltage using a transformer with minimal power wastage.

author: Zero999
author_rank: Super Contributor
timestamp: May 18, 2025, 08:22:52 pm
content: Quote from: garvind25 on May 18, 2025, 04:32:23 pmWhat values did you use for R1 and R2?Did you use the calculator website I posted a link to? It gives me R1 = 12k and R2 = 3k for E24 values, which would draw just 333µA maximum.It's fine to multiply them by factors of 10 if lower currents are required, but I wouldn't recommend going too high, otherwise the bias currents will introduce errors.https://earmark.net/gesr/opamp/case10.htm

author: garvind25
author_rank: Regular Contributor
timestamp: May 19, 2025, 05:17:56 pm
content: Thanks for your replies. I need to implement this attenuator at the CMOS integrated circuit level. So, I cannot use kilo ohm level resistors (which will be huge to build). I chose 100 ohms and 400 ohms to attenuate the 5v input to 1v. The power dissipation for R1+R2 comes to 50 mW (which is large). Hence, I was asking for other signal attenuation ideas.I plan to test the ckt idea at the discrete level first. Hence I was asking for the CMOS equivalent of LM324 (initially I did not know that LM324 is BJT made). Hope this clarifies a few things.

author: themadhippy
author_rank: Super Contributor
timestamp: May 19, 2025, 05:35:03 pm
content: Quotecmos can happily spit out enough current to use much larger values,and there inputs only need to get a sniff of current to workQuoteA 100k watt resistor is the same physical size as a 100 ohm resistor of the same power rating (and manufacter)

author: TimFox
author_rank: Super Contributor
timestamp: May 19, 2025, 05:37:33 pm
content: Quote from: garvind25 on May 19, 2025, 05:17:56 pmWith such (absurdly) low resistor values, why do you need a buffer after the network?

author: Zero999
author_rank: Super Contributor
timestamp: May 19, 2025, 06:11:54 pm
content: Quote from: garvind25 on May 19, 2025, 05:17:56 pmYou're not making any sense.Firstly, any value of resistor can be made on chip. How else do you think they make values such as 20k and 6k inside an op-amp such as the TL082? Note the values are not that accurate, but it's the ratio which matters.https://www.ti.com/lit/ds/symlink/tl082-n.pdfIf you're using a CMOS amplifier, then you can use even higher resistor values, such as 12M and 3M.And why are you asking about a CMOS equivalent for the LM324, if you're designing the chip? Just design your own.

author: garvind25
author_rank: Regular Contributor
timestamp: May 21, 2025, 03:52:28 pm
content: Quote from: Conrad Hoffman on May 15, 2025, 06:53:03 pmTrue. I am using a macromodel of LM324 which seems to be inaccurate and hence the output is reaching almost Vcc (5v). Can anyone pls point me to an accurate macro model of LM324 pls?Thanks in advance.Arvind Gupta.

author: Zero999
author_rank: Super Contributor
timestamp: May 22, 2025, 07:38:33 am
content: Quote from: garvind25 on May 21, 2025, 03:52:28 pmTry the Texas Instruments model.https://www.ti.com/product/LM358#design-tools-simulation

author: garvind25
author_rank: Regular Contributor
timestamp: May 24, 2025, 04:07:55 am
content: Quote from: Zero999 on May 22, 2025, 07:38:33 amThanks. However could not find any spice model / macromodel /LTSPICE compatible model in the location.

author: TimFox
author_rank: Super Contributor
timestamp: May 24, 2025, 02:31:40 pm
content: Quote from: garvind25 on May 24, 2025, 04:07:55 amOn that site, go the tab “design and development” for Spice models.

author: mtwieg
author_rank: Frequent Contributor
timestamp: May 25, 2025, 04:38:37 pm
content: Quote from: garvind25 on May 21, 2025, 03:52:28 pmThe output reaching to Vcc is not abnormal for the LM324. Conrad Hoffman was pointing out that the common modeinputrange of the LM324 does not extend to Vcc. This applies to the inverting and noninverting inputs, not the output. When the inputs are outside the specified range, the behavior of the output is difficult to predict.So your model might be fine.