PIC 16f877 A/D conversion Allegro ACS712


Results 1 to 33 of 33

Threaded View

  1. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    DavyJones ...
    Sorry ... but that one gets sent to the "Locker".

    Yup, we were talking about an ACS712 from Allegro in that thread.
    But, hell_pk had also specified 10-bit A/D with a 2.61V VREF-.
    You seem to be using 8-bit A/D without a reference, so yes, things are going to be different ...

    With VREF+ = 5V, and VREF- = 0V, at 8-bit ... each A/D step is 0.0196V. (5 / 255)

    The ACS712 idles at 2.5V, and with 8-bit resolution that's an A/D reading of 127.

    And assuming you are using the default 66mv/A sensitivity, the formula looks like this ...

    (ADvalue - 127) * 196 / 66

    Which should give 1 decimal of precision ... 10.0amps = 100
    With quite a bit of integer truncation due to the 8-bit resolution.<hr>
    ADD:
    That only works with positive currents, so to make sure it never sees negative numbers, you can add this before the formula to limit the A/D values ...

    ADvalue = ADvalue MAX 127

    hth,
    Last edited by Darrel Taylor; - 2nd August 2009 at 08:20. Reason: ADD:
    DT

Similar Threads

  1. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 02:48
  2. A/D conversion problem in 18F2520, 2523, 2550 etc.
    By selimkara in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 10th March 2008, 17:26
  3. 16f877 A/D help
    By 3adam in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th January 2008, 05:06
  4. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 19:57
  5. Strange A/D conversion...
    By Christos_K in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th June 2005, 02:35

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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