CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Sensor Voltage Output

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








Sensor Voltage Output
PostPosted: Wed Aug 08, 2007 8:49 pm     Reply with quote

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 Sad
bwhiten



Joined: 26 Nov 2003
Posts: 151
Location: Grayson, GA

View user's profile Send private message

PostPosted: Wed Aug 08, 2007 9:07 pm     Reply with quote

How many bits is the NIDAQ accurate to and what is the overall error of the PIC DACs?
Ttelmah
Guest







PostPosted: Thu Aug 09, 2007 5:21 am     Reply with quote

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








PostPosted: Thu Aug 09, 2007 5:51 am     Reply with quote

How would I use a High Accuracy Vref.
Guest








PostPosted: Thu Aug 09, 2007 6:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 09, 2007 6:49 am     Reply with quote

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








PostPosted: Thu Aug 09, 2007 7:33 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 09, 2007 8:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 09, 2007 1:54 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group