millwood0 发表于 2011-5-15 06:43:12

using transistors for temperature sensors

there are many advantages to use transistors for temperature sensors: they are cheap; they are very linear; etc.

however, those devices are very diverse and they require calibration.

here, I wanted to show another problem with using transistors as temp sensors: their linearity depends on the current.

millwood0 发表于 2011-5-15 06:46:17

here is a quick simulation to show the issue:

here, we have a 2n2222, driven by a constant current source. Our simulation is to show the Vout vs. temperature curve under different Ic conditions.


http://cache.amobbs.com/bbs_upload782111/files_39/ourdev_639857RMSY3M.PNG
(原文件名:pn-junction as temp sensor.PNG)

we started our Ic at 1ma (the green line, at the bottom) and incremented it 5ma per line until we reached 20ma.

millwood0 发表于 2011-5-15 06:49:42

what do we see here?

1) the Vout-temp relationship is extremely linear, at all Ic levels - great news!
2) the Vout-temp curve has slightly different slope: you will notice that the slope is slightly steeper at lower Ic levels than at higher Ic levels. however, at 15 - 20ma levels, the difference is quite small.

this means a few things:

1) for high precision temperature sensing, you pretty much have to drive your transistor-based temp sensor with a ccs.
2) you have to pre-calculate the slope at a given temperature level.
3) alternatively, you run the sensor at high Ic: 15 - 20ma or higher.

millwood0 发表于 2011-5-15 06:58:55

not shown here, you will find that if you replace Q1 with different transistors / diodes, you get a different line.

rainbow 发表于 2011-5-15 07:07:36

先MARK一下。(手机上网)

zchong 发表于 2011-5-15 08:27:19

对于简单的应用,温度的校准比较麻烦吧,这个曲线需要实际测试,两点或者精度更高采用拟合的话需要多点,
不知道小型的恒温设备贵不贵?

1ongquan 发表于 2011-5-15 08:32:28

一楼的图像是LTspice
晶体管的hfe随温度变化很大

eblc1388 发表于 2011-5-15 08:48:10

同意【5楼】 zchong , 还要一个温度由-55C至+100C都分毫不差的恒流源。

huayuliang 发表于 2011-5-15 13:23:38

俺的看法:

即便不使用恒流源,三极管构成的温度传感器的线性也要比其他一些类型的温度传感器要好。使用恒流源则进一步提高了线性。

至于温度的校准更不是问题,毕竟有较好的线性关系。

我在另一个版块发过一个图,用的是结型场效应管,温度与D-S之间的等效电阻成线性关系:

In many linear applications of field-effect transistors, the FET is used as a constant-current device for large VDS (i.e., drain-to-source voltage) or as ohmic resistance for small VDS. In the region before pinch-off, the FET is effective as a voltage-variable resistor. When forward-biased, the transfer characteristic (VGS vs. Id) of this device exhibits a linear variation of rDS(on), or drain-to-source on-resistance, with the junction temperature (Tj). This behavior indicates that a FET could be used as a temperaturesensing resistor (TSR) in the range of approximately −40°C to +150°C.

To use a FET as a temperature sensor in a practical application, a metallic cap preferably made with aluminum can be used as a heat sink (Fig. 1). The heat sink senses the temperature bath and provides linear variation of rDS(on) with temperature. Increasing junction temperature causes a linear increase in drain-to-source on-resistance.

In general usage, junction temperature changes with the mode of operation and biasing configuration of the FET. But in this application, the biasing and FET operation are kept constant, varying the junction temperature via the heat sink by heating or cooling above or below room temperature. Compared to N-channel FETS, P-channel FETS produce a larger variation of rDS(on) over temperature.

The plots given are for Motorola’s general-purpose N-channel FET 2N4856. Other families of FETs also exhibit a similar linear response of rDS with respect to junction temperature.

原文地址:

http://electronicdesign.com/article/components/use-a-fet-as-a-linear-temperature-sensor6401.aspx

图:
http://archive.electronicdesign.com/files/29/6401/figure_01.gif


http://archive.electronicdesign.com/files/29/6401/figure_02.gif

millwood0 也做下LTspice的方针吧。


JFET相关的还有篇文章,高温的(500..900度)。。

