Another idea if you do not want the extra hardware and will give up a little bit of resolution.
I had the same problem in the past, using a LM34 and a pressure sensor with an output of 1 to 5 volt = 0 psi to MAX. Left the VREF at VDD. OK for the pressure sensor, took the ADC value from the LM34 *2. This gave a 2 degree resolution for the temperature though, and I can not remember but I think the ice water test was off a degree or two also.
Not perfect but the pressure was the critical thing on that application.
Dave
Always wear safety glasses while programming.
Thanks for the reply everyone.
I am not very concerned about using extra hardware as much as I am about the accurate readings from the sensor. If I use separate external A/D chip for each sensor would this allow me the freedom to select the suitable Vref for the various sensors or will I still be restricted to choosing one Vref?
Lets say I use an external A/D Chip this means that I can use different Vref for each sensor. Now what Vref do I choose for the PIC18F6520. Do I simply use Vref = 5V? This is where I am getting confused. Can you please help me. any suggestion is greatly appreciated. Thanks
-Srig
If I am going to be using an External ADC for each sensor, then I guess do not have to connect a voltage to Vref for the PIC18F6520.
For example, If I choose the LM34 and connect this device to an external 8 bit ADC. What type of data will I be getting from the ADC, and how will I be able to decifer it on the PIC side?
Using an external ADC.
Make all of the IO's digital.
This may get me in trouble but I am going to refer you to a Basic Stamp document.
http://www.parallax.com/dl/docs/books/edu/ic.pdf
Goto the section "Experiment #4: Continuous Process Control"
The Basic Stamp is built around a PIC but does not have ADC. The code is close enough to understand what is going on.
The above "Experiment #4: Continuous Process Control" is using a LM34 and a n ADC 0831.
If I told you how to do it, it would just be the same thing as in the document, almost. There are other good ideas there too.
Dave
Always wear safety glasses while programming.
Bookmarks