Current Meter


Closed Thread
Results 1 to 17 of 17

Thread: Current Meter

  1. #1
    mikefox's Avatar
    mikefox Guest

    Default Current Meter

    Hi guys,

    I need to ask for a little help, I'm building a current meter for a client, and I'm having difficulty working something out.
    I am using a 16F877A with ADC channels 0 to 2 used to measure voltage and current, this all works fine, what I'm having trouble with is calculating current drawn over a period of hours, measured in amp-hour. The idea for this is to show the total current in or out of the system in a day.

    Please, if anyone can help, I could use any tips you might have.

    Mike

  2. #2
    Join Date
    Oct 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default Did something similar

    a long time ago in a PC. I basically took an amp reading every second and added 1/3600th of the reading to a register. Basically integrating the amps to get amp hours. Seems like you could do something similar, with different math order, in the PIC.

  3. #3
    mikefox's Avatar
    mikefox Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks mate, this code seems to do the job.

    avg_curr1 = avg_curr1 + (curr0 / 10)
    avg_curr0 = avg_curr1 / 3600

    Mike

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


    Did you find this post helpful? Yes | No

    Cool Battery Load tester

    This sounds like something I could use....

    I wouldn't mind replacing the old analog current / volt meter in my 30amp load tester with a digital version, including aHr Capacity.

    The current shunt we have produces 50mv max at full load (50amp)

    How could this be measured using a pic.. (Use op amp???) of sort?

    I would like to know if anyone else has done this before.

    On an other topic, has anybody made their own wire wound resistors before?

    Cheers

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


    Did you find this post helpful? Yes | No

    Default Current meter

    I have built several current meters using Allegro hall-effect sensors. They offer perfect isolation and have no voltage drop. Depending on the model, they have an output of 20-133 mv/Amp. When measuring DC current, I usually use a rail-to-rail op amp to shift the output to near zero volts (the quiescent output voltage of the sensor is VCC/2) and amplify the output a bit before feeding it into the A/D converter.

    Fantastic devices, very accurate and stable. Much neater than using sense resistors.

  6. #6
    MikeTamu's Avatar
    MikeTamu Guest


    Did you find this post helpful? Yes | No

    Default

    I have used the Maxim 4172 Current Sense chip and found it to be very easy to impliment and precise.

    http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1654

  7. #7
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Need also to measure current, but on HV line..

    Hi All,

    i also need to measure some current but on a HV supply, with about 500V DC above ground. Current can flow in both direction, negative and positive with a max of 50 mA.

    Any idea how i can do this in a safe way ??

    Thanks for any feedback.

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


    Did you find this post helpful? Yes | No

    Default

    Wow, those Allegro Hall Sensors look really good. I have order a couple to test them out.

    As for measuring the HV supply, I've only ever used a HV probe connected to a DVM. Sorry, no other idea how to do that.

    Cheers

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


    Did you find this post helpful? Yes | No

    Default

    I have used the Allegro Hall-effect sensors extensively. Bi-directional, great isolation. Good accuracy.

  10. #10
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Allegro sensor ...

    Hi all,

    I looked the datasheet of the ACS704 which is the smallest device by Allegro (+/- 5A) and it shows a 133mV/A sensitivity.
    I think it's a bit low for measuring 50 mA max scale....

    An application note for the MAX4172 in a amplified high voltage sensor gives 10mV/mA, which seems to be more adequate, but unfortunately it's not bidirectionnal !

    Other possibility is to use an amplified Hall effect sensor, but it needs an ground insolated low voltage supply on the sensor side, which is another problem !

    Still looking for the right solution....

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


    Did you find this post helpful? Yes | No

    Wink HV = Opto-insulation ...

    Hi, TK5

    The best for that voltage levels ( !!! ) is to use a little shunt, an AOP and a V/F converter, then drive an opto-isolator or better an opto-fiber coupler ... remember only CNY21 like HV optocouplers are safe, here ...

    on the other side Freq = Current, so it's easy for a PIC to display that !!!

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  12. #12
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Yes, but ....

    Hi Alain,

    Maybe.... but the name problem is to insulate all the circuit from the high voltage side. The OPamp has to be supplied on this HV side, so you need low voltage supply which MUST be HV insulated.

    Maybe the Alegro can be adequate if its output is amplified to a level that can be handled by the PIC?

    Corsican greetings ...

    Quote Originally Posted by Acetronics
    Hi, TK5

    The best for that voltage levels ( !!! ) is to use a little shunt, an AOP and a V/F converter, then drive an opto-isolator or better an opto-fiber coupler ... remember only CNY21 like HV optocouplers are safe, here ...

    on the other side Freq = Current, so it's easy for a PIC to display that !!!

    Alain

  13. #13
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default I use a piece of wire and an OP-AMP

    Hi there,

    Sorry to catch this thread late. I manufacture series of PIC controlled thyristor based battery charger. For low cost designs I use a piece of wire acting as a shunt in the negative line and then a LM358 for the amplification. It is safe to use it in a HV line also as long as it is referenced to ground. You can use a programmable gain IA like AD620 for your differential measurement needs and couple it to a linear optocoupler like the Vishay IL300. This gives far accurate results than the V/F approach and is cheaper. The only problem is you need another supply. Consider using the IRF PVI series of optos to make a 5ma supply isolated DC-DC converter as well as linear output opto. Maxim has got a very good appnote on high side current measurement (1KV).

    Whew! Enough gyans...

    If you could post a specific issue with detailed electrical parameter then I might find something on my Hard drive.

    BTW I always use a PIC with 10bits res. If thats enough then go on.

    Regards

    Sougata

  14. #14
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Current measure

    Hi Sougata,

    Thanks for the ideas, my wish is to use no different supply on the HV side to supply the amplifier.
    I attached a GIF with the principle of the supply. You see that the supplies are not referenced to ground but to cathode of the tube.
    For the 350 V, i could make my measure on the grounded side of the supply, current can flow in both directions with max 50 mA.
    The 3500V HV will draw about 800-900 mA.
    The 36V only a few mA.

    Greetings,

    Quote Originally Posted by sougata
    Hi there,

    Sorry to catch this thread late. I manufacture series of PIC controlled thyristor based battery charger. For low cost designs I use a piece of wire acting as a shunt in the negative line and then a LM358 for the amplification. It is safe to use it in a HV line also as long as it is referenced to ground. You can use a programmable gain IA like AD620 for your differential measurement needs and couple it to a linear optocoupler like the Vishay IL300. This gives far accurate results than the V/F approach and is cheaper. The only problem is you need another supply. Consider using the IRF PVI series of optos to make a 5ma supply isolated DC-DC converter as well as linear output opto. Maxim has got a very good appnote on high side current measurement (1KV).

    Whew! Enough gyans...

    If you could post a specific issue with detailed electrical parameter then I might find something on my Hard drive.

    BTW I always use a PIC with 10bits res. If thats enough then go on.

    Regards

    Sougata
    Attached Images Attached Images  

  15. #15
    Join Date
    Sep 2005
    Location
    delhi
    Posts
    14


    Did you find this post helpful? Yes | No

    Default cost

    Quote Originally Posted by mikefox
    Hi guys,

    I need to ask for a little help, I'm building a current meter for a client, and I'm having difficulty working something out.
    I am using a 16F877A with ADC channels 0 to 2 used to measure voltage and current, this all works fine, what I'm having trouble with is calculating current drawn over a period of hours, measured in amp-hour. The idea for this is to show the total current in or out of the system in a day.

    Please, if anyone can help, I could use any tips you might have.

    Mike
    Why not to use 16f676 for the cost consideration as it cost in delhi is Rs.35 only

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


    Did you find this post helpful? Yes | No

    Default

    Charles,

    I finally received my free samples from Allegro today.. gees these guys are slow. I hope that they are worth the wait!


  17. #17
    Join Date
    Jul 2005
    Posts
    93


    Did you find this post helpful? Yes | No

    Default

    what resistor values should i use for the max4172 if my input source voltage is 5v's and my meter should give values for current between 0 and 2 amps.???

Similar Threads

  1. Reducing PIC current to as low as possible...
    By FromTheCockpit in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th November 2009, 04:28
  2. Replies: 8
    Last Post: - 5th May 2009, 20:10
  3. Help from EE's on Power Meter (AN220)
    By SteveB in forum Off Topic
    Replies: 3
    Last Post: - 27th November 2006, 07:05
  4. 16F628A current high during sleep
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2006, 10:21
  5. Detecting AC current
    By rhino in forum Off Topic
    Replies: 8
    Last Post: - 8th July 2005, 21:31

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