http://etd.ohiolink.edu/send-pdf.cgi/Patil%20Amita.pdf?case1238786695

dengting 发表于 2011-5-15 13:31:37

so good 线性?

JQ_Lin 发表于 2011-5-15 23:02:55

顶【楼主】millwood
顶【8楼】 huayuliang 花生

wenfeiexe 发表于 2011-5-15 23:06:23

cool

millwood0 发表于 2011-5-16 06:34:52

the point here is that the slope varies with current:

for 2n2222, at 1ma, the slope is -1.77mv/C;

at 30ma, the slope is -1.47mv/C.

so if you aren't careful about the current setting in such a device, you may generate a high reading error. this is where a commercial temp sensor like lm35 is valuable - no calibration required.

the linearity is good because of the laws of physics.

millwood0 发表于 2011-5-16 06:45:35

to add to it:

2n3904: tempco = -1.77mv/C @ 1ma Ic, -1.48mv/C @ 30ma Ic;
1n4148: tempco = -2.00mv/C @ 1ma Ifwd, -1.49mv/C @ 30ma Ifwd;
2n5550: tempco = -1.65mv/C @ 1ma Ic, -1.36mv/C @ 30ma Ic.

enjoy.

millwood0 发表于 2011-5-16 06:50:12

"温度与D-S之间的等效电阻成线性关系: "

that can be tricky, as there is no physics governing the Rds vs. temp relationship.

For diodes, it is very simple: Shockley diode equation is well understood and the only variable there is the process-driven factors (and current going through the diode).

millwood0 发表于 2011-5-16 06:53:58

"还要一个温度由-55C至+100C都分毫不差的恒流源。"

no. the use of a ccs here is for analytical convenience. you can replace that ccs with a resistor: because the voltage fluctuation here is small (~0.3mv mostly), a relatively large resistor (1k for example) would be very good - in this case, the current variability is only about 0.3ma (out of 5ma if the diode is powered by a 5v source).

Obviously, this can become an issue if you are running the diode hotter.

eblc1388 发表于 2011-5-16 09:33:31

回复【15楼】millwood0
-----------------------------------------------------------------------
同意。仿真证明不使用恒流源下的相对误差都非常小,实际使用时只须保持VCC电压隐定,便可省去恒流源。

http://cache.amobbs.com/bbs_upload782111/files_39/ourdev_640065BCSV8P.png
(原文件名:temp_sweep.png)

huayuliang 发表于 2011-5-16 16:09:57

哦,突然想起,某个加热设备用的探头是二极管的,本地只有一家有售,50RMB。

ISIS中如何仿真温度变化呢?

millwood0 发表于 2011-5-16 18:24:19

Motorolla sold for year a temperature probe called MT102, which is simply a refashioned 2n3906, with its b/c pins tied together, :)

not sure if ISIS can do it. you need a package that allows parameter sweeping (which isis can) and one that allows user settings for temperature whichisis doesn't.

orcad is able to do this as well.

millwood0 发表于 2011-5-16 18:27:44

as to the use of a near-zero tempco causing higher errors, the forward voltage on the p-n junction will decrease with temperature, causing the current to go up. so to maintain a constant current, you have to increase the resistance (with temperature), thus a resistor with positive tempco should be used.

you can probably calculate the positive tempco needed to minimize the errors over your application range.

huayuliang 发表于 2011-5-16 20:46:58

sweeping.....我现在是借助easyHDL实现电压的sweeping。。。似乎ISIS的元件模型也没有温度这个参数。

看来俺得把LTspice好好熟悉下了。



没能搜到 MT102 的 datasheet,能否给个链接?

millwood0 发表于 2011-5-16 21:03:36

google is probably your best friend of getting a mt102 datasheet - it is an old device.

'我现在是借助easyHDL实现电压的sweeping。' one of the charts there is called transfer function / transfer curve where you can vary a variable (default is called 'X'). so all you need is to designate the value of your voltage (or resistance / capacitance) as X.

I don't think temperature is one of those variables, unfortunately.

eblc1388 发表于 2011-5-16 21:19:06

回复【17楼】huayuliang花生
-----------------------------------------------------------------------

