Hi Rob:
I have a similar application and I need to read from 0 to 3v ac with a
16F876 at 4 mhz.
Any hints.?
Thanks in advance...
Ruben de la Pena V.
Hi Rob:
I have a similar application and I need to read from 0 to 3v ac with a
16F876 at 4 mhz.
Any hints.?
Thanks in advance...
Ruben de la Pena V.
Hi,
The simplest way to measure a sinewave ac is to rectify the input and do an ADC. Simply multiply the result with 0.707 to get the RMS value. If your input range is too low then some amplification and active rectification through OP-AMPS maybe needed. In fact the gain of the op-amp stage can be calibrated to give you an average dc reading (no need for maths in the PIC side). That is what is done in low cost multimeters. To get best results (depending on the speed needed) do an averaging of the samples collected. Please let me know your exact requirement
1. Range of Input Voltage
2. Maximum Frequency
3. Input waveform
I will try to help.
Regards
Sougata
Mr.Sougata:
I am trying to read a Current transformer. It gives 1000 to 5 amps transformation. With a proper load resistor it will give you a AC voltage proportional to the current.
The range will be between 0 and 3 volts. The ac is plain 60 hertz, but the
rectification reduces the range to .7 to 3 Volts more or less.
If those voltages correspond to 0 to 1000 amps,I can only read from 233 amps to 1000.
Any simple way to overcom the rectification loss.?
Thanks in advance..
Ruben de la Pena
You can't. This is not away to measure AC current in full scale.Originally Posted by Ruben Pena
In one of my project I had exactly the same problem : measuring AC current using current transformer. First idea was to do ADC sampling from time to time and search for max. value in recent period (to find amplitude for ac signal) and then calculate RMS (0.707*peak). This gave poor results so I used different approach: As mains frequency should be 50Hz+/-1Hz, I used interrupt routine synchronized with zero crossing of current, then trigger another interrupt that waits that you come near the expected peak of current and then start to do ADC searching for max value.
In my case, timings were 19.6ms for start and 20.6 for finishing ADC's (50 Hz mains). Since you got approx 40us resolution, this would capture a peak value with sufficient accuracy. This actually worked pretty good, I was able to calculate RMS and from there power. Problem was that in real application, AC mains were distorted (not pure sinus wave). I tried to introduce correction factor, but couldn't (you should calculate trig function in interrupt, that was impossible task for me and poor 18F).
Solution? Well, I finally used specialized (signal->True rms converter) IC. Not a great solution, but it worked and saved me a great time.
Also, put some bigger resistor so you expand your range from 0-3V to 0-5V or you would get poor resolution.
Last edited by lab310; - 20th January 2006 at 10:11.
Bookmarks