How to measure Current with a Pic


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2009
    Posts
    16

    Default How to measure Current with a Pic

    I have a vairaible speed contoller that I would like to measure the current load on the unit. The load can be between 0 and 20 amps. I would like to be able to monitor the current in to the PIC. If the load get to high, I would shut the ouput down. Can anyone suggest a circuit to measure current?

    Thanks,

    Terry

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tallen View Post
    I have a vairaible speed contoller that I would like to measure the current load on the unit. The load can be between 0 and 20 amps. I would like to be able to monitor the current in to the PIC. If the load get to high, I would shut the ouput down. Can anyone suggest a circuit to measure current?

    Thanks,

    Terry
    You can use a shunt resistor in series with the load and measure the voltage across the resistor using ADC. Just make sure that you don't fry the PIC .

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Allegro make some really good current sensors which look like a TO-220 style case with built in shunt. Cant think of the part number at the mo but I've used in the past and work well up to 60amps.

  4. #4
    Join Date
    Aug 2010
    Location
    Chiang Mai University, Thailand
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Squibcakes View Post
    Allegro make some really good current sensors which look like a TO-220 style case with built in shunt. Cant think of the part number at the mo but I've used in the past and work well up to 60amps.
    Those are hall effect current sensors and cost around $10.00. The advantage is that it fully isolates the PIC from the current source and in the case of a motor that will be important due to back EMF. The other advantage is that there is very little power loss as opposed to using a series shunt resistor.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi,

    If it is only an overload protection ...

    I generally use the output stage Mosfet RdsON as the shunt ...

    just use a BS170 to connect the Drain to a comparator ONLY when Power mosfet gate powered. ( one 4066 gate could do it too, but ... ???)

    sooooo simple ...

    Alain

    PS ; and like that ???
    Attached Images Attached Images  
    Last edited by Acetronics2; - 17th August 2010 at 15:08.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Aug 2009
    Posts
    16


    Did you find this post helpful? Yes | No

    Default How to measure Current with a Pic

    I guess I don't fully understand this concept. If I have a load of 20 amps then with a .1 ohm series resistor that would be about 2V at 40 Watts. I guess I'm missing something simple.

    The $10 part would be too expensive to add to this board. I was hoping for $3 or $4.

    Thanks,

    Terry

  7. #7
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Squibcakes View Post
    Allegro make some really good current sensors which look like a TO-220 style case with built in shunt. Cant think of the part number at the mo but I've used in the past and work well up to 60amps.
    Just following up .. here is link to what i used (although it has been replaced by newer part.. http://www.allegromicro.com/en/Produ...0756/index.asp

  8. #8
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I am working on a project in which we are using a LMP8601. This part converts the current through a shunt resistor to a voltage that can then be measured by your PIC's A/D converter, or in our case, we are feeding the output to a window comparator for a "go-no go" digital output that goes directly to a PIC i/o pin. This part is available from both Mouser and Digikey I believe. The theory is explained pretty well in the datasheet.
    Attached Images Attached Images

  9. #9
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    The key to your request is the following (imho):
    The load can be between 0 and 20 amps. I would like to be able to monitor the current in to the PIC.
    If you want to monitor current from 0 to 20A (both ends inclusive), then the Allegro parts are probably best.

    However, if all you need is to set a reasonable trip point (e.g.) 10A at which an overcurrent signal trips; then a sense resistor followed by some form of a comparator is probably easiest and less expensive. We have normally used something like the LT1787 with multiple parallel power-rated 0.1ohms or less sense resistors. The power rating will depend on how many sense resistors are in parallel, how much margin you deem necessary above your maximum current.

  10. #10
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I'm a fan of the Allegro devices. So much simpler than dealing with low-value shunt resistors. Isolated too. Unless you have a pretty good understanding of analog, just use an Allegro. Up to 30A in an SO-8 package. The offset from zero is about 10% of the supply and the output is linear - 133mV/Amp.
    Charles Linquist

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