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

    I think for the actual project im going to use vdd because the potential divide part can change its value to make use of the full 5V (i dont have any outputs 5V or less).

    The frequency is 50Hz (UK AC) but because its DC ripple i guess that makes it 100Hz. As i said before im going to only take the highest value. If i sample it at about 400 times a second then at least one sample will be extremely close to the absolute max. Because of DC ripple it also has 2 chances per second to get as close as possible. I can then discard all the lower readings. The highest value will be reset after each 400 samples so it can detect a drop in current.

    Im not sure if a PIC chip can check the ADC chanels that fast though. I might need a higher resonator. If using 10-bit then the chip can detect 1024 different voltage levels. At 5V max each level is 4.8828125mV. As long as the input value is within 4.8828125mV of the highest point in the DC ripple i should get an accurate reading. The good thing about DC ripple (or any kind of sinewave based line) is that it stays near the top for a longer period of time than any other point in the wave but still i might need more than 4 sample points on each bump. To make it even worse the pic chip will have to deal with 8 ADC pins. It might be an idea to split the work between multiple PICs

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    The frequency is 50Hz (UK AC) but because its DC ripple i guess that makes it 100Hz......................
    To make it even worse the pic chip will have to deal with 8 ADC pins. It might be an idea to split the work between multiple PICs
    If you run that 100hz DC ripple across a capacitor with a very small value bleed resistor, said capacitor will quickly charge up to the peak value of that ripple, thereby negating your need to quickly sample the output, maybe even isolate it with a diode so it (the cap) can't bleed back into your supply. Basically, you end up with a full wave filter without much of a load.

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


    Did you find this post helpful? Yes | No

    Default

    I thought about that but decided not to because i was unsure about it leaking back into the output. If a simple diode takes care of it then i guess the rectifier would do the same thing.

    I worked out that witout a capacitor or anything that the PIC could get up to 0.38V less than what it should do. That equates to about 78 levels difference out of 1024 or a 7.6171875% error. All that is based on my maths being correct but 7.6% sounds about right.

    I just had an idea. dhouston mentioned zero-crossing. I already know how to detect that thanks to the PWM circuits ive made before. What i could do is wait for a zero crossing then wait a certain amount of time then run a few samples. That should put all the samples closer to the peak.

    The capacitor idea sounds really simple though. If the capacitor can keep the level high enough between peaks then in theory i could sample each one once every second. I would like a single chip to sample all 8 if possible and send the data to the PC through serial so i think i do really need the capacitor.

    What is the purpose of a "bleed" resistor? Is that to go in series or parallel with the capacitor? I would need the capacitor to empty pretty quick but not as quick as the frequency of the input. I dont want to have to wait 10 mins while it realises the output isnt drawing as much current anymore.

    Edit: I plan to buy an oscilloscope with these components so it will be easier to test and see the sinewave

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    If a simple diode takes care of it then i guess the rectifier would do the same thing.
    Pretty much does, but you have to calculate the offset caused by the diode's forward voltage drop (either ~.25v or ~.6v depending on the type)

    What is the purpose of a "bleed" resistor? Is that to go in series or parallel with the capacitor?
    Series to ground, parallel across itself, whatever, you'll have to figure that out yourself (think R/C time constant). The bleed resistor will let the cap falls off if/when the input voltage average drops. I think you've got the idea, just need to plug some numbers into a couple formulas.

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


    Did you find this post helpful? Yes | No

    Default

    I think the diode part can be compensated by calibrating the circuit. Im going to have a variable resistor that can move the output in the range of 3-7V, then i will use the computer calibrating part (either the chip of a furmula on the final result) as a kind of fine tuning.

    Just thinking about calibration. Whats the best way? I was thinking to connect up my multimeter, apply different loads and match the output to the multimeters output. Would that work well enough?

    How do you choose a capacitor and bleed resistor? I know you sort of told me but im not sure. Which do you pick first? The capacitor or the resistor?

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