Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Temperature sensor

Status
Not open for further replies.

Rich D.

Active Member
This should be simple really. I was drawing up a temperature sensor with an analog output to a 0-5 Vdc ADC input to a microprocessor. This circuit doesn't need a lot of precision or accuracy, just a relative measurement for the user to view.

A cheap NPN is to be used. The Vbe changes inversely with the temperature. It's a small change, maybe less than 50-ish mV over typical room temperature ranges - not a lot of resolution for an ADC input. For improved resolution, I was going to rewire an OpAmp for gain and I would have to deal with it's issues. But then I thought: If I could connect several transistors in series, if each one changes 50 mV, then 4 of them would change 200 mV.

Does anybody see anything wrong with this idea or was this a flash of brilliance on my part?

Temperature Sensor 1.jpg
 
Add three resistors and a better opamp, and you get:

ts.jpg

What temperature range do you want?

LM224 output pulls close to ground, but will only pull to ~3.5V when powered with 5V

Read this.
 
Last edited:
doesn't need a lot of precision or accuracy
Fancy op amps, precision 1% resistors, maybe a precision regulator, throw in a couple of electrolytics, maybe very low ESR, what the heck, why not gold plate the whole thing? Maybe get the Swedish Bikini team to introduce it?

typical room temperature ranges

Why would I want to go out and buy a more expensive op-amp to pull the voltage-follower output higher than the input will ever get?

Thanks, for another project that info is seriously useful, but I'm not searching for the state-of-the-art temperature measurement technology.
Let's not over-engineer this, just wondering if anybody knows of a flaw in my quick-and-dirty way to enhance the precision.
 
This should be simple really. I was drawing up a temperature sensor with an analog output to a 0-5 Vdc ADC input to a microprocessor. This circuit doesn't need a lot of precision or accuracy, just a relative measurement for the user to view.

A cheap NPN is to be used. The Vbe changes inversely with the temperature. It's a small change, maybe less than 50-ish mV over typical room temperature ranges - not a lot of resolution for an ADC input. For improved resolution, I was going to rewire an OpAmp for gain and I would have to deal with it's issues. But then I thought: If I could connect several transistors in series, if each one changes 50 mV, then 4 of them would change 200 mV.

Does anybody see anything wrong with this idea or was this a flash of brilliance on my part?

View attachment 101505
Hi Rich,

Your circuit will work fine and is definitely a flash of brilliance.:)

Just some comments:

(1) The opamp is not necessary (or am I missing something).
(2) It would be wise to decouple the 5V line with a 100nF disk ceramic capacitor.
(3) High conductance transistors, like the BC337 and 2N2222, would perform better than high current gain (hFE), small signal transistors like BC54x and BC10x transistors.

You obviously know that the VBE of a silicon BJT has a temperature coefficient of -2mV Deg C, so your circuit will have a temperature coefficient of 4 * -2V = -8mV Deg C.

At the risk of incurring your displeasure, attached is a simpler circuit, based on a BJT VBE multiplier. The output voltage is 4V at 25 Deg C with a temperature coefficient of -13.79mV Deg C. The output voltage also has a low output impedance, as do the four super diodes in your circuit. VBE multipliers are commonly used to bias and stabilize the output stage quiescent current in class AB audio power amplifiers.

spec

2016_10_07_Iss1_ETO_VBE_MULTIPLIER_Ver1.png
 
Last edited:
Oh my God, Spec, you added a capacitor...
 
Bored this morning, so I did this: Looks like Spec's version Y is hardly worth doing compared to X. Z is repeated, this time with 5% resistors... Oh, and the LM224 will work for this case...

ts2.jpg
 
Last edited:
X has a slope of -7.6mV/degC, while Y (yours) has a slope of only -10.2mV/degC, not much of an improvement.

Shown here, N is slightly more complex, but produces a slope of -78mV/degC:

TS3.jpg