>> 突然想起,某个加热设备用的探头是二极管的

用仿真试了一下二极管和三极管(CB短接)的相对温度表现。二极管用1N4148,三极管用2N2222。除了电压输出不同(600mV, 670mV)外,其它表现如不线性等都大致相同,所以我觉得用三极管(CB短接)相对用二极管下并没有特别优势。唯一优势是电压输出比较大,较易放大取样。

millwood0 发表于 2011-5-16 23:01:35

"所以我觉得用三极管(CB短接)相对用二极管下并没有特别优势。唯一优势是电压输出比较大,较易放大取样。"

an amplified diode (c-b shorted) is identical to a diode. no difference whatsoever, in terms of physics.

the difference in output voltage / tempco is due to process differences.

millwood0 发表于 2011-5-17 08:16:30

I was wrong and it can be done in Proteus as well (or any pspice-compliant simulator).

you will need to dc sweep a variable (in this case, we call it "X").

go into your transistor property, and add {TEMP=X}, as seen in the following picture.


http://cache.amobbs.com/bbs_upload782111/files_39/ourdev_640283BVPNZP.PNG
(原文件名:tempco.PNG)

and then you can sweep X (in effect, the temperature).

supposedly, TEMP is a global variable defined in pspice.

enjoy.

danju 发表于 2011-5-17 09:40:46

学习了,以后做个实验板试试,只是实际应用的话调校比较麻烦,批量应用还是LM75等比较方便

huayuliang 发表于 2011-5-17 20:40:07

回复【24楼】millwood0
-----------------------------------------------------------------------

thanks a lot !

millwood0 发表于 2011-5-17 21:18:40

"批量的话,一致性如何呢"

poor. i tried with 2n5551s of different batches from the same vendors (ONSemi and Fairchild) and Vbe varies from 0.63v - 0.69v. at average -2mv/C of tempco, that means the sensing error is approximately 60mv / 2mv = 30c.

aka without calibration, it is basically unusable.

csq463276932 发表于 2011-6-18 09:33:47

看到第二贴的用三极管测温的。

http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=382902&bbs_page_no=1&search_mode=4&search_text=eastbest&bbs_id=9999

huayuliang 发表于 2011-6-19 17:53:55

今天又琢磨了下:

既然元件一致性的问题很难解决,可以通过调整电流的方式进行标定处理,这在实际生产中也不是什么难事。

此外,在与单片机的A/D接口上,可以使用Vbe倍增器电路,满足A/D的最大量程。

况且,考虑这种方式的线性,即便不使用恒流源也可以得到比较满意的效果。

总计才3个电阻,1个三极管........比NTC的不知要好多少。。

等俺空出面包板做下它和18B20的对比试验

wangqh1983 发表于 2011-6-19 21:35:28

回复【24楼】millwood0
-----------------------------------------------------------------------

thank!

millwood0 发表于 2011-6-21 21:34:38

"这在实际生产中也不是什么难事。"

that can still be very difficult. the slope and its intercept are dependent on the process / batch / device-device deviations. the only hope is to obtain transistors from the same chip to minimize variations caused by the process.

huayuliang 发表于 2011-6-21 23:29:38

回复【32楼】millwood0
-----------------------------------------------------------------------

你说的对,斜率和intercept肯定都会随批次等因素有一定差异。

不过我想,基于较好的线性这个特点,确定两个温度点,基本上也就完成了。
intercept,可以利用调整电流的方式先在某个温度(比如0度)确定一个点,这样得到此时的Vbe。
另外一个点,可以在另一个设定的温度下(比如100度)测量出Vbe,然后存入EEPROM。

这有些类似于AVR的A/D校准。。。

millwood0 发表于 2011-6-22 01:51:15

"确定两个温度点,基本上也就完成了。 "

yeah. that's basically a calibration process. and you pretty much have to do this for individual sensors.

a pain-in-the-butt if you want to mass produce. that's the value to have a temp sensor (analog or digital).

millwood0 发表于 2011-6-22 06:18:13

mcp980x for example is really based on a (amplified) diode. however, it has nice uniformity / consistency so no calibration is required (but is helpful).

it costs only 20 cents vs. a few cents for a typical transistor + resistor. a good deal if you ask me.

