Battery monitoring - ever tried AN1072?


Closed Thread
Results 1 to 40 of 57

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default the maths and the proof the system works

    Yes George,

    For any reason, either ADCON1.ADCS setting will affect the results.

    For those interested in the maths (where "2n" is 1024 because I use 10bits in ADC):
    Name:  2015-09-30 21_43_57-Clipboard.png
Views: 352
Size:  25.0 KB

    Regarding my results and comparing them to the table A-1 (Appendix A: AC Result Table in AN1072), something must be wrong.

    A 135 ADC result corresponds to 4,52V and 147 to 4,16V (?!).

    Grrrrrr! I didn't notice I hadn't removed the voltage regulator on my breadboard. My PICkit2 programmer delivers 4,78VDC (even if it shows 5V in the "VDD PICkit2" field) so the "new" ADC values I get now seem to be much closer to what they are supposed to be "on the paper".

    For 4,82V displayed on my FLUKE87, the ADC result is now 127 (exact as table A-1) and @4,31V I get 142 (exact as table A-1).

    ((1024 - 1) / 4,82) * 0,6 = 127 and ((1024 - 1) / 4,31) * 0,6 = 142
    Roger

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default Re: the maths and the proof the system works

    Glad you did it Roger! Bravo!

    Ioannis

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: the maths and the proof the system works

    For any reason, either ADCON1.ADCS setting will affect the results.
    I don't know the internals of ADCIN, but unless it sets the ADCS bits to something else, you're ADC clock source will be Fosc/2 which at 8Mhz will give a Tad of 250ns. Fosc/16 or Fosc/32 are recommended.

    George

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default Re: the maths and the proof the system works

    George, If you do not want any headaches, just use the Frc. The internal 500Khz clock is good enough for most applications.

    Plus, you do not worry for any timing violations.

    Ioannis

Similar Threads

  1. Battery voltage monitoring for use on 16F1825
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 23rd April 2013, 14:57
  2. Replies: 13
    Last Post: - 22nd January 2012, 04:48
  3. ADCIN car battery monitoring
    By mitchf14 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 29th June 2008, 08:04
  4. 12v car battery monitoring
    By oldcarguy85 in forum Schematics
    Replies: 2
    Last Post: - 10th December 2007, 00:26
  5. Using the A/D for Monitoring a Solor Cell and Battery
    By chuck.sieveking in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 13th July 2004, 19:27

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts