# Temperature vs diode voltage in Shockley's equation

I was recently tasked with designing a temperature sensor using a general purpose diode.

The design uses a constant current source (1mA) for diode excitation.

So far, so good. The circuit works as expected, with an increase in temperature the voltage across the diode decreases.

The next step is to convert the diode voltage into a temperature reading so I applied Shockley's equation:

Id = Is(exp(q * Vd / n * k * Tk) - 1)

Where:

• Id = Diode current
• Is = Reverse saturation current
• q = Magnitude of electric charge
• Vd = Voltage across the diode
• n = ideal factor
• K = Boltzmann's constant
• Tk = Temperature

I manipulated the equation to get:

Tk = (q * Vd) / (n * k * ln ((Id / Is) + 1))

This shows that temperature is directly proportional to the voltage across the diode.

??????

At this point, I'm not sure why my practical test and the theory do not match.

Any help solving this puzzle would be greatly appreciated.

• The temperature coefficient of perfect silicon is -2.1mV / Kelvin. General purpose diodes are not particularly good as temperature sensors as the ideality factor is often in excess of 2 (see the SPICE model). We more commonly use a diode connected transistor (collector tied to base). The 2N3904 is a very popular choice. Sep 2, 2021 at 14:24
• RealGs, you have the "explanation" which is that the saturation current of the diode is wildly dependent on temperature (more than a power of 3) and this overwhelms the sign of the thermal voltage change with temperature. But using a diode for measuring temperature involves a lot more than just being aware of why. You need to develop a sense of how it varies -- sensitivity equations -- vs temperature (how sensitive a device is it at different temps), vs device parameters (how much variation, device to device, you need to anticipate), and so on. Are you interested in those added details?
– jonk
Sep 2, 2021 at 22:51
• RealGs, Also, is this just a classroom exercise where you may only require a simulation result? Or is this more a matter of some personal or professional curiosity where some actual device construction may take place?
– jonk
Sep 2, 2021 at 23:31
• Hello Mr Jonk ... Sorry for the late reply ... Its just a classroom exercise ... Thanks for the feedback Sep 6, 2021 at 10:57

RealGsJROM3 - You are right, the temperature influence as calculated by you has a POSITIVE tendency. However, the main temperature influence is NOT caused by Tk (yes - it has a minor influence).

The main influence with a NEGATIVE coefficient comes from the reverse saturation current Is. As mentioned in the comment, the value is app. -2mV/K.

That means: The voltage across the diode must be reduced by app 2mV/K to compensate the temperature induced current increase caused by the factor Is.

Remark: The same characteristic can be observed for the pn-junction of a bipoolar transistor: d(Vbe)/d(T)=-2.1 mV/K-

• But since Vbc junction is doped lighter , it has slightly smaller tempco and thus Rce = Vce(sat)/Ic has small PTC effect. Some transistors may be NTC at low current then rise to NP0 the PTC with current. This means ganged Emitter followers have thermal runaway unless Rs about equal to Rbe is added and are thermally matched. But ganged common emitter switches do not have thermal runaway. Sep 2, 2021 at 20:27
• That slope, -2.1 mV/K, itself depends very much on the bias current. At a minimum, the OP will need to pick a specific device and a specific bias current, then measure the slope. It MAY be reasonable to assume other devices of the same type with the same bias current will have the same slope. OP will have to test a bit and see. Sep 3, 2021 at 4:09

## Dependence of Saturation Current on Temperature

You've already got a pointer about why it is that the sign of the derivative of the diode's voltage with respect to temperature is negative and not positive. While the thermal temperature factor in the equation has a positive derivative, it turns out that the diode's saturation current is so highly dependent on temperature, and in an opposite direction, that it overwhelms the thermal temperature component and changes the sign of the final result.

So, your Shockley equation is missing the temperature-dependence of the saturation current. Although some models (MEXTRAM 505.1.0) have recently modified saturation current behaviors, the following 1970's approximation is probably sufficient to get the main ideas across:

