Go Down

### Topic: Temperature Sensor (Read 3937 times)previous topic - next topic

#### Resinator

##### Dec 01, 2012, 12:31 pm
I have built an ac induction motor drive and it works fantastically well I could go on about energy efficiencies (90W reduced to 16W at half speed) operating regardless of the load characteristics bla bla bla but I won't bore you!

For development I used a simple pot through an ADC to dictate the output frequency but now it works I want to incorporate temperature control ( expected temps of between 20C and 30C) and this is where I would appreciate some feedback

I initially thought of getting an RTD interfaced with a bridge and an instrument amp to give a voltage between 0-2.95V and I could do that but I have noticed a plethora of temp sensors

Like

Or

http://uk.farnell.com/analog-devices/tmp37ft9z/sensor-temp-2deg-125deg-3to92/dp/2102510

Which looks a lot less work to develop, and I could silicone it in a PTFE tube then heat shrink it to make a sensor probe for harsh-ish environments

I have a supply of 3V or 5V and my uC has a 0-2.95V 12 bit ADC

So my thinking is use the AD22103KTZ

VOUT = (VS/3.3 V)  ´ [0.25 V + (28 mV/°C) ´ TA]

with a supply of 2.95V @25C the output is approx 0.85V

@ 30C

Output= 0.97V

@20C

Output = 0.72V

So my ADC reading will vary between 1005 (@20C) to 1346 (@30C)

My question is does this sound like a good method to eliminate using amplifiers and signal conditioners? it just seems too easy for me!

If anyone can recommend a better method I would be most grateful

#### NickPyner

#1
##### Dec 01, 2012, 12:55 pm
This is an Arduino forum and you are probably well-advised to use what most others use, the Dallas 18B20. This is often used bare but can be bought already encapsulated, complete with cable in various lengths, and plug.

It also has advantages like running off the standard voltage of the rest of the device and that, when you ask it the question, it will give an answer in plain English.  This beats the hell out of all those voltages, bridges, and numbers, and is likely just what you need. So look there first.

#### Resinator

#2
##### Dec 01, 2012, 03:03 pmLast Edit: Dec 01, 2012, 03:07 pm by Resinator Reason: 1
Thanks for your reply, however isn't the 18B20 a digital device that outputs a datastream really neat but my understanding is that the program will need to measure times (to determine high/low)
using interrupts or whatever, my program is required to do lots of other tasks its geared up now to measure an analog voltage and I would love to keep it simple so as not to interfere with the program too much

Is there an issue with what I suggest in my first post?, a bridge and an amplifier wouldnt be that much work really, i just want it as simple as possible

#### NickPyner

#3
##### Dec 01, 2012, 04:14 pm

Thanks for your reply, however isn't the 18B20 a digital device that outputs a datastream really neat but my understanding is that the program will need to measure times (to determine high/low)
using interrupts or whatever, my program is required to do lots of other tasks its geared up now to measure an analog voltage and I would love to keep it simple so as not to interfere with the program too much

You interrogate the device in the sketch loop. I imagine you will surely need to take a clock into account no matter how you measure the temperature, so I don't see the relevance there. The time  doesn't actually have to be handled by the Arduino. If you feed the temperature output to Excel, the date time, max and min can all be handled there.

Quote

Is there an issue with what I suggest in my first post?, a bridge and an amplifier wouldnt be that much work really, i just want it as simple as possible

Well, I'm not really an electronics expert but, in the light of what the DS18B20 does, and does so simply and elegantly, what you propose just looks absurd, it's like something out of the 1970s. In short, I submit you are utterly failing in your stated objective - to measure temperature, and as simply as possible.  I recognise that there may be other influences, the most likely being that you've already gone and bought the hardware, and I'm certainly not suggesting that what you propose won't work. But what you want is not much different from what I want, so I am suggesting there is a better, and simpler,  way to do it.

#### Resinator

#4
##### Dec 01, 2012, 04:49 pm
Thanks again for your input, I dont see why time would ever come into a temperature measurement unless it was with a digital device like the 18B20

Temperature measurements I am familiar with uses analog and digital electronics at work we use all kinds of thermistors, PT100's thermo couples etc which interface directly with dataloggers and instrumentation whilst it might well be from before the 70's it is still very effective and reliable hence why its so common

Now I haven't bought any hardware at all yet and I do plan on messing around and trying different methods and chips the cost of these components is rather cheap

