Log Amplifier Guide: Turn Four Decades of Input into 400 mV — a 1N4148 Log Amp Worked Out

Author: Abloom Spark Date: December 05, 2026

A linear amplifier treats 1 mV and 10 V the same way — it multiplies both by the same gain, so a circuit that can read the small signal clips on the large one. A log amplifier does the opposite: its output changes by the same fixed step every time the input grows ten times. Four decades of input — 1 mV to 10 V — fit into a span of about 400 mV. That is why log amplifiers sit behind light meters, audio level meters and wide-range photodiode instruments: they compress a huge range into a small, readable voltage. This guide builds one from a single 1N4148 diode and an op-amp, works out every number, and shows why the circuit drifts with temperature — and how a transistor fixes it.

Left: log amplifier schematic — input Vin through a 10 kilo-ohm resistor into the inverting input of an op-amp, a 1N4148 diode in the feedback path from the output back to the inverting input, non-inverting input grounded, output Vout equals minus n times VT times the natural log of Iin over Is. Right: chart of Vout versus Vin on a log scale from 1 millivolt to 10 volts — the 1N4148 diode line is straight at minus 104 millivolts per decade, from minus 167 millivolts at 1 millivolt in to minus 584 millivolts at 10 volts in, the 35 degree line sits 19 millivolts higher, and a BJT version is a shallower straight line at minus 59.5 millivolts per decade

Figure 1: (a) The diode log amplifier — the diode sits in the feedback path, so the op-amp forces the diode voltage to be whatever the input current demands. (b) Output against input on a log scale: a straight line, one step of 104 mV per decade for the 1N4148, 59.5 mV per decade for a transistor. The 35 °C line shows the temperature problem — the whole line shifts up by 19 mV. (Is and n are the LTspice 1N4148 model values.)

The diode law, turned into an amplifier

A forward-biased diode follows the Shockley equation, I = Is × (eVD / (n·VT) − 1). Turn it around and the diode voltage is VD = n·VT·ln(I / Is). In the log amplifier the op-amp holds its inverting input at virtual ground, so all of the input current flows through the diode: Iin = Vin / R1, and the output is simply the negative of the diode voltage, Vout = −n·VT·ln(Iin / Is). The thermal voltage VT = kT/q is 25.85 mV at room temperature, and for the 1N4148 the LTspice model gives Is = 2.52 nA and an ideality factor n = 1.752, so n·VT = 45.29 mV. One decade of current multiplies Iin by 10, and ln(10) = 2.303, so each decade moves the output by 2.303 × 45.29 mV = 104.3 mV. That is the whole circuit in one number — and notice it is not the textbook 59.5 mV per decade, because a real 1N4148 has n ≈ 1.75, not n = 1.

Worked example — four decades through one 10 kΩ resistor

Take R1 = 10 kΩ and sweep Vin from 1 mV to 10 V. At Vin = 1 mV the input current is Iin = 1 mV / 10 kΩ = 0.1 µA, and Vout = −45.29 mV × ln(0.1 µA / 2.52 nA) = −45.29 × ln(39.7) = −167 mV. At 10 mV in, Iin = 1 µA and Vout = −45.29 × ln(397) = −271 mV. At 100 mV in, Iin = 10 µA and Vout = −375 mV. At 1 V in, Iin = 100 µA and Vout = −45.29 × ln(39,683) = −480 mV. At 10 V in, Iin = 1 mA and Vout = −584 mV. Every step is 104 mV, and the total span is 584 − 167 = 417 mV for four decades — a 10,000:1 input range compressed into less than half a volt. The diode voltage at the top end is 584 mV, so the diode burns only 584 mV × 1 mA = 0.58 mW, and the series resistance of the diode (0.568 Ω in the model) adds just 0.57 mV of error at 1 mA — both negligible. The real limit at the bottom end is the op-amp: its input bias current must stay far below the smallest Iin of 0.1 µA, so use a FET-input op-amp with picoamp bias, not a bipolar 741 with its ~80 nA.

The temperature problem — and the transistor fix

The log amp's weakness is Is: the saturation current of silicon roughly doubles every 10 °C. At 35 °C, VT has risen to 26.55 mV and Is has doubled to 5.04 nA, so at 1 V in the output becomes −46.51 mV × ln(100 µA / 5.04 nA) = −460 mV instead of −480 mV — a shift of +19 mV, or about +1.9 mV per °C. Since one decade is 104 mV, a 10 °C rise reads as almost 0.2 decades of error. The classic fix is to use a transistor instead of a diode: a small-signal BJT's base-emitter junction has n ≈ 1 and Is ≈ 10 fA, giving the clean textbook slope of 2.303 × 25.85 mV = 59.5 mV per decade. With the same 10 kΩ input resistor, 1 µA in gives Vout = −25.85 mV × ln(1 µA / 10 fA) = −476 mV, 100 µA gives −595 mV, and 10 mA gives −714 mV. Better still, a matched pair of transistors in a log-ratio circuit cancels the temperature drift almost completely, because both junctions drift together — that is how the LOG112 and AD8304 log amplifier ICs are built. For a bench instrument, one more step helps: follow the log stage with a non-inverting amplifier of gain 17 (16 kΩ feedback, 1 kΩ to ground), which turns the 59.5 mV per decade into 17 × 59.5 mV = 1.01 V per decade — a direct, readable scale where 1 V on the meter means one decade of input.

Key points to remember

  • Worked example: 1N4148 log amp, R1 = 10 kΩ, Is = 2.52 nA, n = 1.752. Vout = −n·VT·ln(Iin / Is); n·VT = 45.29 mV, so the slope is 104.3 mV per decade. Vin 1 mV → −167 mV; 10 mV → −271 mV; 100 mV → −375 mV; 1 V → −480 mV; 10 V → −584 mV — four decades in a 417 mV span.
  • Temperature: Is roughly doubles every 10 °C. At 35 °C the 1 V output shifts from −480 mV to −460 mV, about +1.9 mV per °C, or 0.2 decades of error per 10 °C. A matched transistor pair cancels this drift.
  • Transistor version: a BJT (Is ≈ 10 fA, n ≈ 1) gives the textbook 59.5 mV per decade — 1 µA → −476 mV, 100 µA → −595 mV, 10 mA → −714 mV. A gain of 17 after it gives 1.01 V per decade, a direct reading scale.
  • Limits: the op-amp's input bias current must be far below the smallest input current (0.1 µA here — use a FET-input op-amp). Diode self-heating (0.58 mW at 1 mA) and series resistance (0.57 mV at 1 mA) are negligible. A negative input needs the diode flipped or a second, mirrored channel.