I want to build a data logger, so i have a question about voltage references.
For my analogue inputs - do i connect the reference voltage to all my sensors and to the VREF+ chip on my pic processor?
I have wrote the code and it works well, i just want it to be a bit more accurate (I have been using the internal connections to vss and vdd thus far)
The thing is that ive never used a voltage reference before, could someone point me to an example of how to use an external voltage reference for say 2 analogue inputs to a pic.
A voltage reference is simply an accurate voltage generated by a temperature stable Zener or a voltage reference IC. You use it wherever you are doing accurate voltage measurements. In your case I would assume you would connect it to any sensors that are sensitive to voltage and also to the VREF on you pic.
Be aware that most reference sources have a limited current capability so you have to make sure your total load doesn't exceed that value.
thanks for your reply, i think your point about current sourcing is what i was getting at, eg could i use just the voltage reference for all my sensors.
What current capability are we looking at for a typical voltage reference chip - and could you suggest one - i expect that i will be using all the available channels on my 16f777.
what is the formula to calculate the current draw in a potential divider? and would i need any kind of resistor to limit current going to the adc channel of the pic.
just now i have one leg of my pot connected to v+ (5v), one to gnd and the wiper connected to the adc - would this still be the same with the vref (only using the vref instead of the v+.
Hi,
for getting accurate results, an ic voltage reference will be a better option, lots of them are available in various ranges (check out the Analog Devices and Maxim websites, for example)
Refer to the datasheets for selecting capacitors to be used with the reference generating ic, to keep the output stable in presence of noise.
Usually, the voltage reference ic outputs are very low current, hence, it's advisable not to use them as supply for other components on the board as they may add-up noise in the reference level.
One reference ic is sufficient for all the channels of a microcontroller ADC. And u need not connect any resistor there to limit the current..
The Voltage Reference is 4.096V and the PIC supply voltage is 5v.
I chose this one for easy maths, as its 10bit ADC, therefore 1024 possible values, or 0.004 volts between each division.
I tried looking at the pic datasheet (im a hobbiest, so not up on the technical stuff) but couldnt find a preffered value, will any value under 10K be fine, or is there a particular value that will be best for the pots.
The Voltage Reference is 4.096V and the PIC supply voltage is 5v.
I chose this one for easy maths, as its 10bit ADC, therefore 1024 possible values, or 0.004 volts between each division.
I tried looking at the pic datasheet (im a hobbiest, so not up on the technical stuff) but couldnt find a preffered value, will any value under 10K be fine, or is there a particular value that will be best for the pots.
i did, but it said that i required lots of bits that i dont have at the moment. Very good tutorials though - I will need to collect all the bits and work my way through them.
i did, but it said that i required lots of bits that i dont have at the moment. Very good tutorials though - I will need to collect all the bits and work my way through them.
The Voltage Reference is 4.096V and the PIC supply voltage is 5v.
I chose this one for easy maths, as its 10bit ADC, therefore 1024 possible values, or 0.004 volts between each division.
I tried looking at the pic datasheet (im a hobbiest, so not up on the technical stuff) but couldnt find a preffered value, will any value under 10K be fine, or is there a particular value that will be best for the pots.
Another thing to consider is the scaling of the result - which again I cover in my tutorial - basically you don't want to scale at all (apart from a decimal point), which is why the tutorial is designed to measure 0V-10.23V and not anything else.
Scaling it is simple, but means you don't get a smooth change of the least significant digit. For example, if you scaled by two (to give 0V-20.46V) the last digit would only display even values, 0, 2, 4 etc. Personally I find that objectionable, so choose 10.23V range to prevent it, and it still gives you 10mV resolution (roughly 0.1%).
Some PIC's have 14 analogue inputs anyway (just happened to notice while looking at 18F series chips), so 14 buffer amplifiers could be connected to one PIC - or, as you say, switch them to a smaller number of inputs.
BTW: conventionally circuits are drawn the other around, input on the leftside.
My fault - but it's not like it's a conventional circuit with an in and out, it's was added on to a previous tutorial board, which is why it's that way.
EDIT: I also prefer the 1023 scaling when using the LM35/OPA to give 0 thru 102.3Cdeg