View previous topic :: View next topic |
Author |
Message |
Guest
|
Sensor Voltage Output |
Posted: Wed Aug 08, 2007 8:49 pm |
|
|
I am reading 3 different sensors.
When I use a Lab View Data Acquisition device to read the sensors, I get the following Values:
S1 : 2.41 V; S2: 2.47 V; S3: 2.43 V
When I use a PIC18F to read the sensors, I get the following Values:
S1 : 2.27 V; S2: 2.30 V; S3: 2.28 V
The PIC has a 10 bit A/D, so I multiply the bit count by 0.004887585533
If I print out the bit count from the PIC18F, I can clearly notice that the bit count I obtain is about 20 to 30 bits less than the bit count I would need to get values similar to what I am getting when I use LAB View DAQ to read the sensors.
I have also implemented the header that forces the PIC to use a 10 bit A/D converter.
Would anyone know why I am facing this problem |
|
|
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
|
Posted: Wed Aug 08, 2007 9:07 pm |
|
|
How many bits is the NIDAQ accurate to and what is the overall error of the PIC DACs? |
|
|
Ttelmah Guest
|
|
Posted: Thu Aug 09, 2007 5:21 am |
|
|
Your biggest limitation will be with the accuracy of the reference. The figure you have, suggests that you are using 5v, and this is unlikely to be a good reference. Also, you make the very common error, of dividing the Vref voltage by 1023. On the PIC, the ADC, switches to it's maximum count, one step 'below' the reference voltage. This differs from some other designs of ADC. Hence the step size on the PIC requires you to divide by 1024, not 1023. This will give slightly higher results (but not much).
Using a high accuracy Vref, the AD on the PIC, can give repeatable accuracies (using sleep during sampling), to within about 1 bit.
Best Wishes |
|
|
Guest
|
|
Posted: Thu Aug 09, 2007 5:51 am |
|
|
How would I use a High Accuracy Vref. |
|
|
Guest
|
|
Posted: Thu Aug 09, 2007 6:18 am |
|
|
This is in continuation to my previous post. I cannot change anything in the hardware. Is there anything I can do in my code to use a High Accuracy Vref. |
|
|
jfk1965
Joined: 21 Oct 2003 Posts: 58
|
|
Posted: Thu Aug 09, 2007 6:49 am |
|
|
If your hardware is setup to use Vcc as the Ref then i'm afraid your stuck with it. A high accuracy Vref will require hardware changes.
Try to get as tight a tolerance Regulator that supplies the PIC 1 or 2 % one's are available.
JFK |
|
|
Guest
|
|
Posted: Thu Aug 09, 2007 7:33 am |
|
|
I wanted to know if I multiply the bit count by a higher number instead of 0 .0048828. For instance if I multiply the value by 0.005; Will that be a reliable solution! |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Thu Aug 09, 2007 8:52 am |
|
|
Check to see if you have a scale problem, or an offset problem, by measuring two widely different voltages. Also see how much your readings change with temperature. Decide if you can live with the temperature drift or need to compensate. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Thu Aug 09, 2007 1:54 pm |
|
|
Have you used a multimeter to verify the readings? Might be your NI DAQ thats busted. Also might be you have .15V drop on a wire thats not being measured. |
|
|
|