transistor as a temperature sensor  - Page 1
Forum section: electronics / beginners

author: RenesasT
author_rank: Newbie
timestamp: December 26, 2016, 10:40:08 am
content: Hello All,I am new to this forum. Please consider my question even if it is a silly one.In my project I want to detect temperature of particular vessel by using MMBT3904 transistor. I am using SMD transistor. I have connected base of transistor to the ADC pin of my micro controller and emitter of transistor to ground. Collector of transistor is open.For getting temperature value at ADC pin, the emitter should require bias current. Once emitter will be biased, i will get ADC values of temperature.Now thing is that, suppose I am biasing it with Digital multi meter then I am getting adc value as 145 at room i.e temperature of room (as my ADC is of 10 bits ) and the value in digital multi meter is 0.665 V. Generally digital multi meter has bias current as approx 100 micro Amp.I don't want to connect digital multi meter. I have to connect constant current source of 500 micro ampere current with the same adc value i.e 145.Please help me with this. If other information is required, please let me know.Awaiting for your reply.

author: johnwa
author_rank: Frequent Contributor
timestamp: December 26, 2016, 11:42:23 am
content: Hi RenesasT,There is a simple solution to your problem. All you need is a resistor from your positive supply to the base of the transistor. Eg, for a 5V supply, to give 500uA, us R=V/I = (5-0.665)/0.0005=8670 ohms. A 10k will be fine if you adjust the calibration a bit in your software. This is not a perfect 500uA current source, but will be adequate for your needs.Using a transistor (or a diode, which will also work) is good for a cheap temperature sensor, but if you want less hassles with calibration, you might want to look at something like an LM60.

author: RenesasT
author_rank: Newbie
timestamp: December 26, 2016, 11:55:26 am
content: Hello johnwa,Thanks for the reply.I will do this and will check once. But I need a constant current source for any supply voltage with the same value at my ADC at room temperature.Please suggest the same.I will be happy if my problem resolves by resistor method or need to find another solution.

author: johnwa
author_rank: Frequent Contributor
timestamp: December 26, 2016, 12:31:28 pm
content: What type of system is this microcontroller in? Surely you will have a regulated supply (e.g. 5V or 3.3V) powering the microcontroller? If you have a microcontroller board that you are feeding with an external unregulated supply, there will probably be a voltage regulator on the board that you can tap into.However, I think you will have to abandon your idea of gettingexactly145 as your ADC count every time. Due to component tolerances, you will always end up with some error, which you will have to either accept or calibrate out. Calibration could be done by replacing the resistor with a trimpot, but it would probably be better to do it in software.Note also that you appear to be using a 5V reference voltage for your ADC, which gives a voltage resolution of 5/(2^10)=~5mV. Given that 1 degree C change in temperature corresponds to a voltage change of 2mV, your reading will only ever be accurate to around 2 degrees anyway.These are all fairly basic calculations - you may want to read up on ADCs a bit.

author: orolo
author_rank: Frequent Contributor
timestamp: December 26, 2016, 12:38:10 pm
content: For the use of a PN junction to sense temperature, seeLinear Technology AN137. A PNP diode connected transitor is superior to leaving the collector floating. A filtering cap is important to suppress noise.For the constant current source, insensitive to voltage and temperature, you could use a voltage regulator,like TL431 or ATL431, and another transistor.

author: snarkysparky
author_rank: Frequent Contributor
timestamp: December 26, 2016, 12:42:55 pm
content: LM35Datasheet summaryThe LM35 series are precision integrated-circuittemperature devices with an output voltage linearlyproportionalto the Centigrade temperature. TheLM35 device has an advantage over lineartemperature sensors calibrated in Kelvin, as the useris not required to subtract a large constant voltagefrom the output to obtain convenient Centigradescaling. The LM35 device does not require anyexternal calibration or trimming to provide typicalaccuracies of ±¼°C at room temperature and ±¾°Cover a full ?55°C to 150°C temperature range. Lowercost is assured by trimming and calibration at thewafer level. The low-output impedance, linear output,and precise inherent calibration of the LM35 devicemakes interfacing to readout or control circuitryespecially easy. The device is used with single powersupplies, or with plus and minus supplies. As theLM35 device draws only 60 ?A from the supply, it hasvery low self-heating of less than 0.1°C in still air. TheLM35 device is rated to operate over a ?55°C to150°C temperature range, while the LM35C device israted for a ?40°C to 110°C range (?10° withimproved accuracy). The LM35-series devices areavailable packaged in hermetic TO transistorpackages, while the LM35C, LM35CA, and LM35Ddevices are available in the plastic TO-92 transistorpackage. The LM35D device is available in an 8-leadsurface-mount small-outline package and a plasticTO-220 package.

