Page 1 of 1

Thermometer & ADC

Posted: Tue Jul 21, 2009 7:15 pm
by bodexchrist
Hello,

I am quite new to programming with flowcode,can somebody write a flowcode program that uses ADC to control temperature and how do i go about it.

Thanks.

Re: Thermometer & ADC

Posted: Wed Jul 22, 2009 8:58 am
by Benj
Hello

If you are wanting to read an analogue value from a thermistor and disply the temperature in degrees then the easiest way is to use a look up table.

Basically the incoming analogue voltage is converted into an 8-bit number 0-255.

This 0-255 can be used as the index for an array of results.

For example if you know that when you read 56 on the ADC this gives you 12.5 degrees then in array location 56 you would store the following.

whole_array[56] = 12
real_array[56] = 50

Sean has written an article on how to do this and it is available from here.
http://www.matrixmultimedia.com/mmforum ... =26&t=4869

Re: Thermometer & ADC

Posted: Wed Jul 22, 2009 10:20 am
by bodexchrist
Thanks Benj i got the idea now.

Re: Thermometer & ADC

Posted: Thu Sep 02, 2010 1:46 am
by RobOnk
I,m working on the digital thermometer project, but instead of using an NTC I'm using a temperature sensor (lm34DZ).
Works ok except that the output from the temp sensor seems to be very erratic. ie. varying by 5-6 degrees for no apparent reason.

The sensor output change as per temp change is 10mV/degrees F (yes Fahrenheit).

Thanks, Rob

Re: Thermometer & ADC

Posted: Fri Sep 03, 2010 9:04 am
by Sean
The low output voltage of the LM34 can lead to problems with the resolution of the microcontroller ADCs and the calculations performed on the results.

A 5V ADC performing an 8-bit conversion has a resolution of 20mV, or 5mV from a 10-bit conversion. Integer calculations may also introduce further rounding errors.

If possible, an op-amp circuit should be used to match the expected operating range of the signal to the ADC conversion range. In some cases it is possible to re-order calculations to avoid rounding errors.

Re: Thermometer & ADC

Posted: Sun Sep 05, 2010 5:29 pm
by Dan81
Hello Rob

For the same price (but not the same package) you can use a digital device : MCP9800 (or DS1631 more expensive, or others manufacturers ).
There is no calculation to do, only a I2C bus to manage. There are also SPI devices.

Good luck

Daniel