Measuring Volts and Amps digitally


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    9


    Did you find this post helpful? Yes | No

    Default Volt And Amps

    Look At Maxim
    Try Max4372

  2. #2
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

  3. #3
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    dhouston, that looks like what i want except that they dont seem to measure below 5A. I do like the fact that they support both AC and DC though. I have 8 outputs that i want to monitor. The max output current ranges from 600mA to 1A and some are AC, some are DC. I want to measure how much current is actually being used even if its less than the output's max rating.

    mikeh, ive had a look and it looks like that chip would simply replace a potential divider circuit.

    skimask, i take it "voltage divider" is the same as a "potential divider". I remember learning about them in school but so far i dont think ive ever put one together. I think i can see how it would work though. It looks like it would simply lower the voltage to a level suitable for the ADC pin on the pic.

    Ive read a wikipedia page about ammeters and it said that you put a resistor in series and measure the voltage accross that resistor and that will tell you how many amps are being drawn through it. This way sounds simple but you said its used *mainly* for DC. Does that mean i can use it on AC? Half of the outputs are AC. What resistor would i use? For the 50V 1A output i assume i need a 50W resistor with the smallest resistance i can find. Rapid sells an OR05 50W Aluminium clad power resistor. It seems a little big but i guess 1A at 50V is a lot for small components.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Voltage divider - Potential divider - it's all got potential to divide
    Easy enough, example: 2 same value resistors, call them 1K, both in series, top of the stack to your input voltage which never goes above 10V, bottom of the stack to ground (which is also your PIC Vref-), middle of the stack goes to your A/D input on the PIC. If the input volts is 10V, the A/D input sees 5v (Kirchoff's Law simplified - the sum of the voltage drops in a circuit is equal to the applied voltage, you're splitting the voltage across 2 equal resistances. If the resistors were different, the voltage you would read at the A/D input would be a ratio of those 2 resistances).

    Current sense resistor - yes, voltage 'developed' across the low value resistor would tell you how much current is going thru it, with just a little bit of math.
    Would it work on A/C also? Sure...You could rectify, filter, and sample/smooth the input voltage and get the same thing as a DC input...or just do it all in software .

    50W resistor - You're thinking about it backwards, go the other route with the number figuring. Yes, 50V @ 1A = 50W...but your sense resistor is usually on the order of .1ohm or less.
    E = IR, P = EI, therefore P = IIR.
    If you've got one amp, one squared = 1, .1ohm x 1 = .1W.
    But throw in a bunch of fudge factor!

  5. #5
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Ok then, the potential divider sounds good. It allows for a variable resistor for calibrating too although i would like to do most of that on the PC.

    The outputs im using will output AC and DC Ripple. There will be times when a capacitor is connected to the DC side but not always. I read somewhere that the V and A should be sampled at a higher frequency than what they are measuring. It suggested 400 samples per second. Here in the UK the AC is 50Hz so if i take the highest reading from each set of 400 samples and ignore the rest then i should get the values i need.

    About rectifying the AC. Correct me if im wrong but im pretty sure i should rectify it *after* the potential divider then deal with it in the same way as the DC Ripple.

    Im not sure i understand the resistor part. I see how you got the 3rd formula from the first 2 but i dont know about the rest. For a start, what is E? A search on google said "E is the e.m.f. of the power supply (the theoretical maximum voltage across the terminals when no current is flowing)". That doesnt really make any sense to me.

    0.1W seems a little small for something thats dealing with 1A at 50V but i see that if theres hardly any resistance then it shouldnt matter so much. I might understand this better when i understand what E is

    What "bunch of fudge factor" would you recommend for that example?

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    It allows for a variable resistor for calibrating too although i would like to do most of that on the PC.
    Yes, you could switch in a voltage reference chip (can't remember the part number for them, but the ones I've used are 4.096v types)...

    The outputs im using will output AC and DC Ripple.....
    About rectifying the AC. Correct me if im wrong but im pretty sure i should rectify it *after* the potential divider then deal with it in the same way as the DC Ripple.
    Yes, otherwise you'll be fighting highs against lows and totally screwing up your readings.

    [QUOTE]Im not sure i understand the resistor part. I see how you got the 3rd formula from the first 2 but i dont know about the rest. For a start, what is E? A search on google said "E is the e.m.f. of the power supply (the theoretical maximum voltage across the terminals when no current is flowing)". That doesnt really make any sense to me.[/QUOTE}
    E = voltage, electromotive force, as in E=IR. Rarely do I see V=IR although it is used sometimes.

    0.1W seems a little small for something thats dealing with 1A at 50V but i see that if theres hardly any resistance then it shouldnt matter so much. I might understand this better when i understand what E is
    Exactly, that's why those little bitty MOSFETs can pass such huge currents...because there's no resistance across them.

    Fudge factor? I couldn't tell you. I suppose as much fudge factor as your wallet and the circuit board can support...

  7. #7
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    dhouston, most likely

    On the main page it says Measurement Range (A) +/- 5 to 30. When you click on it it does say "66 to 185 mV/A output sensitivity" but i thought "Measurement Range" was the range that it could measure. I divided 5V by 4.88mV and got roughly 1024. So that must be the 10-bit thing. A digital value of 0-1024 is equivelent to 0-5V (i think)

    Im still confused though. How does that relate to amps? Or is it that 0-1024 is equivelent to 0-5A?

    I think im gonna go with the resistor and potential divider circuit but i would still like to understand this

  8. #8
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    I dont know about a voltage reference chip. I was thinking to have a variable resistor to get it more or less calibrated properly then have an offset value that can be set by the PC so i can fine tune it without opening everything up to get to the PCB. If a voltage reference chip does what i think it does then it sounds like a good idea and i might use one of those instead.

    Ahh, ive always know V=IR as ohms law. Ive never seen E=IR before. Could that be a new / old or english / american thing?

    I think if i calculate the wattage of resistor i need then double it i should be alright. Im going to put a safety cut out on too so if either AC or DC tries to draw too much current it will warn you on the PC screen and if it goes over a certain value it will cut the power to that transformer. A PIC chip will control cutting it off (the PC just sets the values) so it should be pretty quick to cut the power incase of a short etc.

    I think i understand that equation now.
    P = IIR
    ResistorWattage = Amps X Amps X ResistorOhms

    Rapid sells some really low value resistors but they are a bit expensive. The only ones i see that are 0.1ohms or less are 50p each! I need 8 so thats £4.00 already (plus a bit for accidents). They are 4W though. Ill have to keep looking for some cheaper ones.

    Thanx for that formula. I think it will help with other circuits too. I always use 0.5W resistors but now i could use smaller ones in certain places depending on the amps and ohms. I should start making a list of usefull formulas.

    What is the voltage range of a PIC chips ADC input pins? Im sure i could find the lowest value out by trying it but i want to find out the highest value too without releasing the mysterious blue smoke

  9. #9
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Im still confused though. How does that relate to amps? Or is it that 0-1024 is equivelent to 0-5A?
    The PIC's ADC channels can be configured as 10-bit or 8-bit and there are different reference voltages that you can use. I was assuming you would use 10-bits and Vref=5.

    5/1024=0.004882812 or ~4.88mV per bit.

    The datasheet for the Allegromicro ACS712 chip says it's range is +/-5A and its sensitivity is 185mV per amp. At 0A, its voltage output is Vcc/2 (it is bidirectional, after all). For AC measurements using Vcc=5V, at 600mA, it would output 2.389-2.611V and at 1A, it would output 2.315-2.685V.

    What else do you need to know?
    Last edited by dhouston; - 14th July 2008 at 21:22. Reason: corrected typo

  10. #10
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    dhouston, that looks like what i want except that they dont seem to measure below 5A.
    I think you are misreading it. That's +/-5A full scale with 185mV per Amp which means each mV represents 1/185A or ~5.4mA.

    Assuming 5V and a 10-bit ADC, each bit will equal ~4.88mV meaning the minimum reading is about 26mA.

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