PDA

View Full Version : Temp readings and voltage input



ruijc
- 19th March 2008, 11:08
Hi all,

i'm my 16F88 temp monitor project i have a LM35 sensor with no vref.
The input voltage for the workbench was always 5v and everything is working perfectly.

After moving for the pcb i have found an issue that puzzled me.

For the PCB aplication i have it connected ( via 7805 ) to a 4.8V NiCd pack. This pack when fully loaded is 5.3V and after some use it drops to +-4.5V.

This is causing some bad temperature readings when the pack drops bellow 5v.

The code i used for temperature is like this :

temp= (in */5000)>>2

I have no vref because i can live with the 0.5ºC stepping ( 10Bit resolution ) and this code allows me to have an output like XXX,X.

My question is:

Is there a better code to be flexible with the input voltage and still have accurate readings ?

Thanks

Acetronics2
- 19th March 2008, 11:24
The answer is simple ...

Use a Voltage Ref !!! a TL431 i.e is cheap, TO92 shaped, and easy to trim ...

OR use a Temp to Digital ( DS18B20 i.e.) or temp to PWM ( SMT 160-30 i.e ) sensor ...

No miracle to wait for !!!

Alain

sougata
- 19th March 2008, 11:34
Hi,

I personally prefer voltage references from the Microchip Analogue familiy. MCP1541 is which I use most. While using TL431 cap values are important and improper design causes noise which would set things up. Find the attachment and open in Microsoft Excel. It is a TL431 calculator. Make sure macros are turned on from your Excel security settings.

Acetronics2
- 19th March 2008, 12:24
Hi, Sougata

Thanks for the XLS sheet ...

TL431 is to consider like a Zener diode ... noise involved !!!

I always use a solid aluminium 10µF cap ( Alusol C 122 ) or tantalum cap ...

With a good 4.5 digits multimeter for trimming - and quality components - ... performance is to compare to MAX or AD best voltage refs ...

Not so bad, for such an oldie !!!

Alain

ruijc
- 19th March 2008, 12:31
Thanks Acetronics,sougata,

The idea for the digital sensor has crossed my mind. Actually i would prefer but i have the problem that the DS18B20 does not reach 150C ( that i what ) and the SMT 160-30 is not available here :(

I guess i will have to use the Vref. and have 2,5V there.

I never used the vref on this chip. Correct me if i'm wrong here:

In the data sheet it's marked Ra2 and RA3 as Vref- and Vref+.

I may use only the Vref+ pin and set the ADCON1 REGISTER (ADDRESS 9Fh) like :

ADCON1=%10100000

And i have to change the code to:

temp= (in */2500)>>2

Is this right ?

Acetronics2
- 19th March 2008, 12:53
Ha,ha,ha ...

I think VENOM might tell you something !!!

Now, this would be much easier to use a NTC Thermistor or a KTY 81-1xx NTC sensor.

Just use a Lookup table with a linear regression between points ... and HOP, in the pocket ( as told the Kangaroo ... )

...

BTW ... choose your "gas" carefully ... lots of degrees to win here !!!

see :

http://www.carburant-modelisme.com/

and

http://www.meccamo.com/fr/indexFR.htm

for really serious blenders ...

Alain

ruijc
- 19th March 2008, 13:01
Acetronics,

you lost me there...

.

Acetronics2
- 19th March 2008, 13:11
Hi, Ruijc

Why ( and where ! ) use a 150 °C range sensor on a model ???

Good question.

Alain

ruijc
- 19th March 2008, 13:20
It's for the engine temp.

The max 120ºC of the DS18B20 is not enough.

I need to be able to read safely up to 140ºC.

I know you will say that the engine cannot reach that temperature unless it's toast, but the real thing is that with 30% nitro they can have peeks of 130ºC/135ºC. Not too good for the engine, it's true, but i need to measure it's peeks to know how the engine is running in mid air ;)

.

Acetronics2
- 19th March 2008, 14:23
...

Do not tell me you didn't know that :

http://www.venom-group.com/print_motion/manuals/racing/VEN-0605_SmartTemp_Instructions.pdf

...

Alain

ruijc
- 19th March 2008, 15:03
Now i see what you mean.

I did not knew this.
Sensor reaches 200ºC ??? wow...and now i undestand why you recomended NTCs.
But this is a failsafe unit.

I know this one instead:
http://www.rcmodels.org/csm/carbsmart.pdf
I believe it's by far the best idea.

Apart from these 2...
My circuit is not like any of these.
It just stores the values, nothing else.

.

Acetronics2
- 19th March 2008, 15:20
Ahhhhh,

CSM !!! I bought one gyro from them ( ICG360 ) Heading "lock" was gently unsteady ( ! )... carefully trimmed parameters for a plane.

and then ... servo got dead-locked to neutral - and no way to reset the gyro parameters !!!

No help from CSG nor ( except buy the new 540 model at a fair price ...)

The sensor ( and its NTC ) is now in my Sensors box !!!

Alain

ruijc
- 19th March 2008, 15:35
Yeah...gyros i only like futaba's my self ;)



And i have to change the code to:

temp= (in */2500)>>2

Is this right ?


how about the code...will this work ok for 2,5V ref?

.

Acetronics2
- 19th March 2008, 16:33
for 10 bits ...

use V ref = 4.096v or 2.048 v ... but not 2.5 v

for 4.096 v you get 1 count for 1 mv
for 2.048 v you get 2 counts for 1 mv input ...

so, your formula ... is really awful !!!

100°C = 1 v ...

with a 2.5 v ref : 1v /2.5 *1024 counts ... 409.6 > 409

409*2500/256 / 4 = 998.5 ...

you will find the good numbers easily !

Alain

Acetronics2
- 20th March 2008, 08:26
Errata !!!


for 10 bits ...

use V ref = 4.096v or 2.048 v ... but not 2.5 v

for 4.096 v you get 1 count for 4 mv
for 2.048 v you get 1 count for 2 mv input ...


Alain

ruijc
- 20th March 2008, 09:10
Thanks Alain ;)

