Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/26/09 11:21
Read: times


 
#171191 - You must convert raw ADC reading into temperature
Responding to: ???'s previous message
Yash Chitalia said:
I changed the ADC and it's working now!I guess the ADC chip was already damaged when I bought it. Or maybe I'd blown it up in my initial tests.But since the ADC was sending me an INTR signal,I believed it must be working and was apprehensive about changing it (also because the cost of the ADC was pretty high!)

So the lesson to learn is to never remove VCC from a chip when you feed voltages to some other pins unless the datasheet for the chip explicitly says that it is ok. Most datasheets tend to say that input pins may not have voltages higher than 0.3V above VCC. 5V on an input and 0V on VCC is way, way, way above that figure.

Yash Chitalia said:
The output of the ADC is changing with temperature. However, the LCD shows 43 degrees celcius when the actual temperature here in Mumbai is 30 degrees. Is this error allowed? Also, how do I adjust the circuit or the code to make the temperature error-free?

No measuring circuit is ever error free. The reason why we pay thousands of dollars on instruments is to get instruments where the errors are slightly less than for cheaper instruments.

But the ADC is nothing but an ADC. To measure temperature, you need a temperature sensor. And unless that sensor emits a voltage within the range supported by the ADC, you will need electronics to interface the sensor with the ADC. What sensor do you use, and how have you interfaced it?


Yash Chitalia said:
Another problem I was having with my ADC 0804 was displaying the temperature
as a floating point number and not an integer. How do I achieve this in the ADC 0848?

You don't. The ADC is nothing but an ADC. It will produce an integer value - a number without unit. It is then up to your software to convert the raw ADC value into a temperature value. If the temperature probe is linear, you will need to multiply with a scaling factor and add a zero-adjust offset. If the probe isn't linear, then you will have to find an equation that converts from the nonlinear value into a linear temperature. Or you will have to perform measures for a large number of temperatures and create a piece-wise lookup table where you perform linear interpolations for the conversion. When you have converted the number from the unit-less ADC value into a temperature, you will have to perform the next step, where you convert the temperature into digits, with - or without - a decimal.

Remember that the decimal is just something virtual. If you have a temperature 10.3C and multiply the value by 10, you will get 103 - a number without a decimal point. So you can perform your calculations with integers, and just remember that the lowest digit of your scaled temperature isn't one-degree steps but 0.1 degree steps. Then it is easy to emit the individual digits to the display.

Yash Chitalia said:
Can you suggest some other 8 channel ADC which wouldn't be so heavy on the wallet?

In some situations, the cheapest solution may be to select a processor with integrated ADC of required specification. A problem is that we don't know about prices and availability of processors or external ADC where you live.


List of 18 messages in thread
TopicAuthorDate
Receiving output from ADC0848.            01/01/70 00:00      
   Don't feed other pins without VCC            01/01/70 00:00      
      CS and RD working.            01/01/70 00:00      
         Wrong understanding of ADC!            01/01/70 00:00      
            But according to Mazidi...            01/01/70 00:00      
               No, you don't!            01/01/70 00:00      
                  Sorry!            01/01/70 00:00      
                     How do you see that?            01/01/70 00:00      
                        The LCD shows a 255.            01/01/70 00:00      
                           But this can have zillions of reasons...            01/01/70 00:00      
                     Never retype source code when posting            01/01/70 00:00      
                        Working! But with errors...            01/01/70 00:00      
                           You must convert raw ADC reading into temperature            01/01/70 00:00      
                           Self-heating?            01/01/70 00:00      
   Configured as push-pull?            01/01/70 00:00      
      It's a P89v51RD2            01/01/70 00:00      
         Difference only noticeable if contention            01/01/70 00:00      
         then STOP what you are doing            01/01/70 00:00      

Back to Subject List