Measuring Volts and Amps digitally


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    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

  2. #2
    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

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    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.
    It probably does. But if you use high tolerance resistors, you should only need to calibrate once.

    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?
    2 peoples separated by a common language!

    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.
    I think they're expensive because it takes soo much 'energy' (manufacturing energy, R&D, etc) to get them to those low low values and keep decent tolerance over a wide voltage/current/temperature range.

    I always use 0.5W resistors but now i could use smaller ones in certain places depending on the amps and ohms.
    1/4w are generally the cheapest, whether SMT or thru-hole.

    I should start making a list of usefull formulas.
    wikipedia...for instance
    http://en.wikipedia.org/wiki/Ohm_law
    http://en.wikipedia.org/wiki/Voltage
    http://en.wikipedia.org/wiki/Electric_current
    or my personal favorite...
    http://en.wikibooks.org/wiki/Circuit...Resistive_Film
    and so on and so on...
    What is the voltage range of a PIC chips ADC input pins?
    Vdd to Vss... It's all in the A/D section of the datasheets

  4. #4
    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 22:22. Reason: corrected typo

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


    Did you find this post helpful? Yes | No

    Default

    Thanx for the links skimask. Lol, "datasheets", should have thought of that 1 first.

    dhouston, i get half of that. Yes i would use 10 bit rather than 8 for more accuracy. I understand "5/1024=0.004882812 or ~4.88mV per bit." but i just want to be clear about the 5. 5 is Vref but what is Vref? I think Vref is the maximum voltage that the PIC will accept on the ADC pin.

    In this example the PIC chip's ADC input should range from 0 to 5 in steps of 0.004882812. I think so far this is exactly the same as what i would do if i was using a resistor instead.

    Now for the Allegromicro ACS712 chip. +/- i take it means it can accept the current in either way or as AC. Does that make 5A the maximum current rating for this chip?

    Vcc/2 makes sense because as far as i know the PIC chip's ADC can only accept a positive number. So a value below Vcc/2 means negative current and a value above Vcc/2 is positive current.

    What is the sensitivity? I dont really understand that part

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    5 is Vref but what is Vref?
    Read the ADC section of your PIC's datasheet.
    Does that make 5A the maximum current rating for this chip?
    That's what +/-5A means.
    What is the sensitivity?
    That means the output voltage will increase/decrease 185mV for a 1A current.

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


    Did you find this post helpful? Yes | No

    Default

    I think i understand it now. If 5A is the maximum and the output increases by 185mV for each amp then the output range should be 0-925mV. If vcc is 5 then you add 2.5 giving 2.5-3.425V for positive so the entire range must be 1.575-3.425V.

    Ive read a datasheet for a PIC that has ADC but i didnt see anything about the lowest input voltage (unless i missed it or didnt understand it). Would i be right in saying that you take the output from the other chip and lower it so the range becomes 0-1.85V and set the PICs Vref to 1.85V? I think this is what the amplifier thing was about that i read somewhere. I think the idea is to stretch the 1.85V so the range goes from 0V all the way up to 5V so the PIC can read it easier

    I dont think i should have this problem using the resistor method because i can set the PICs Vref to the vdd pin (5V) then use the potential divider circuit to make sure its output is 5V when a little over the maximum amount of amps are being drawn (im making it a little over so i can add overload warning and safety cutoff)

    Where does 30 come into it? On the main page it said +/- 5A to 30A

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Where does 30 come into it? On the main page it said +/- 5A to 30A
    Different chip versions....

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Ahh, I see. I was getting confused before because it looked like the range of the chip was 5-30. I see now at the bottom of the other page there are 3 versions of that chip with different ratings

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