Diodes (or p-n junctions) make extremely low-cost temperature sensors! They are convenient, especially since they can be included on the silicon as part of larger designs into integrated circuits (ICs) - it costs almost nothing to include one : )
There are many dedicated ICs of course too, that use a p-n junction as a temperature sensor, and wrap an analog-to-digital converter (ADC) and a simple interface such as I2C around it. Again they are low-cost, and it is not unusual in large designs to have several of these or maybe a dozen or more inside a chassis! They provide great information about the state of the surrounding hardware, so that fans can kick in, or devices can produce alerts if something goes wrong.
All p-n junctions have a forward voltage drop, known as VF. That voltage drop is approximately 0.6-0.7V, but it reduces as temperature rises, by a few millivolts per degree C! That's the secret to using such junctions as temperature sensors.
A discrete diode, or a couple of legs of a discrete transistor, can also be used as a temperature sensor too, but it is not very common these days, because it would cost more to add the additional circuitry (to amplify up the few millivolts signal), compared to buying a chip. However, they can also be used as a form of analog compensation for circuits that drift with temperature. If a circuit has a positive temperature coefficient, then a diode could be used to null it out! This was the motivation (and see Even More on Current Sources and a Kelvin (4-Wire) Milliohm Meter for more information) to try and better understand the VF behaviour. This blog post briefly discusses an experiment that was done to try to find out more precisely how much VF shifts by, as temperature changes.
The forward voltage, as mentioned, varies with temperature, and that's the key to it being used as a temperature sensor. However, VF also changes depending on the amount of current passing through the p-n junction. And then just to make things worse, it could changes from one device to another. According to jc2048 a typical value recorded in many older books is to expect -2.5mV/degC change in the forward voltage, as temperature changes. The aim of this blog post is to find this value experimentally.
To measure VF, a constant current is passed through the junction, and the voltage is measured across it. For the test, current values of 1,2,3,4,5,6 mA were used.
I decided to test at room temperature, and at close to 100 degrees C, and then use these values to work out the VF gradient over the temperature range, which would be the temperature coefficient. The reason to select these temperatures is because I could achieve them with stability for long enough to take measurements. I'm not an expert in this, as I understand the experts would use scenarios involving glycol and refrigerators.
I initially picked a 1N457 diode, because a Texas Instruments LM334 PDF document happened to mention its temperature coefficient was -2.5mV/degC. But I also chose some popular transistors, because a Diode Based Temperature Measurement PDF document, also from TI, suggested that using a BJT was better because it has a more consistent temperature coefficient.
These were the selected devices:
It was a deliberate decision to try to pick components from different manufacturers, so see if this made a difference. All parts were from reputable sources (the ones without a Farnell code were either purchased from Farnell or from Future Electronics, but I cannot track those any more, I'd had those for many years). The photo shows the assembled parts from right-to-left, A-F. The base and collector were shorted as the TI document had them in their schematics.
Building the Testbed
Epoxy glue (Araldite Rapid) was put on the component legs, in an aim to waterproof the joints. After it had set it was repeated for a total of 4 layers, to have confidence that all was sealed. A PT100 probe was also attached to the assembly, just to confirm water temperature. Next, tests were done at room temperature (see further below).
After the room temperature tests, further tests at 100 degrees C were needed. The assembly was attached to a stick and suspended inside a pan/pot. A PT100 temperature probe was also attached.
For the current source, a process calibrator was used, since these are portable and easy to move into a kitchen. For the VF measurement and temperature measurement, handheld multimeters were used. The PT100 provides a resistance that varies with temperature, so a normal multimeter set to ohms range can be used, and there are tables (and online calculators) to convert to a temperature reading.
Running the Tests
The procedure was to clip the current source and multimeter set to Volts together in parallel, and then connect to each component in turn, and record the measurement. For the 100 degree C test, the water was boiled, and kept on a medium heat. The PT100 probe confirmed that the temperature was close to 100 degrees C (to within about 0.2 degrees C) throughout the test.
The results that were captured are recorded here:
The temperature coefficient was the difference in VF, divided by the difference in temperature:
The TI document referred to earlier had this chart for a typical transistor:
It can be seen that the experimental results were similar, they are very close.
The forward voltage versus current was also plotted, just for interest:
As expected, the VF value increased as the current through the p-n junction was increased.
The results show that for the two BC547 series diodes from On Semi (components C and D) had very similar behavior, especially at the lower currents, whereas the BC547 from Fairchild had a difference.
Surprisingly, the two 2N3904 devices from different manufacturers (Nat Semi and On Semi) had near identical behavior!
Also, it showed that perhaps -2.5mV/deg C is no longer as close an approximation as it could be; maybe -2mV/deg C is a more accurate general approximation.
Ideally more tests should be done, especially to see if there are any differences in many samples from one batch to another, and at different temperatures, but I hope the small bit of information here is nevertheless useful, or it might provide ideas for anyone who wishes to improve on the procedures. Thanks for reading! Also, thanks to fmilburn for working on a milliohm meter, which led to these measurements.