TS wants it to work for room temperature variations. Typical 10bit AD resolution is ~5mV per step, so Y has about 2 ADsteps per degC, while N produces about 16 ADsteps per degC.
 
You're missing the point Mike.

The OP want's a simple circuit: my circuit is the simplest and it performs exactly as intended.

spec

(PS, your N circuit static conditions are not defined, because there is no feedback. So the collector of the top transistor could be anywhere. You would need a potentiometer to set it up)
 
Last edited:
Wow! While I am a firm believer in KISS, I do get off on all this engineering stuff. I'll start with a big thanks to both of you guys for the ideas.

First - Spec - A 2N2222 would work better? :wideyed: I was just going to grab a 2N3904, my normal go-to transistor, but the 2N2222 drawer is right next to that, so it's worth a try. I might even try them both to see the difference.
I planned to use the op amp because I have an extra op amp in the package of 4, and it could be a long way to a 10-bit A/D input, so I thought buffering it could reduce potential noise pickup, but no it's not really necessary.
I suppose it is a good idea use your circuit to take advantage of some gain in the transistor if it's there. That could double the resolution to about 1/3 degree.
Really though, I'm offended at the capacitor addition! :mad:
Seriously, my supply will be well bypassed as always. And I would never lie about bypass caps. I'm just tired of drawing them in everywhere.

But of course if I were to add just one more resistor, I could instead take advantage of the op-amps gain like MikeMI's circuit. After all it's just sitting there drawing power anyways. Possibly 1/22th of a degree resolution? I'm tempted...


OK, after thinking about it, it's not worth the effort to design in a lot of resolution. But if it's essentially there already...why not use it?
I'll play around with spec's Y circuit and see what kind of performance I can get with different transistors, even though I'll have to purchase yet another resistor! If it gives me any trouble then I may just add some op-amp gain with MikeMI's Z circuit - assuming I can buy another resistor on an installment plan...1 cent now and 1 cent due in 30 days :).

One unique feature though about a string of transistors: Instead of detecting the temperature at one specific point (which is normally done), a string of transistors spaced apart will measure more of an average of the surrounding air temperature.
BTW: this is going into a rocket launcher. It's to be battery powered but they'll be plenty of "amp-acity" there. +5V will be double-regulated and heavily filtered. There will be a display showing various voltages, angles, counts etc. so what the heck-why not display temperature also? It would only be needed for human curiosity, it does not factor into the rocket launching circuitry.

p.s. sorry for all the faces, I just discovered all the selections.;)
 
The 2N3904 transistor will be fine for sensing temperature. The idea is to chose a transistor with low intrinsic resistance: re, rb and rc. That way you do not distort/mask the VBE temperature change, but it is only a small point.

If you ever need a high precision temperature circuit, the components are quite cheap and the circuit is quite simple.

You are building a rocket launcher?

spec
 
Rocket Launcher Yes! It will auto-level and allow for precise angular adjustment, measure and possibly compensate for wind velocity, meter battery voltage, count-down timer, camera start/stop, LED lighting for night launches, stuff like that. All really over-the-top, overkill technology compared to what is really necessary. In that regard I am making it overly complex - for fun of course. But I still believe simple is better than complex in engineering.

I have used 2N3904's in the past successfully for over-temp shutoff circuits. But if I can get a better response from a 2N2222 or something else I have it's worth an experiment. I have other high-current type transistors I could try, even some Darlingtons maybe.

If/when I need a accurate and/or precise temperature sensor, I would go with an IC like a MCP9700, LM45, or MAX6613. Maybe something with an SPI or I2C interface. They are hardly more than a transistor, but the trouble of locating a source for new part and storing it and spare parts etc. is one area where I also like to keep it simple.
 
But if I can get a better response from a 2N2222 or something else I have it's worth an experiment. I have other high-current type transistors I could try, even some Darlingtons maybe.
Bigger/higher-current transistors have a greater thermal mass, so won't respond as quickly to temperature changes.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top