Arduino – How to Use a 2N2222 Transistor as a Temperature Sensor


I'm supposed to use a TMP36 transistor for a class to read the temperature of the environment, but I only have a 2N2222 transistor; the Arduino will have an analog read of it, but the numbers won't change even if I heat it up. Am I screwed or can I fix this?

Best Answer

TMP36 is specifically a temperature sensor, not an NPN transistor like the 2N2222. You might have them confused because they both can come in TO-92 package. It is possible to look at the various properties of 2N2222 transistor and correlate it to temperature (see the other answers on this page), but that seems not practical for your application.

You will have to find a suitable alternative temperature sensor that "provide a voltage output that is linearly proportional to the Celsius temperature" with similar output to the TMP36 or try a different approach.

Related Topic