# Re: Current Transformer to PIC Interface

Discussion in 'The Projects Forum' started by gg339, Oct 3, 2008.

1. ### gg339 Thread Starter New Member

Sep 23, 2008
1
0
Hi all,

Hoping I can get a bit of advise.....

I'm working on an interface as above, and I have a 3200:1 current transformer, trying to measure a maximum of 52A @ 230V AC. I want to convert the reading from the CT into a 0-5V reading suitable for input into a 16F877 PIC ADC, and unfortunately things are not working out.

Based on my calculations I have chosen a burden resistor of 307Ohm (V=IR/T..... 5=52*R/3200 therefore r=307ohm), giving 0.095V per amp out.

My problems are this:-

1. the voltage as measured across the burden resistor is an AC voltage, so therefore it will swing below 0, which will not suit the PIC.
I tried a bridge rectifier, but I suspect that the voltage drop across the diodes was screwing my readings at low I, as there might not even be 0.7V developed by the burden resistor until many amps of current were flowing through the CT primary.

I then read about of putting the rectifier before the burden resistor, with the theory that the rectifier will only rectify current, and then pass the current through the burden resistor to develop a proportional voltage - again (possibly due to my inability) this did not seem to work out too well.

2. I thought about a differential op-amp circuit, but am unsure how to construct same.

Has anybody any idea on how to accomplish this easily - I thought of an ade7753 chip but believe it is outside my progrmming ability on the PIC to sort out communications with it.

Also, even after the bridge rectifier I seemed to have an AC voltage across the resistor - am I assuming correctly that this is due to insufficient smoothing after the rectifier?

Any ideas on how to work around this would be greatly appreciated.

Kind regards,
GG339

2. ### beenthere Retired Moderator

Apr 20, 2004
15,815
282
Use a standard value resistor for the load. Pass the AC through an op amp with a gain set to scale the AC properly. Use the old tried-and-true absolute value circuit from National Semiconductor's op amp collection to rectify and filter the AC. Apply to a meter.

3. ### TreeHouse New Member

Jan 15, 2009
1
0
There is a simple way to interface AC to an input that only handles positive voltages, so long as the AC signal is fully floating with respect to the PIC, which it is in the case of a current transformer.

The solution is to connect one side of the AC signal to a reference voltage that is half of the maximum range for the ADC. To calibrate, read the ADC value when no AC is flowing - this becomes your zero reference. In use, subtracting this calibration value from the ADC reading will give you the positive or negative value.

For example, assuming a 10 bit ADC with a 5V reference, you should design your current transformer so that its peak voltage does not exceed 2.5 V (i.e. approx 1.75 Vrms). Ideally, create a buffered half-reference voltage using an op amp, but if the ADC is referenced from the 5V line, a reasonably effective half-reference can be constructed using a resistor divider consisting of 2 x 1kΩ resistors, with the half-reference point bypassed with a 0.1μF + 100μF caps in parallel to ground, as shown in the attached file containing an ASCII-art schematic.

File size:
1.4 KB
Views:
790
4. ### KL7AJ AAC Fanatic!

Nov 4, 2008
2,040
287
Yes, the absolute value amplifier, or "ideal rectifier" circuit is the way to go.

eric

5. ### SSR New Member

Aug 6, 2011
10
0
Hi all.

I am on the same project. I have a 500:5 current transformer with a 10VA.

25 Amps going through primary will cause 0.25 Amps on secondary. A burden of 0.2ohm will drop 0.05Vac at 50hz across the burden.

I heard about the circuit of Peak detector and tested it in proteus, works fine. I want to ask that is it a reliable method? As i will feed the output of the peak detector to micro controller.
Any ideas?

6. ### ErnieM AAC Fanatic!

Apr 24, 2011
7,395
1,607
As long as your loads are well behaved linear loads then the peak average and and RMS values of the current wave all have a simple relationship, so the technique works better for traditional incandescent light bulbs over the newer compact florescent bulbs.

However, you also need the phase relationship between voltage and current to make a true power calculation. That can be as simple as timing their zero crossings.

7. ### SSR New Member

Aug 6, 2011
10
0
Hi ErnieM.

No worries about my load. I am only concerned about the reliability of peak detector. Read of it being unreliable at higher frequencies.

Any idea on what other method can be used for conversion of this 'small' ac signal into dc.

8. ### richard.cs Member

Mar 3, 2012
162
31
You cannot choose an arbitary value of burden resistor, there is a maximum value of resistor that can be used before causing problems (the core starts to saturate). It will depend on the core properties and the resistance of the secondary winding - the datasheet for the current transformer will give you a usable range of values (I assume you are buying rather than building the transformer).

I would agree with the comments on amplifying and peak detecting with op-amps, although in principle putting a bridge rectifier before the burden will work so long as the voltage across the rectifier isn't too great (equivilent to having too high a value burden resistor). Or go with TreeHouse's suggestion if you need to capture the whole waveform.

3200 turns ratio seems very high for measuring just 52 amps. How did you select this transformer?

9. ### SSR New Member

Aug 6, 2011
10
0
Hi richard.

The burden i have selected is based on the formula VA/I^2=R.

3200:1 is the ratio used by OP. Mine is 500:5.

I looked at the diagram posted by 'TreeHouse', but cannot make out how it converts ac to dc.

10. ### richard.cs Member

Mar 3, 2012
162
31
500:5 seems more appropriate here than 3200:1, but I don't see how the formula you gave leads to a turns ratio. There isn't a specific turns ratio for a given application, just a range that gives sensible answers. Very high ratios tend to make things unneccessarily awkward because the secondary has high resistance.

It doesn't convert to dc. You get 5V pk-pk ac signal with a 2.5V dc offset. The signal is then always in the range 0-5V and can be read by the ADC, but the ADC will see the full sine wave, not just some peak or average value. RMS, peak, etc can than be calculated in software if needed.

11. ### joeyd999 AAC Fanatic!

Jun 6, 2011
2,693
2,763
Perhaps this will help:

The circuit described will produce an AC waveform centered about 1/2 vcc, which can be applied directly to an ADC (or CPU ADC). I use code to convert the resulting signal to Irms. Alternatively, you could rectify and/or average and/or peak-detect the output depending on the kind of accuracy required and the shape of the waveform.

What's nice is the magnetic flux is forced to zero at all times which helps to eliminate errors due to core saturation and hysteresis.

12. ### SSR New Member

Aug 6, 2011
10
0
Hi Richard.

10 VA is the rating written on the CT i got. It's the max allowable impedance that a CT can bear without disturbing it's accuracy.

So by using the circuit posted by 'TreeHouse' i have to detect the peak through controller. Ok, i will give it a try in case the peak detector circuit fails.

13. ### SSR New Member

Aug 6, 2011
10
0
Hi joeyd999.

Thanks for your help. I will give it a try.