author: johnwa
author_rank: Frequent Contributor
timestamp: December 26, 2016, 01:05:58 pm
content: Quote from: orolo on December 26, 2016, 12:38:10 pmNice find orolo, that looks quite comprehensive. Though I think I will stick with theLM60s, unless I am really in a penny-pinching mood...

author: orolo
author_rank: Frequent Contributor
timestamp: December 26, 2016, 01:21:10 pm
content: Quote from: johnwa on December 26, 2016, 01:05:58 pmI agree, there are many inexpensive, low power, low footprint temperature sensing ICs. LM60 is a good example.

author: Seekonk
author_rank: Super Contributor
timestamp: December 26, 2016, 05:28:41 pm
content: I use a couple diodes in series to get you out of the muck and see a greater change. Those bits jump around quite a bit and need long averaging.

author: David Hess
author_rank: Super Contributor
timestamp: December 26, 2016, 06:02:22 pm
content: I prefer the AD590 and LM334 as temperature sensors because they can be used with two wires. The LM334 is more flexible for temperature compensating other circuits.RenesasT, look up "delta Vbe temperature measurement". For a given fixed ratio of currents, the change in Vbe is proportional to absolute temperature so any suitable transistor or diode can be used to make accurate temperature measurements without calibration.The Linear Technology application note that orolo linked sort of covers it but there are better references on how it can be done. With a microcontroller, it becomes trivial with the addition of one output signal to switch the current. Take a look at figure 11 on page 7 ofLinear Technology application note 45.

author: Benta
author_rank: Super Contributor
timestamp: December 26, 2016, 06:49:59 pm
content: Motorola used to manufacture a transistor linearized for this use, MTS102/103/105.Datasheet:http://pdf1.alldatasheet.com/datasheet-pdf/view/207566/MOTOROLA/MTS103.htmlWhether they are still available is uncertain, but the datasheet gives application hints.

author: Benta
author_rank: Super Contributor
timestamp: December 26, 2016, 09:32:51 pm
content: QuoteI agree 100%, that would be my approach too. But the OP specifically asked for PN-junction sensing, which prompted my answer.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 26, 2016, 10:15:36 pm
content: usually a resistor to a reasonable stable 3.3 V or 5 V supply for the µC should be good enough for the current source. The diode is usually not that accurate anyway and it is not that sensitive to a minimal temperature dependence of the the current.The typical slope is about -2 mV/K and can be quite well calculated from the voltage at room temperature. Ideal diodes (like many transistors) extrapolate to the same 124x mV at 0 K. So a single point calibration could be good enough. To suppress 50 Hz / 60 Hz "noise" one might want to average over an interval of 16.6 or 20 ms or a multiple of that.Getting only 145 counts at room temperature is a pretty poor resolution, so the DMM is not such good bias source.

author: David Hess
author_rank: Super Contributor
timestamp: December 27, 2016, 06:57:00 am
content: Quote from: Benta on December 26, 2016, 06:49:59 pmThose were intended for linear Vbe temperature measurement. Essentially they are transistors graded for identical Vbe at a given current. They would have been useful as matched transistors.The bog standard 2N3904 or at least the ones from National and On Semiconductor work fine for delta Vbe temperature in my experience. I actually got better results with the 2N3904 than with high gain transistors like the 2N5088 but that is probably to be expected. I suspect the issue is that high hfe leads to poor Early voltage but I never tracked it down.I expected that gold doped diodes like the 1N4148 and 1N914 would perform poorly but they work pretty well also.

author: Gyro
author_rank: Super Contributor
timestamp: December 27, 2016, 09:37:34 am
content: Quote from: David Hess on December 27, 2016, 06:57:00 amIf you're intending to use an SMT part (like your MMBT3904) then a dual series diode SOT-23 package like the BAV99 with give you twice the temperature coefficient in a single device.

author: Ian.M
author_rank: Super Contributor
timestamp: December 27, 2016, 11:18:14 am
content: Alternatively, use a Vbe multiplier circuit round the transistor. With correctly chosen resistor values, one can get sensitivity as high as 10mV/degC, while still staying well within the rails over the temperature range -25 to +125 degC (given a 5V supply), with an output impedance of only a few K.However either the pullup resistor should be driven by an output pin, or the ADC input switched to be an output and pulled low, to power down the Vbe multiplier between readings to minimise self-heating.

author: prietess
author_rank: Newbie
timestamp: June 11, 2017, 03:57:57 pm
content: Hello!I am now having similar problem to solve,May I ask whether a transistor for this temperature sensor purpose (Vc will change as temperature change) needs to be working in active region for all the temperature range?If my calculation says it is working in saturation for some temperature range, the question is wrong?I am attaching the question that I am talking about.I really appreciate anyone who would be able to help!

author: Ian.M
author_rank: Super Contributor
timestamp: June 11, 2017, 05:19:08 pm
content: Saturation would certainly be suspicious, but without seeing the circuit no one can comment on where the mistake could be or even if it is a mistake.