Current sensor output modification. PIC or opamp or something else?


Results 1 to 10 of 10

Threaded View

  1. #8
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Current sensor output modification. PIC or opamp or something else?

    Back to the original challenge, I'd do it in software:
    Code:
    IF ADC > 127 THEN  ;Assuming 8-bit ADC
      ADC_VAL = (ADC * 4) / 5  ;Yields 80% of value
    ENDIF
    The above snippet will deliver <128 results as soon as ADC > 128. I don't think that's what you want. So we have to add a filter:
    Code:
    IF ADC > 127 THEN  ;Assuming 8-bit ADC
      B0 = ADC - 127  ;Use a temporary variable to determine how much above 128 our result is
      B1 = (B0 * 4) / 5  ;Get 80% of only the amount > 128
      ADC_VAL = B1 + 128  ;Yields mid-point + 80% of overage
    ENDIF
    Last edited by mpgmike; - 10th December 2020 at 05:27.

Similar Threads

  1. How can I get a PIC to switch 2.5V DC to my Opamp pin?
    By HankMcSpank in forum Schematics
    Replies: 4
    Last Post: - 9th January 2010, 22:04
  2. Output current to a DC motor
    By bigbanner in forum General
    Replies: 1
    Last Post: - 6th April 2009, 07:29
  3. current sensor interfacing
    By hell_pk in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th January 2009, 04:55
  4. PIC based mAh meter/current draw sensor
    By skimask in forum Off Topic
    Replies: 6
    Last Post: - 26th February 2008, 02:10
  5. Suggestions for Boosting Current Output?
    By RossW in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd June 2005, 02:35

Members who have read this thread : 1

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