I want to do it as simple as possible but without interfering with my existing program which is pretty demanding, to give you an idea it does 5 A2D conversions 4 trig calcs a load of sums multiplies and divides and plenty of other stuff like switching and arrays which all comes to about 28us (yeah i just measured it!) with an interrupt every 25us to increase count and start again hence I am not switching every device in the 25us window (losing 3 us per cycle) which means the switching frequency is below 20kHz which is starting to creep into the audible frequency range which I need to avoid to stop the induction motor from becoming noisy hence more code is less switching times and decreased frequency which then gives me more LF harmonics!

I hope thats a bit more clear, I really appreciate your input the main reason to this thread is

A to see what people think of directly connecting a device like the TMP37/AD2210 to a uC, is the 28mv/C enough to realistically work with?

B to see if theres any other devices out there I should know about

I do like the look of the RTD metal probes as well

#### NickPyner

#5
##### Dec 01, 2012, 05:25 pm
I didn't raise the matter of time. If you just want to know something happened, and don't care when, then you clearly don't need a clock. Devices like the DS18B20 don't need a clock, they just tell you the temperature when you ask for it, in (something reasonably close to) plain English, and to two decimal places.  There are other devices that are similar, but I don't know anything about them.

I have some PT100s and I recognise that they are well-proven for the purpose, but everybody goes up blind alleys from time to time, and I have never used them. There is simply no point, as they simply are not simple enough.

#### dc42

#6
##### Dec 01, 2012, 08:45 pmLast Edit: Dec 01, 2012, 08:48 pm by dc42 Reason: 1
Quote
I have a supply of 3V or 5V and my uC has a 0-2.95V 12 bit ADC

So my thinking is use the AD22103KTZ

VOUT = (VS/3.3 V)  ´ [0.25 V + (28 mV/°C) ´ TA]

with a supply of 2.95V @25C the output is approx 0.85V

The DS18B20 sensor is just as easy to use with an Arduino and you can buy it ready-encapsulated, e.g. http://www.ebay.co.uk/sch/i.html?_trksid=p5197.m570.l1313&_nkw=waterproof+temperature+sensor&_sacat=0&_from=R40. A further advantage is that is does not rely on the exact value of the Arduino Vcc or some other voltage reference.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### Resinator

#7
##### Dec 01, 2012, 09:05 pm
I have ordered a few IC's some were as cheap as 30p!

But I will order one of these DS18B20's as well and see how I get on

Remember I am not using an Arduino, is the one wire library specific to Arduino? and how much wouldit take to program without it?

The Datasheet is rather confusing certainly doesn't seem simple!

#### dc42

#8
##### Dec 01, 2012, 09:29 pm

Remember I am not using an Arduino, is the one wire library specific to Arduino? and how much wouldit take to program without it?

You should have said so earlier - this is an Arduino forum, so we assume you are using an Arduino or at least an atmega mcu unless you say otherwise. What are you using?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### Resinator

#9
##### Dec 01, 2012, 10:16 pm
STM32F4 an Arduino just isnt fast enough

#### dc42

#10
##### Dec 01, 2012, 10:29 pm
In that case, this http://www.freag.net/en/t/2i9uy/maxim_ds18b20_t may be useful.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### robtillaart

#11
##### Dec 01, 2012, 11:15 pm
There is the dallas temperature library - http://milesburton.com/Dallas_Temperature_Control_Library -
it has source code available, and is imho quite portable (some effort needed) to other MCU's
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### NickPyner

#12
##### Dec 02, 2012, 01:10 am

Remember I am not using an Arduino, is the one wire library specific to Arduino? and how much would it take to program without it?

The DS18B20 has been around longer than the Arduino. I believe the Arduino makes their use simpler (there's that word again....), but I don't know how.  Due, I'm afraid, to a self-inflicted comedy of errors, the first setup using the Dallas that I actually got to work did not use the one-wire system. The programming is about the same, and the memory requirement is somewhat less..  While the one-wire system is the second of the DS18B20's great assets, you are right to consider working without it.

Quote

The Datasheet is rather confusing certainly doesn't seem simple!

Well, if you must go reading datasheets, you deserve all the confusion you get. All you need to know is what it does and how simply, which is clear enuff, and how to programme it, which is largely done by somebody else. Once you have that, the device itself is plug'n'play in the truest sense of the word. You might find the link below useful.

http://sheepdogguides.com/arduino/ar3ne1tt.htm

This was the only code I could find that did not use the one-wire bus. I used it to run two probes, and it would do fine for the one-probe setup you propose.

`

Go Up