Convert Kelvin to Fahrenheit

Questions on other types of hardware and getting it talking to the ARM CPU
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Convert Kelvin to Fahrenheit

Post by YahooArchive »

I've got some of these neat LM335ZNS heat sensors that change
10 mv per degree Kelvin (very linear).

At room temperature, they put out about 3 volts, But can go up to
around 4V with added heat. (Using a 3.7K pull-up to 5V).

(For my project, I would like to monitor a -20 F to +230 F temperature range).


So, to make the sensors work with a 3.3V ArmMite, I've used two 4.7K resistors
to divide my 3 volts in half. I'm seeing about 1.5V on the analog inputs.

Anyways, converting Kelvin to Fahrenheit in Coridium basic might
be too big a task for me, since I was spoiled as a child by floating point. ;)

I wonder if there is any sample code around for this kind of task?

Thanks for any comments..

Cheers,
Rich



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Convert Kelvin to Fahrenheit

Post by YahooArchive »

> I've got some of these neat LM335ZNS heat sensors that change
> 10 mv per degree Kelvin (very linear).
> (For my project, I would like to monitor a -20 F to +230 F temperature range).
>
> So, to make the sensors work with a 3.3V ArmMite, I've used two 4.7K resistors
> to divide my 3 volts in half. I'm seeing about 1.5V on the analog inputs.

While you could do it this way, you measurement range will be 1.5 to 2V (not
very big -- at best you'll get about 7 bits of accuracy). Alternatives would be
to amplify and shift the signal, easily done with op amps. But for temp
measurements, I'd recommend an LM75. Basically it will do the range you want
with better accuracy.

> Anyways, converting Kelvin to Fahrenheit in Coridium basic might
> be too big a task for me, since I was spoiled as a child by floating point. ;)

Lets say you do it with the A/D, and the resistor divider

5mv/degreeK

For ease lets say you measure $8000 (1.65V)

3.3V * $8000/$10000 = 1650 mV

1650 mV / 5mv = 330K = 57C

F = C * 9/5 + 32

makes the temp 134.6F

So how to do this without floating point (note you're starting with a 10 bit
integer in the A/D -- shifted right by 6 bits)

BASIC now has floating point so this is pretty straight forward now.

Post Reply