Trying to determine dc current - 12v lead acid battery charger


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger

    Quote Originally Posted by tasmod View Post
    Thanks Hank,
    This isn't the first circuit I've seen setup this way which claims 10A measurement with 10ma resolution but also using a 16f877. With 1023 bits to play with "it does not compute Captain"
    It is kind of correct..... 10mA through a 0.47R resistor = 0.0047V drop across it (which, if you look back above the above posts, with a 5V ADC reference & 1024 bits, you can resolve 0.0048828125V per ADC bit)

    the spec seems to have changed a little though ...I'd thought earlier on you were speaking of 1000mA being your maximum anticipated current ...if that were the case, then 10mA resolution didn't strike me as being that granular....however if 10A is to be your max current, then 10mA of resolution is just dandy! So I guess you need to bottom out your requirements & take it from there.....

  2. #2
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger

    Hi Rob,

    If you plan to increase the maximum current from 1 Amp to 10 Amps then I would suggest that you change the value of the shunt resistor due to power handling ratings. 10 amps flowing through a 0R47 shunt resistor will need a hi power resistor (P=I^2 x R = 47 Watts).

    Your circuit shows the original 0R1 shunt resistor power rating as only 3 watts which has a theoretical limitation of just under 5.5 amps.

    Cheers
    Barry
    VK2XBP

  3. #3
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger

    Thanks Guys,

    I probably confused you a bit.

    The 1000mA unit is the one already built which i wanted to upgrade to 5amp later. It used a .1 ohm resistor in the positive output which I removed and linked out. I then added a .47 in the ground leg.

    I then intended to design and build a multi function charger/desulphator unit which would probably be capable of 10amp.

    I would be quite happy with 10mA resolution on any of them. It's just that the counts I'm getting from the ADC just don't seem right anyway.

    I have another new 16f877 which i will test out.

    I mentioned the advertised unit because of it's specs and it's circuit. 3W .47ohm resistor in ground leg with 10amp measurement ? Capable of recalibration to greater amps?
    Probably a catchpa in the instructions when you get it.

    Rob

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger

    As Barry pointed out, if you use a 0.47 ohm shunt and are planning to draw 10 amps through it, the resistor will need to be rated for at least 47 watts!!! Thats a lot of wasted power!! And one big honking resistor! What you may need to do is supply a Vref for the ADC that is lower than Vcc and use a smaller shunt resistor. Or put an op-amp across a smaller shunt resistor to amplify the difference. You may need to drop the shunt down to 0.01 ohm in order to get a reasonable sized resistor. That would be a 1 watt resistor. If you drop Vref down to about 1V, then should be able to get 1 mV resolution. With a 0.01 ohm shut, that would give you about 100 mA per step. So you may still need to use an op-amp if you want better resolution.
    Tim Barr

  5. #5
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger

    I've looked at a shunt that I have for a 100A meter which I can use.

    Out of interest today I programmed the code that fratello posted and tried it on my board after changing the lcd defines etc.

    RESULT !

    Well, the voltage code is incorrect BUT the current code works just fine. Now if only I could get my head around the language used

  6. #6
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger


  7. #7
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger

    Yes interesting chip, that'll do nicely for the large current version.

    Finally success with the 'current' routine.


    I've been completely puzzled by the readings and results so I rewrote the code just to get the adc counts.

    The adc count for the current input mirrored the current output of the unit. Great, now just alter the code again and run.

    Hmm no joy, it was out again by a long way. So I isolated the code to study the routine, no it was correct. Then I wondered why the routine should be so far out from the count. Logic said it wasn't the count but something else. So I checked the defines. Argh, the ADC osc had been commented out and I had another oscon0 that set it at 8Mhz.
    Changed the adc back to internal rc osc and the routine now worked.

  8. #8
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: Trying to determine dc current - 12v lead acid battery charger

    Regarding the 0.47 ohm resistor.

    As it's in the ground leg am I not correct in thinking the power rating is different, as it's current is say, 1amp, but it's the voltage drop across the resistor that counts which is in mV.

    Put it this way with real world on the board. On the positive output it ran quite warm at 1amp. In the ground leg it is still cold at 1amp.

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