# Op amp circuit for logrithm calculation? [duplicate]

How does one design an op amp circuit which calculates the logarithm of the incoming voltage? I.E. if $V_{in}$ is the voltage at the input of the circuit and $V_{out}$ is the voltage at the output of the circuit, then the relationship between the two should be $$V_{out}=\log_{10}\left(\frac{V_{in}}{V_{ref}}\right),$$ where $V_{ref}$ is some reference voltage such as 1 V.

• Application note 31 says? Commented Jan 26, 2014 at 5:09
• I hope you don't remove this question as a duplicate. My question is specifically about an op amp circuit, which is indeed very similar to the question linked, but @SpehroPefhany gave an answer which more specifically addresses my question. Commented Jan 26, 2014 at 15:50
• @IgnacioVazquez-Abrams I don't follow. Commented Jan 26, 2014 at 15:51
• Only because you haven't looked at it. Commented Jan 26, 2014 at 16:02
• @IgnacioVazquez-Abrams I take it you are referring to this document from National Semiconductor? See what I did there? Thats called a link. Regardless of the snarkiness, this is a very useful document, and I appreciate you pointing me towards it. Commented Jan 26, 2014 at 16:12

For a BJT, $V_{BE} \approx$ $V_T \cdot ln($ $I_c \over I_S$), where $V_T =$$k \cdot T\over q$, and $I_S$ is a transistor characteristic (saturation current).
Recall that $log_{10}(x)$ = $ln(x)\over ln(10)$.
The devil is in the details, however, and both $I_S$ and $V_T$ are temperature dependent, so compensation is required, perhaps with a temperature-dependent resistance.