Squibcakes
- 4th July 2008, 01:09
Hey Ace,

The Carbsmart uses a 100K thermistor (supposedly a ntsa0wf104fe1b0). I have a spare and was thinking of using it with a pic to do some temp recordings to see how my temps are going.

I just need some advise on the circuit design. I was going to use a 5V regulator to supply the pic and ref for the thermistor. Also use a 100k resistor as a voltage divider as my analog voltage input to the pic. Is this enough?

Also, the thermistor has a current rating of 0.14ma @25C. Does that mean max current draw through the ntc over the entire temp range or what?

See attached circuit.

ruijc
- 7th July 2008, 11:22
Hi Squibcakes,

Just a question,

Does that thermistor has a linear variation with temperature ?

Where do you get this thermistor ? Any special supplier ?

Thanks

Squibcakes
- 7th July 2008, 12:09
Hi Squibcakes,

Just a question,

Does that thermistor has a linear variation with temperature ?

Suprisingly no it's not that linear. I plugged in the values from the data sheet into excel and created a graph of the curve. It's linear on the higher temps (say 90C +). I wired this up on the bench as per the diagram I posted above and it seems to be working. :) I've seen mention of the LM35 sensor which is linear and has a higher max temp range which I think would be better but finding it hard to source these...



Where do you get this thermistor ? Any special supplier ?

RS sell them pretty cheaply.
http://australia.rs-online.com/web/search/searchBrowseAction.html?method=searchProducts&searchTerm=ntsa0wf104fe1b0


Thanks

ruijc
- 7th July 2008, 12:26
The LM35 is very easy to find. Any local store should have it.

The problem with non linear thermistors is the math.
I dont know how to program in a way that the result is always accurate from the "real life".

The LM35 is linear and accurate and is capable of temps up to 150º. You can easly program and get true results.
For applications as the one you want ( model engines ) , you will need a sensor that can go over 135º.

The only problem i see is to get the package of the LM35 fit inside the engine fins.
You could sandpaper off a bit of the package but you will lose accuracy.

.

Acetronics2
- 7th July 2008, 12:35
Hey Ace,

The Carbsmart uses a 100K thermistor (supposedly a ntsa0wf104fe1b0). I have a spare and was thinking of using it with a pic to do some temp recordings to see how my temps are going.

I just need some advise on the circuit design. I was going to use a 5V regulator to supply the pic and ref for the thermistor. Also use a 100k resistor as a voltage divider as my analog voltage input to the pic. Is this enough?

Also, the thermistor has a current rating of 0.14ma @25C. Does that mean max current draw through the ntc over the entire temp range or what?

See attached circuit.


Hi, Squib

as always ... it relies on what you want to do !

your scheme works fine if you just want to switch a relay ( a home thermostat generally works between 17 and 23 °C !!! ) or run an alarm ... NTCs perfectly can be used on limited temp ranges where you use a linear or 2nd order approx.

now, you also can use a retrive table ( You did it with Excel, it seems ... ) and linearize between points: look at Microchip AN's !!!

The main problem is NTC's often come with 10 or 20% nominal value tolerance ... so, it's not possible to get something precise without any calibration ( my home thermostat or my car temp indicator offer you to correct the read temp by adding or substracting 0 to 5 degrees ... simplest and easiest way !!! )


For your thermistor current rating 0.14 ma ^2 x 100 000 = 2 mW ...

let's suppose it's the maximum current not to disturb the thermistor temp. by self heating !!!



Now, ... once more, the sensor will be chosen from the temp range and the use you will do with the output ...

trying to know a model engine head temp @ +/- 1°C is a nonsense ... as you won't be able to place the sensor very close to the combustion chamber ... you just measure "something indicative ... " and the same measurement, with cold ot hot weather do not show ... not negligible ... temp changes at the "critical" point !!!

Alain