# diy thermometer sensitivity

M

#### [email protected]

Jan 1, 1970
0
I have a need to measure temperature accurately from 78.0 C to 79.0 C (eventually I'll need to turn on a solenoid valve for cooling water at 79 C and turn it off at 78 C).

I saw this on the web:
http://playground.arduino.cc/ComponentLib/Thermistor

and I happen to have an Arduino on me. I read about how a 2N3904 can function as a temperature sensor if you tie the base and collector together, so I did that instead of placing an order and waiting for a thermistor to arrive.

A friend said to put the 10k resistor on the +5V line, then have the transistor below that, then tie the emitter to ground. Did that. A wire goes from the B-C-resistor junction to the ADC input on the Arduino.

It works. The serial port monitor tells me that for ice water, the 10-bit ADC value is 141. Boiling water from the microwave gives me 105. Room temperature at 23 C gave me 132.

I made a best-fit line with my OpenOffice spreadsheet and had the Arduino calculate the temperature. But now the sensitivity seems to only be 3 degrees. Temperature will jump even on gradual heating by 3 degrees.

I would like to expand the range from 105 to 141 somewhat (10 bits should get me 0 to 1023, right?)

I tried substituting 500 ohms for the 10k resistor (5V/500 ohms = 10 mA, should be ok) but still didn't get much improvement in sensitivity.

Any suggestions?

Thanks!

Michael

M

#### [email protected]

Jan 1, 1970
0
For my furnace thermostats, I ended up taking many readings and

averaging them, to "increase" the sensitivity. This works for me

because I realized that the noise in the readings was proportional to

the actual temperature (i.e. if it's actually 78.25 degrees, it will

read 78 most of the time and 79 some of the time, etc).

Oh ok, I'll keep that in mind. Thanks! The temperature changes within seconds; maybe I just have to take more samples... every few milliseconds or so

G

#### George Herold

Jan 1, 1970
0
I have a need to measure temperature accurately from 78.0 C to 79.0 C (eventually I'll need to turn on a solenoid valve for cooling water at 79 C and turn it off at 78 C).

I saw this on the web:http://playground.arduino.cc/ComponentLib/Thermistor

and I happen to have an Arduino on me.  I read about how a 2N3904 can function as a temperature sensor if you tie the base and collector together,so I did that instead of placing an order and waiting for a thermistor to arrive.

Well you'll have to calibrate it somehow though.
A friend said to put the 10k resistor on the +5V line, then have the transistor below that, then tie the emitter to ground.  Did that.  A wire goes from the B-C-resistor junction to the ADC input on the Arduino.

It works.  The serial port monitor tells me that for ice water, the 10-bit ADC value is 141. Boiling water from the microwave gives me 105.  Room temperature at 23 C gave me 132.

I made a best-fit line with my OpenOffice spreadsheet and had the Arduinocalculate the temperature.  But now the sensitivity seems to only be 3 degrees.  Temperature will jump even on gradual heating by 3 degrees.

I would like to expand the range from 105 to 141 somewhat (10 bits shouldget me 0 to 1023, right?)

I tried substituting 500 ohms for the 10k resistor (5V/500 ohms = 10 mA, should be ok) but still didn't get much improvement in sensitivity.

Any suggestions?

The thermistor idea is OK. You can get 0.1 degree C thermistors for
(maybe) $10 and 0.2 C for less. You'll want to think about the error sources in your measurement. (How 'good' does the +5V have to be? What about the 10k ohm resistor?) I've got a table for a 10k ohm (room temp.) thermistor, it doesn't go up to 79 C, but at 59C the resistance is 2580 ohms and 2488 ohms at 60C. (to give you an idea of the sensitivity.) You'll do a bit better if the second resistor is closer in value to your thermistor resistance at your desired temperature. To improve sensitivity put it in a bridge with an instrument amp after the bridge and adjust the gain and bridge resistors to fill the span of your ADC. George H. M #### [email protected] Jan 1, 1970 0 As DJ recommends, over-sampling and then averaging will probably help. On the other hand, a diode-connected transistor doesn't behave quite like a thermistor. Linear has a good app note on this over at <http://cds.linear.com/docs/en/application-note/an137f.pdf>. On the other, other hand your current empirical approach can do the job nicely if you get enough points to fit a low-order polynomial that the Arduino can handle -- or just to accurately define your threshold values and not worry about converting the A/D values to a temperature. As far as increasing your overall sensitivity, try sticking an op amp between the sense point and your A/D. That's often a good idea anyway, to buffer the sensor from the A/D input impedance. You can adjust the gain and offset of the op amp circuit to spread your range of interest across the input range of the A/D. If you're a little rusty on how to do that, read Chapter 4 of "Op Amps for Everyone", a free download at <http://www.ti.com/lit/an/slod006b/slod006b.pdf> Note that the freebie is the 2002 edition. There are later editions but this is still a good book and it's, well, free! Great! Thanks! I've never used an opamp before. This will be fun. =) Michael M #### [email protected] Jan 1, 1970 0 Well you'll have to calibrate it somehow though. Ice bath (0 C), boiling water (100 C)... then again I used tap water not distilled, and I'm probably 70 ft above sea level... eh, good enough. Least-squares trendline in OpenOffice and... voila. The thermistor idea is OK. You can get 0.1 degree C thermistors for (maybe)$10 and 0.2 C for less. You'll want to think about the error

sources in your measurement. (How 'good' does the +5V have to be?

What about the 10k ohm resistor?)

I've got a table for a 10k ohm (room temp.) thermistor, it doesn't go

up to 79 C, but at 59C the resistance is 2580 ohms and 2488 ohms at

60C. (to give you an idea of the sensitivity.)

You'll do a bit better if the second resistor is closer in value to

Say... what *would* the resistance of a 2n3904 be at room temperature, withthe base tied to the collector? I tried to put my DMM in series to measure the current with the resistor there, hoping to calculate R=V/I, but forsome reason the Arduino refused to work this way (looked like an open circuit to the Arduino).

To improve sensitivity put it in a bridge with an instrument amp after

the bridge and adjust the gain and bridge resistors to fill the span

Ok, I will try that.

Thanks!

Michael

M

#### Michael Black

Jan 1, 1970
0
I have a need to measure temperature accurately from 78.0 C to 79.0 C
(eventually I'll need to turn on a solenoid valve for cooling water at
79 C and turn it off at 78 C).

I saw this on the web:
http://playground.arduino.cc/ComponentLib/Thermistor

and I happen to have an Arduino on me. I read about how a 2N3904 can
function as a temperature sensor if you tie the base and collector
together, so I did that instead of placing an order and waiting for a
thermistor to arrive.
As someone said, the articles always used to tell you to use ice cubes and
boiling water to define those points, something you can easily replcate at
home. But then what's the linearity between those points? Some schemes
were better than others, and it's been so long.

But making a thermometer is actually different from a switch that turns on
at a given temperature. You might as well get a good thermometer, and
then adjust the trigger in the homemade sensor to switch at that point.
Turn up the heat until the thermometer reads what you want, then adjust
the trigger so it switches at that point. Then you don't have to fuss
about calibrating the sensor, or worry about whether it's linear over the
same range.

Michael

G

#### George Herold

Jan 1, 1970
0
It's not "resistance", it's a Vbe of the transistor, ~0.7V at room
temperature, constant current, -2mV/°C change versus temperature.

Yeah What Jim said,

Here's a link to diode forward voltage vs temperature... (Lots of
stuff you don't need there, but you can look at the first figure.)

https://www.dropbox.com/s/gtrgm08ui2lre78/Diode calibration table.doc

You'll need to drive the diode with a current source. Part of the
problem with the diode is if you want to sense a 1 degree difference
that's only a 2mV change in signal level.
A bridge is nice because it also reduces the 5 volt supply stability
requirements.

George H.

G

#### George Herold

Jan 1, 1970
0
You're only using a fraction of the ADC range.

A Vbe multiplier would help.

|      |
|      |
R2      |
|      C
+----B
|      E
|      |
R3      |
|      |
|      |
gnd    gnd

The collector voltage will be about 0.6 * (1 + R2/R3) which can be
scaled up to, say, 3 volts at 80C.

You can Spice this. R1 might be, say, 5K and R3 maybe 10K.

I'd put a capacitor across R3 so the transistor doesn't rectify stray
RF.

As noted, signal average to remove ADC noise.

Umm, a silly question. Is this to 'gain-up' the transistor Vbe
voltage with transistor as temp sensor? Or to 'gain-up' a thermistor
stuck in as R2?

I was first thinking the later... but then changed my mind.

George H.

M

#### [email protected]

Jan 1, 1970
0
Won't 10 mA cause some self heating?

It might. I touched the transistor and wondered if it was getting warm, but maybe it was just my imagination.

I wasn't brave enough to tie the transistor base and collector directly to +5V... I didn't want to ruin my Arduino.

Thanks for the advice, everyone! My head is spinning. So many things to try.

Michael

M

#### [email protected]

Jan 1, 1970
0
On Tuesday, June 11, 2013 6:31:04 AM UTC-7, George Herold wrote:

....
Umm, a silly question. Is this to 'gain-up' the transistor Vbe

voltage with transistor as temp sensor? Or to 'gain-up' a thermistor

stuck in as R2?

I was first thinking the later... but then changed my mind.

George H.

A follow-up silly question... is the temperature-sensing transistor R2?

Thanks for the circuit John!

Michael

M

#### [email protected]

Jan 1, 1970
0
As another approach the dedicated temp. chips are very cheap and would

Rheilly

Yes, I was starting to wonder if the best approach would be to simply bite the bullet and pay the \$2 for the thermistor.

But the methods everyone suggested will probably get me to where I need to go.

Thanks!

M

M

#### [email protected]

Jan 1, 1970
0
On Tuesday, June 11, 2013 9:24:24 PM UTC-7, John Larkin wrote:

....
The sensor is the transistor itself, the Vbe junction drop multiplied by

1+R2/R3. All the resistors are ordinary resistors.

If 1+R2/R3 is 5, the collector voltage will be roughly 3 volts at 80C, dropping

about 12 or so millivolts per degree C, 5 times the usual Vbe change with

temperature.

Cute, but a tacky way to measure temperature.

It is cute! Thanks!

If you think that is tacky, you'd laugh at what I'm using the temperature sensor for.

Michael

M

#### [email protected]

Jan 1, 1970
0
The sensor is the transistor itself, the Vbe junction drop multiplied by

1+R2/R3. All the resistors are ordinary resistors.

If 1+R2/R3 is 5, the collector voltage will be roughly 3 volts at 80C, dropping

about 12 or so millivolts per degree C, 5 times the usual Vbe change with

temperature.

Cute, but a tacky way to measure temperature.

Pretty cool (pun intended.)

Voltage decreases as the temperature increases. I used a 50k resistor for R2. I'm getting around 700 out of 1024 on the ADC at room temperature, andtemperature dropped as I put my fingers on it. Calibration time...

Must R3 be 2x R1, or does R1 provide all the current protection I need? Since I choose R2/R3 = 5, would 100 ohms for R3 and 470 ohms for R2 be fine?

Thanks again!

M

M

#### [email protected]

Jan 1, 1970
0
You're only using a fraction of the ADC range.

A Vbe multiplier would help.

| |

| |

R2 |

| C

+----B

| E

| |

R3 |

| |

| |

gnd gnd

The collector voltage will be about 0.6 * (1 + R2/R3) which can be

scaled up to, say, 3 volts at 80C.

You can Spice this. R1 might be, say, 5K and R3 maybe 10K.

I'd put a capacitor across R3 so the transistor doesn't rectify stray

RF.

As noted, signal average to remove ADC noise.

What kind of capacitor in parallel with R3?

So far after calibration I'm getting:

750 = 1 C
709 = 25.5 C
340 = 91 C

....although I do notice the numbers jump around quite a bit more. Probably need that cap.

Very nice! Thank you!

M

M

#### [email protected]

Jan 1, 1970
0
Your guess is pretty darned close

Michael

M

#### [email protected]

Jan 1, 1970
0
On Wednesday, June 12, 2013 12:36:25 PM UTC-7, George Herold wrote:

....
Oh, Are you distilling ethanol from water?

Haha, I plead the Fifth. The closer I can get to the 95% EtOH-H2O azeotrope at around 78 degrees (seems like the exact number depends on which sourceyou read 78.2? 78.3? 78.5? I give up), the better. If I completely lose control and allow it to get as high as 95 degrees, my column simplifies to asingle-stage (allowing way too much water in the distillate) and that completely defeats the purpose of having a column.

They never told us how important temperature control was when I was taking the Mass Transfer (eh, Diffusion Theory) class in college.

I tried manually controlling temperature with my sprinkler valve... uhoh, my thermometer reads 85 degrees... FULL OPEN! Whoops, too much cold feed, now my heating element has stopped boiling and temperature plunges below 78.... waiting for the boiler to boil again... drives ya nuts after awhile.

Thanks,

Michael

M

#### [email protected]

Jan 1, 1970
0
On Wednesday, June 12, 2013 12:36:25 PM UTC-7, George Herold wrote:

....
(What the bleep is an Azeotropic point?)

Oh, I didn't notice that question.

Consider a mixture of 96% alcohol and 4% water. You try to distill it. You collect the cooled-down distillate vapors. The composition is... 96% alcohol and 4% water. Distillation did nothing to separate the two.

http://en.wikipedia.org/wiki/Azeotrope

"A well-known example of a positive azeotrope is 95.63% ethanol and 4.37% water (by weight).[4] Ethanol boils at 78.4 °C, water boils at 100 °C, but the azeotrope boils at 78.2 °C, which is lower than either of its constituents.[5] Indeed 78.2 °C is the minimum temperature at which any ethanol/water solution can boil at atmospheric pressure."

You can separate the water out by passing it through a dessicating agent, like ANHYDROUS magnesium sulfate.

M

#### [email protected]

Jan 1, 1970
0
On Wednesday, June 12, 2013 12:36:25 PM UTC-7, George Herold wrote:

....
http://en.wikipedia.org/wiki/Ethanol#Charts

http://en.wikipedia.org/wiki/File:Vapor-Liquid_Equilibrium_Mixture_of_Ethanol_and_Water.png

(What the bleep is an Azeotropic point?)

I assume this graph moves around with external pressure.

George H.

Yeah the charts are pretty. The tables from Perry's Chemical Engineering Handbook are probably more useful in this context, however.

http://homedistiller.org/calcs/calc

Go down to "Equilibrium Data", Mass Fraction (g/g), and Vapour (y).

At 78.15 degrees you see the azeotrope (liquid and vapor have the exact same composition, 0.9558, or 95.58% ethanol). That is my target.

As temperature rises a bit you see the vapor fraction of ethanol drops. Even just at 79.8 degrees, less than 2 degrees above 78.15, the ethanol composition has dropped to 83%. So the dessicant step later on has to work thatmuch harder to make that ethanol dry. (Trying to make a fuel here, not planning to drink it.) As temperature rises to 95.5 degrees, well, you basically just made a single-stage distiller. A beer mix will distill at around95 degrees. It's about 5% ethanol. The vapor will be 34% ethanol or so, not quite concentrated enough to catch fire with a match.

J

#### Jon Kirwan

Jan 1, 1970
0
http://homedistiller.org/calcs/calc
<snip>
At 78.15 degrees you see the azeotrope (liquid and vapor
have the exact same composition, 0.9558, or 95.58% ethanol).
That is my target.

I note that even at 78.24C on your web link that the vapour
fraction has dropped 5% already. I'd almost wonder if there
is a vapour sensor system you could arrange to measure in
situ and use this as feedback in closed loop control.

It seems almost easier that way, because you are talking here
about significant differences with only tens of milliKelvins
accuracy (not precision) differences. And, as already
suggested, even if you have a well calibrated temperature
measurement and the sensor(s) is(are) placed optimally, you
may also need atmospheric pressure and relative humidity
figures in there, as well. And tables to use in controlling
things. Or else you control those factors, too.

Thanks for the posts, by the way. I am not a chemist and I
had only vague notions of how difficult this distillation
process might be. I now have a much better appreciation for
it.

Jon

D
Replies
3
Views
1K
Rich Grise
R
Replies
5
Views
238
Replies
3
Views
311
Replies
20
Views
537
Replies
10
Views
732