huayuliang 发表于 2011-6-22 13:27:56

回复【34楼】millwood0
-----------------------------------------------------------------------
程序上最初打算用引脚控制,但需要两个引脚,一个用于判断是否为校准状态,另一个用于判断是哪一个设定的温度。后来又想了下,干脆也用EEPROM,直接写这两个功能的逻辑状态就是了。

回复【35楼】millwood0
-----------------------------------------------------------------------

MCP980X是很不错的选择,20美分相当于人民币1.6元多。问题是国内(国内)很难见到。不知台湾那边如何。
耗电很小,常用的小信号三极管(TO92的)电流都比它高很多。

啊哦,内部是 Band-GapTemperature Sensor。

温度误差 +/- 1 摄氏度......太大了吧?

Jigsaw 发表于 2011-6-22 17:23:20

华山论剑……
旁观一下

millwood0 发表于 2011-6-22 18:11:41

I was wrong. it is mcp970x (analog output), not mcp980x (digital output).

millwood0 发表于 2011-6-22 18:12:19

"温度误差 +/- 1 摄氏度......太大了吧?"

for temperature sensors, that's actually fairly good.

huayuliang 发表于 2011-6-22 23:22:34

回复【38楼】millwood0
-----------------------------------------------------------------------

谢谢,查了下淘宝,MCP9701大概价格在2~3元,MCP9801不知具体价格,估计是在6元左右。

MCP9701 在0~70摄氏度范围内,精度为 +/- 1摄氏度。

现在的IC咋不给出内部结构框图了呢?以前的咋还能学到些东西。。

millwood0 发表于 2011-6-23 01:33:55

'CP9701大概价格在2~3元,MCP9801不知具体价格,估计是在6元左右。'

that sounds a little bit expensive.

'MCP9701 在0~70摄氏度范围内,精度为 +/- 1摄氏度。 '

more importantly, the diode has a resolution of 0.3 lsb/C (per diode. = 1.5mv / 5mv), and the mcp9701 has a resolution of 4 lsb/C, assuming 5V/10bit adc.

so if you want resolution of at least 1 lsb/C, you need three+ diodes in a string.

hcfatjh 发表于 2011-6-23 08:13:48

占楼记号

eastbest 发表于 2011-6-23 08:34:21

mark

huayuliang 发表于 2011-6-23 13:19:50

俺把Vbe倍增电路也贴上来吧,这东西在Class-AB功放里很常见:

http://cache.amobbs.com/bbs_upload782111/files_41/ourdev_651401A045VB.png
(原文件名:Vbe倍增电路.png)

Q、RB1、RB2 构成Vbe倍增电路,电阻R是为检测受温度影响的电压值提供的。

其实不使用这个电路或者不放大也一样,带AD的单片机,采用外部Vref,调整到1V。。。

watermarker 发表于 2011-6-23 13:22:10

mark

zkcheng606 发表于 2011-6-23 17:16:41

好东西,mark。

huayuliang 发表于 2011-7-3 00:28:35

室温下 Vbe 在1500S内的电压变化。

http://cache.amobbs.com/bbs_upload782111/files_42/ourdev_654231WYX1KC.png
(原文件名:2011-07-03 00 18 41.png)



随手抓了几个 8550, 相同的偏置电阻下,Vbe 相差1.5mV左右。都快1度了。

zforce 发表于 2011-7-3 01:10:29

利用三极管的温度曲线测量。。。学习~~

huayuliang 发表于 2011-7-3 17:09:45

使用Vbe倍增电路的两个8550电压变化曲线。
两个图的电压变化范围都是12mV多点。2倍的Vbe。

变化是手触引起的:初始接入电路时,由手指传到到三极管的热量还未散尽;另一端较大的变化就是手指一直接触三极管顶端,直到温度不再变化后手指移开。。。
http://cache.amobbs.com/bbs_upload782111/files_42/ourdev_654369Q6BA1Q.jpg
(原文件名:01.jpg)

http://cache.amobbs.com/bbs_upload782111/files_42/ourdev_654370Y7REFF.jpg
(原文件名:02.jpg)
页: [1]
查看完整版本: using transistors for temperature sensors