$$I_{_\text{SAT}\left(T\right)}=I_{_\text{SAT}\left(T_\text{nom}\right)}\cdot\left[\left(\frac{T}{T_\text{nom}}\right)^{3}\cdot e^{^{\frac{E_g}{k}\cdot\left(\frac{1}{T_\text{nom}}-\frac{1}{T}\right)}}\right]$$

$$\E_g\$$ is the effective energy gap (in eV) and is usually approximated for Si as $$\E_g\approx 1.1\:\text{eV}\$$ (but not always!) and $$\k\$$ is Boltzmann's constant (in appropriate units.) $$\T_\text{nom}\$$ is the temperature at which the equation was calibrated and $$\I_{_\text{SAT}\left(T_\text{nom}\right)}\$$ is the extrapolated saturation current at that calibration temperature. (Usually, $$\T_\text{nom}=300\:\text{K}\$$.)

The above formula develops from statistical thermodynamics. The Boltzmann factor (do not confuse this with the Boltzmann constant, $$\k\$$) is in the above case represented by the factor: $$\e^{_{\frac{E_g}{k}\cdot\left(\frac{1}{T_\text{nom}}-\frac{1}{T}\right)}}\$$. Here, it's based on the simple ratio of the numbers of states at different temperatures; really no more complex than fair dice used in elementary probability theory. Perhaps the best introduction to the Boltzmann factor is C. Kittel, "Thermal Physics", John Wiley & Sons, 1969, chapters 1-6 in particular.

Note: The power of 3 used in the equation above is actually a problem, because of the temperature dependence of diffusivity, $$\\frac{k T}{q} \mu_T\$$. ($$\\frac{k T}{q}\$$ appears so frequently it is assigned its own variable, $$\V_T\$$.) And still further complicated by the bandgap narrowing caused by heavy doping. So, in practice, the power of 3 is itself turned into a model parameter rather than the constant power shown in the above equation.

## Some Considerations When Using a Diode to Measure Temperature

It helps to first have some idea just how sensitive the diode device is as a temperature-measuring device. Having a quantitative sense informs you about what's important (and what is less so) in a final circuit design.

For example, it's quite likely that any particular diode's sensitivity to temperature will be different, one diode to another, and you'd like to know by just how much various diodes might vary. It's also quite likely that any particular diode's sensitivity to temperature will be different when the diode itself is operating at different temperatures. You'd probably like to know where, on the temperature scale, the diode is more sensitive (implying better resolution) and where it is less sensitive (and may be of less use.)

The questions that arise are of the form:

• "By what ppmV does the diode voltage change when the temperature changes by some particular ppmK? And how does this vary over the measurement temperature range?"
• "By what ppmV does the diode voltage change if the diode's nominal saturation current, $$\I_{_\text{SAT}\left(T_{nom}\right)}\$$, varies by a particular ppmA, one device to another of the same manufacturer and part number?"
• "By what ppmV does the diode voltage change if the diode's emission coefficient, $$\\eta\$$, changes by a particular ppm, one device to another of the same manufacturer and part number?"

The first is important because that's the entire point of the exercise and you probably need to figure out what to expect from the diode over your designed temperature range. It might be great. It might be not so great. But it would help to get a bead on this before proceeding to a design. Yes?

The other two may be important, if this isn't a classroom exercise, because you may want to know something quantitative about your error bounds in cases where you don't perform a calibration step for each diode and instead just take them as they come from the manufacturer.

## The Shockley Diode Equation

Well, it's time to consider the Shockley diode equation:

$$I_{_\text{D}\left(T\right)}=I_{_\text{SAT}\left(T\right)}\left(e^{^{\frac{V_{_\text{D}}}{\eta \,V_T}}}-1\right)\\ \text{where the thermal voltage is }V_T=\frac{k\: T}{q}$$

