![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| How low Vref can a PIC use without sacrificing accuracy? Wich method should I use to read a signal from ex. LM35, wich give 10mV pr. deg. Celsius --> approx. 250 mV for room temperature. Generally, to convert a low voltage signal, should I attenuate the reference, or should I amplify the signal? At the moment I'm using a 16F684 reading a LM35, with just a normal diode as a 0,7 V reference to the Vref pin. Displaying the result on a LCD. No particulary project really, just fiddling on the lab to learn more. I have two different voltage reference circuits at hand; TL431 and LM385-2,5 . Both giving 2,5 V reference. I'm thinking of dividing the voltage with two resistors, then feeding the Vref pin. Are there any max/min values for the resistors I should be aware of? Any minimum impedance for the Vref, as for the A/D input? Btw. How do I get the degree character on the LCD? The "little o" in degrees Celsius. | |
| |
| | (permalink) |
| Use an opamp to amplify the output of the LM35 - you can't use the Vref like that - use a TL341 (or similar) for Vref, and scale the input accordingly (with either opamps or attenuators). | |
| |
| | (permalink) |
| hi, The nearest ready made 'deg' symbol in the controller is character DFh. Also you have the option to create your own symbols IIRC , 8 symbols. If you want to use the LM35 you will get better results if you amplify the output of the LM35, by a factor of about *5 and use the full 10 bits. Use the PICs internal default +5Vref. The PIC data sheets usually quote a +Vref minimum of +2.5V.
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| |
| | (permalink) | ||
| Quote:
Quote:
I'm not so keen on using Vdd as reference, as I think it varies to much. I usually feed the PIC from a 7805. Their voltage varies often +/- 0,1 V The one I'm using now is 4,924 V That's 1,5% error. Maybe not that bad, but I prefer a "real" reference. The 16F684 can use Vdd from 2,0 - 5,5 V. Guess it means less than full accuracy on the A/D when run at 2 V? I will hook up an opamp to the LM35 and test. I'm using the full 10 bits, btw. Working with PICC lite. Biggest concern now is that I've already used 94% of the code space, just to read a temp. sensor and displaying the value on a LCD For the record: I'm actually using a diode now, as a 0,7 V reference, and it works. So I know it can be done, but with reduced accuracy I guess. | |||
| |
| | (permalink) | ||
| Quote:
Quote:
| |||
| |
| | (permalink) | ||
| Quote:
Quote:
I'm so lucky that I have the C18 compiler from Microchip at work. I will use it at a later point. Have some 18-series PICs as well. For my hobby use, it doesen't matter if the price is a bit higher. I started out with 16C84 and assembler, must be close to ten years ago. Never believed I would be even close to spending all the code space in a PIC. I've learned a lot from your site btw. Got my first program for LCD there, and copy and pasted a lot from the different tutorials. Can't remember how much space it took with assembler to do the same, but I think 5 or 10% maybe. So thanks a lot for that nice site of yours! | |||
| |
| | (permalink) |
| hi odin, The basic range of the LM35 is +2 thru +150 degC, this relates to 0mV thru +1.5Vout. With a +5Vref, the ADC value is (1.5/5)* 1023 =306.9, which is an ADC value of about 2/degC, so the best resolution is about 0.5degC. With a +2.5Vref its an ADC value range of 613.8, which is about 4/degC, so the best resolution is about 0.25degC. I would suggest that you decide over what range temperatures you want to measure. If its say, a domestic/house room, I would limit my tempr range to say 0degC thru 50degC, which is a LM35 Vout range of 0 thru +0.5V. Use a +2.5Vref and amplify the LM35 output by about *5, [+2.5V max], this will give an ADC value of about 20/degC, which can be processed to give a tempr resolution of 0.1degC. But remember the stated non-linearity of the LM35 is +/-0.25degC. I have found that some PIC's will work at lower than their recommended Vref min, but others of the same type will not, its best to stay within the recommended Vref if you require consistant results from one PIC to another. If you make the amplifier gain adjustable, you will be able to normalise the ADC value to the tempr in degC, this will simplify the program. Hope this helps.
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| |
| | (permalink) |
| I've seen schematics using an LM335 (kelvin) as 0C is 2.73 Volts, just moves the offset and you can read -C with ease. http://www.ontrak.net/LM335.htm | |
| |
| | (permalink) |
| Hey guys, wouldn't a 2.56 volt reference actually be better than a 2.50 volt reference? With 10 bit resolution that works out to exactly 2.5 millivolts per step (1024 steps) instead of 2.4414025 millivolts per step. | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) | |
| Quote:
I suggested the same thing just last week in this thread. Mike. | ||
| |
| | (permalink) | |
| Quote:
You appear to be missing the point though?, using a 2.56V reference is no different to using a 2.5V one - you simply adjust the input attenuator so the output of the A2D reads exactly correct, no maths required, EXACTLY the same as using a 2.56V reference. As it would be VERY unusual not to have some kind of input processing, and probably an adjustment, it completely negates the need for a 2.56V reference. BTW - all of this discussion is wrong anyway | ||
| |
| | (permalink) |
| LOL, use a DS18S20 and forget the analog stuff. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Analog Meter | windozeuser | General Electronics Chat | 19 | 3rd October 2007 03:44 PM |