Need Help On Ac Voltmeter !!


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Smile AC Voltmeter

    Hi Uludere,

    In general your code goes in the right direction but there are a few problems, for example Cnt is declared as byte (255) so FOR Cnt = 0 TO 400 won't work (Rollover), Cnt must be declared as word. This is not so good then in Loops, using word variables causes enormous delays compared to bytes.

    I'll get something together for you this evening and send it to you tomorrow.

    Best regards,

    Rob

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


    Did you find this post helpful? Yes | No

    Default RMS to DC converter is the best approach

    Hi,

    For instrumentation purposes it should be kept in mind that the ADC in the PIC is poor in the lower range (Less than 2 Volts). So you need a shifting reference that actually increases the resolution.

    If you measure the AC in chunks you need a zero cross sense circuit to kick your measurement routines.Also noise (motor current) would make it worse.

    As mentioned by lab310 distortion and PF in the input waveform would give erroneous result. You may use a software based pseudo differential measurement technique.

    I believe depending on the accuracy you need you should choose a solution. As mentioned amplifying the AC and introducing a gain of 0.707 do give results but in the lower side the accuracy is not good enough due to the conversion slope.You can handle this in software.

    I would suggest that you go for a RMS converter and use a temperature compensated reference for the PIC. Do the AD in sleep via interrupt. Sample 16 times and do an average.This gives best results.

    Good Luck.

    Regards

    Sougata

  3. #3
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Default AC Voltmeter

    Hi All,

    Uludere, I tried to send you circuits etc but I'm a bit of a novice to this forum and the files are too big. I'll cut them down to size this evening and send tomorrow, sorry for the delay.

    Sougata, of course for voltmeters, the PIC ADC is really not suitable for any real precision. Nor is any other normal µcontroller for that matter. RMS-type measurement is easier but not better, especially for low levels and changing frequencies, which is why I even contemplate AC chunks. It isn't necessary here to check the zero cross though, assuming we're sampling offset peak to peak and calculating RMS.

    It isn't necessary to measure the exact voltage value, either, and that in all cases. Of importance is that the measurement system used is consistant, that means it detects the same value of any given voltage at all times. Software correction to convert to the correct RMS values is then easy. The above statement includes your remarks about temperature correction.

    A trick I have used, not for AC voltage but for reading optical sensors, was to couple a number of ADC inputs together and to let one intergrate while another converted. This allows a higher reading rate when reading chunks, and of course for all other cases too. Watch the delay requirement for switching ADCs though.

    Greetings,

    Rob

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


    Did you find this post helpful? Yes | No

    Default While integrating you can use the same ADC input

    Hi,

    I do not rely on the PBP ADCIN command. I setup the ADC take one reading first then start the sampling again. While sampling I do the calculation stuff then I introduce whatever more delay is required (pauseus) and repeat.

    Regards

    Sougata

  5. #5
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Default AC Voltmeter

    Hi Sougata,

    I don't use the ADCIN command either, unless I'm feeling lazy or there is no need not to. I switch the registers as required. Especially in many uses (I research in Laser Medicine and build a lot of my own equipment) a different integration time for different inputs can be of benefit.

    I even connect CCD array outputs directly to the ADC input and get excellent results by using the input circuitry in the PIC as a quasi charge measurement device. Set the reference voltages to, say, +3V and +1V and we get a good resolution. We don't even need to decouple the input, the charge function of the input capacitor does that.

    Regards,

    Rob

  6. #6
    Join Date
    Apr 2005
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    No problem for Delay!
    we are looking forward your sch. & code sample!
    thx

  7. #7
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Default AC Voltmeter

    Hi Uludere,

    I forgot the week-end, I got round to trying to get the data over to you but using Eagle CAD, I can't get a file under 200K, so now I'll try it in little bits. First of all the simple input for chunking AC attached.

    Using a 2.4 volt zener diode D1 and R1- 1.0K, generate 2.4V as offset for the PIC input, decouple with C1, C2 from Vdd against Vss. This is also connection for one of the meter probes. Remember that both Vdd and Vss must float, the probes may not come into contact with Vss or Vdd.

    The resistors R2 and R3 must be calculated as divider for the max. voltage you want to measure. If e.g. you want to measure max. 100 VAC RMS then calculate 100 x 1.42 = 142V say 150 V peak each node and select the resistors accordingly to allow not more than +/- 2.5V at the PIC input. I've put a 100nF capacitor over the PIC input to reduce noise, if you keep the frequency under ca. 100-150 Hz it won't affect the input materialy.

    If you now put the probes over the voltage you want to measure, the reduced signal divided by R2 and R3 2 will appear over the ADC input offset at 2.4 V.

    Let me know when or if you want to try this type, I'll send you software or the next circuit if you want to try the RMS method.

    Greetings,

    Rob
    Attached Images Attached Images  

Similar Threads

  1. Circuit Diagram for interfacing AC to PIC IC?
    By wellyboot in forum Schematics
    Replies: 3
    Last Post: - 8th March 2008, 19:40
  2. How to read AC mains with an inductance coil
    By KB3BYT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th February 2008, 12:02
  3. Ac voltmeter Ampermeter
    By onur in forum General
    Replies: 4
    Last Post: - 27th March 2007, 21:13
  4. Special Offer AC -AC adapter
    By lester in forum Adverts
    Replies: 0
    Last Post: - 9th September 2005, 07:52
  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 : 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