At higher currents, the above is inadequate because diodes have significant bulk resistance, as well. To see why, an example taken from this EESE answer shows: $$\R_{_\text{S}}\approx1.005\:\Omega\$$, $$\I_{_\text{SAT}}\approx 16.41\:\text{nA}\$$, and $$\\eta\approx 2.283\$$. (I've run similar tests on hundreds of diodes here, using voltmeters and current sources, with useful results.)

But note that it doesn't take a lot of current to develop a meaningful voltage drop, due only to this bulk $$\R_{_\text{S}}\$$ parameter value. At your current of $$\1\:\text{mA}\$$ this may not be so important. But for a moment let's look at what happens to the Shockley equation if we decide to include it:

$$I_{_\text{D}\left(T\right)}=I_{_\text{SAT}\left(T\right)}\left(e^{^{\frac{V_{_\text{D}}-R_{_\text{S}}\, I_{_\text{D}\left(T\right)}}{\eta \,V_T}}}-1\right)$$

The closed solution for that equation is:

$$I_{_\text{D}\left(T\right)}=\frac{\eta\, V_T}{R_{_\text{S}}}\cdot\operatorname{LambertW}\left(\frac{R_{_\text{S}}\,I_{_\text{SAT}\left(T\right)}}{\eta\, V_T}\cdot e^{_\frac{V_{_\text{D}}-R_{_\text{S}}\,I_{_\text{SAT}\left(T\right)}}{\eta\, V_T}}\right)-I_{_\text{SAT}\left(T\right)}$$

In any case, you can readily measure and then calibrate individual diodes for their $$\R_{_\text{S}}\$$, $$\I_{_\text{SAT}}\$$ (at some temperature), and $$\\eta\$$. This leaves the power of 3 and the value for $$\E_g\$$ in the saturation current equation left over to calibrate, if you want. But that can be done for an entire diode family, once. Or you can scour the datasheets for information like I did in that EESE answer mentioned above.

## Sensitivity Equations

Differential sensitivity analysis (the so-called direct method) can be used with mean-valued parameters. As you'll see below, the derivatives are multiplied by a parameter value ratio to normalize and remove the effect of units. This helps answer the questions mentioned earlier.

A sensitivity equation takes the form of (regarding the first question I mentioned earlier):

$$\frac{\% T}{\% V_{_\text{D}}}=\frac{\frac{\partial\,T}{T}}{\frac{\partial\,V_{_\text{D}}}{V_{_\text{D}}}}=\frac{\partial\,T}{\partial\,V_{_\text{D}}}\cdot\frac{V_{_\text{D}}}{T}$$

This result can show you how sensitive a diode is expected to be, and how that sensitivity itself varies, over your desired temperature range. You can then, with experimental follow-up, see how well this prediction compares with actual results. These may then feed into added calibration steps, depending on the goals.

I been involved in a similar process for analyzing photodiodes used in pyrometry.

As others have noted, you can't use the Shockley equation this way because Is is itself a wild function of temperature.

Since nobody really explained this in a concise manner, I will take a stab at it. The thermal coefficient of Vf under constant bias current is often given as -2.1 mV/K. However, this coefficient depends on the level of bias current and the specific transistor you use (diode connected transistor). At lower bias currents, the coefficient will be larger (perhaps -2.4 mV / K). At higher bias currents, the coefficient will be smaller (perhaps -1.8 mV / K).

I think you will have better and more consistent results if you use a diode connected NPN transistor at low bias current such as 10 uA or something. You may need to do two point calibration, but if you can maintain constant and accurate current, you should have a fairly linear voltage slope across a fairly wide range of temperatures. And MAYBE you will get away without calibrating each device separately.

The best PRACTICAL treatment of this I have seen is Bob Pease's famous work "What's All This VBE Stuff, Anyhow?". Here is a URL. Even though the URL seems a bit sketchy, it worked for me.

http://forum.vegalab.ru/attachment.php?attachmentid=367525&d=1584959439

By the way, the Bob Pease article starts with an anecdote that just about exactly matches your question and your situation. This prompted Bob to explain exactly how he calculates Vbe over variations in temperature and current for integrated circuit designs that he works on.