Help interfacing Current Transformers to ADC

Those will be expensive for two reasons. One, they need to go through all the UL cert hoops plus TUEV, CE and all that. Two, its a small market and they still have to amortize those cert costs over a reasonable period of a few years.

There used to be a neat trick, mainly employed in set-top tuners when the UHF band was introduced. Remember when TV was just a few VHF stations, Andy Griffith and all that? If there is always a certain minimum current you can use a CT to supply the power to such electronics.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg
Loading thread data ...

You have to work to get it right, and to understand it. The circuit looks simple, may work well in the lab, then give you fits in the field.

A current transformer is just a regular transformer with a great big current step-down ratio. This means that it has to have a great big voltage step _up_ ratio. With the burden resistor connected the thing presents a very small impedance to the primary (the burden resistance divided by the turns ratio squared), so the voltage appearing across the primary is very small. Should the burden resistor fail the transformer will present an impedance across the primary that's limited by the transformer's primary inductance, and it'll step up whatever voltage it gets. The consequence of this is that you'll see a _huge_ voltage across the output terminals.

So make sure you have something that'll accept the current from your transformer! A bridge followed by a resistor and cap will form a burden 'resistor', with more opportunities for something to fail and cause problems. You could back this up with back-to-back zener diodes, if you wanted to feel safer.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

Not really. Some of the Texas MSP430 were targeted at that very market. A low cost example is the MSP430F2013, about $1.70 in 1k qties. Can run sans crystal, bare bones, comes with a 16bit ADC on chip.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

I like that solution. What do you do if someone hooks it to a sick generator that's running at 54Hz?

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

You could make your own current transfomers- start with say a cheap modem transformer ($1.99 at jameco). Wind a very few turns of 10-amp capable wire over the windings. Voila, a current transformer.

Better start with just one and see how well it works. (It might be too low a reactance or might saturate)

Reply to
Ancient_Hacker

Well, that can be nasty. The longterm average values will be right, but you can make some nasty wobbles in the short-term data. I was working with utility power, which is dead steady.

There's some interesting math here. My sample rate was actually 27.xxx (I forget the exact number) which actually walked a 60 Hz sinewave in some prime number of equally-spaced phase angles over 256 samples, in a sort of random order. That turned out to have very steady measurements when averaging those 256 samples in clusters, even when a bunch of harmonics were present. In the frequency domain, my sampling impulse train was dancing between line harmonics up to a pretty high frequency. Nowadays, of course, it's easy to just sample a lot faster to avoid so many opportunities for harmonic embarassments.

I even did an algorithm to reorder the samples and plot the waveform!

John

Reply to
John Larkin

Never saw this post (just the reply) I guess i should stop relying on google groups and go back to a real news reader.

Would it then be better just just pony up the extra $1-2 per channel and use either a better CT (like 6$ window 1000 turn type?) and/or the ideal recitifer as shown in the first post?

I think I understand this and how it will work. I will order some parts this afternoon and get the breadboard out. Is there a particular rectifier that I should be looking for?

Though I am a programmer (VB mostly) I will am new to PICS so imagine this will be another learning experience alltogether. It sounds simple enough though. Poll the A/Ds and do some math. Send the result to the serial port or whatever.

This sounds a bit more complicated, is there a benefit?

$10 each is not so bad, but I fear the the component count for each chip looks VERY high. Interesting product but I think it pushes the cost and complexity a bit furhter than I am able to deal with.

Reply to
beananimal

I understand that in serious power transmission circles clamping your current transformer onto a line without a burden resistor can be pretty dramatic. There will be smoke, sparks, flame, possible injury and almost certain laughter when your co-workers find out what you did.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

That's exactly what I was thinking of, actually -- I just didn't want to do the math to figure out the ratio. With a good multiplexing ADC you should be able to go quite a ways down in frequency to allow a small microprocessor to keep up with 20 channels, and still get good measurements.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

Hello Tim,

The case where the folks at a client did that there was no laughter. It had thoroughly fried their "golden unit" :-(

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

Hello Tim,

I believe the OP wants each to reside in its own rail-mount enclosure so he'd need one uC per unit. A master-slave situation could become messy there and might cause some code issues. But a 430F2013 is under $2. That's not much more than a 16bit stand-alone ADC. I just priced out something similar and was stunned how expensive those ADC still are. Not much to be had under a buck. In some situations it's tempting to use such a uC just as a muxed AD converter.

Still, in the OP's situation I'd try to get it done analog. It's most likely not a really big deal.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

At this point, I am willing to try whatever is "best". As a previous poster stated, this may be someplace between easiest and cheapest. In the end I have to understand what I am building.

(3) 8 channel boards would work just fine, as that is how the outputs of my controller will be grouped. 3 branch circuits, 8 channels to a branch circuit. I am capable of laying out the basic boards and etching and drilling them.

Thats all well and good, but I know NOTHING about programming a TI and my assembly is more than rusty. The PIC or ATMEL will be challenging enough as it is.

Nope, not a big deal at all. I just want to find an easy enough way to read the power consumption of all of my devices and log them into my software package.

This is for a home automation project (a reef aquarium and some other stuff), there is no R&D money or commercial interests. It is just my desire to learn electronics and build something useful on the process... IE Convergence of my two hobbies (reefkeeping and electronics).

I understand what multiplexing is, as well as sampling rates and a lot of other uC stuff. However the implementation is in the experience and details. Neither of which I have a firm grasp on.

My intent is to get guidance on the best path to take. From that point I will need to research and learn about each technology or aspect of electronics theory that I will need to implement the chosen path. Some of this is clearly old hat or second nature to you guys, to me it is a struggle. I am amazed at the amount of interest this thread has drawn and am impressed with all of the help, if not more confused than when i started! So far there seems to be several different opinions on how this should be done, but I am not in the knowledgable position to be able to choose or differentiate between the pros and cons of each.

Reply to
beananimal

The post contained an image of the transformer. It was 105 kB. I don't think Google does binary image insertions. My OE worked fine.

There are pros and cons to everything. The nonlinearity of the cheaper CT with a rectifier is not too terrible (maybe 5 to 10%), and that can be compensated for in the PIC with a lookup table for about 2% accuracy over about a 10:1 range. Larger CTs are usually designed for 5 amp output, although I have seen some 100 mA. Digikey also has some PCB mounted 1000:1 CTs with a hole for one or more turns of wire, for about $5 in quantity 25. They are made by Amveco.

This idea was for a non-rectified solution. You do a virtual rectification by taking the absolute value in firmware. For an 8 bit converter, any value

128 and above (bit 7=1) is positive. If bit 7 is zero, complement the value and add one. Now you have a 7 bit rectified waveform. You probably want to start with at least 10 or 12 bits, however, so you can get good readings at 5% of maximum.

You can accumulate 60 readings over a 0.2 second period in a 16 bit register and shift right to divide by factors of two until you have the precision you need for your measurement. For true RMS, you need to square each reading and add to the register (24 or 32 bit), then divide by the number of readings and take the square root. There are software algorithms for square roots with PICs.

For best line frequency rejection and smooth readings, total over an integral number of half-cycles. 0.2 seconds (60 readings at 300/sec) is 12 cycles at 60 Hz and 10 cycles at 50 Hz.

For a single PIC with 8 or more channels, you only need to make one active reference at 1/2 Vcc using an op-amp and two resistors. Then each channel needs only the burden resistor and an RC filter to the A/Ds. If you are making multiple independent units, then other approaches may be better.

Paul

Reply to
Paul E. Schoen

-- snip --

I would suggest at this point that you list all of the alternatives as you understand them, then list all of the pros and cons of each as you understand them. To these lists append what you don't know about each alternative that may be blocking you from making a decision.

If one alternative clearly stands out as better _for you_, even if it's just because it's the only one that you really understand and can implement -- do it.

If there's just things that you don't understand that you can resolve by asking questions here -- do that, on different threads if it's different enough from this one.

If there's just things that you need to build a little breadboard to understand -- do that, and ask us why things smoked when they did :).

I'm going to take the liberty of listing some of your options -- you should make your own, though:

Box A:

Choice A1: Use a real current transformer, a rectifier and a filter. Og the neanderthal EE would like it, and it'll work even better now than it did in 1950*

Choice A2: Use a hall-effect 'transformer', a precision rectifier and a filter. Og would be confused, but might accept that it would work after he's sacrificed a few chickens to the Analog Gods.

Choice A3: Sample the AC and compute the current. Computationally intensive, but needs little circuitry. Og would run away screaming, or beat you up -- but he was going to do that when you started bringing the microprocessors on anyway.

Box B:

Choice B1: Use one ADC and a honking big analog multiplexer. Look in your data books for CD405x and 406x parts for the multiplexer. You can use the ADC on your one processor, and control the multiplexers from there. Precision? It's a good thing you don't need it.

Choice B20: Use 20 ADCs (perhaps one per processor) and do the multiplexing digitally. With enough comm software and open-drain outputs you could have one uP per processor, but at a higher price than a handful of CD405x parts.

Choices B2 through B19: Mix ADCs and analog multiplexers as you see fit.

Now find all the combinations of choices from box A and box B (there's at least 6), and see which ones you like.

  • I'd say 1920, but they didn't have good solid-state rectifiers in 1920.
--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

Then I'd suggest building it from scratch. I'd even wind my own CTs, maybe from a bunch of small surplus transformers. Experiment a little, see if a passive rectifier will do and then scale the output to what your uC or PC wants.

They'll work, too. But when you know one uC it's easy to hop to another, almost like renting a car where you get a different one every time.

Into a PC? Then there would be easier methods. Way easier.

Only experiments will teach here. But be careful to leave the 120V AC side alone, especially with water around there. Make sure there is a GFCI and every other required protection.

Thing is, many paths lead to Rome. You might select one where in hindsight someone say "Oh, I'd have done that an easier way". But hindsight is 20:20 and you'd still have learned a lot.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

Yes, I have written Visual Basic software to log and control many aspects of my aquarium. That PC is the end destination for this data. If you could elaborate, that would be great.

Some features (for those who care to see what I am trying to do): Temperature is logged via a dozen or so Dallas 1-wire senors. PH and ORP logging is in the works using op-amps and dallas 1-wire A/D. Metal Halide lighting is switched based up actual solar cycles for the desired part of the world. T5 Fluorescent actinic lighting simulates sunrise and sunset and will be actively dimmed using dallas 1-wire pots (right from their app note!). LED moonlighting will also follow the specified lunar cycle, this is done via a USB 64 LED matrix (phidgets.com). There are a LOT of other features. (24) outlets will be conrtollable by the software in total. I would like to be able to see the power consumption of each device on the controller. I can then set alarms for devices that are operating out of their normal range. All of this will be available over the internet or via the telephone and menus driven by DTMF, email alerts etc. Most of the software is done, I am just struggling with some of the features (the reason for this thread).

The most critical functions (heating and cooling control) are left to a RANCO. PCs crash and I can not afford a crash to bring the life support down. The reason this is not all done with a uC is simple. My lack of an in depth uC skillset is the biggest reason! I woud be struggling to get the data to the PC for controll and GUI purposes let alone use an ethernet interface to maek it available outside my public network.

With regards to mains voltage and the water, yes I understand they do not mix well and am trying to take all the proper precuations to eliminate as much risk as possible.

Reply to
beananimal

I have no problem with neanderthal or cave man tools or methods. If the end result gets me what I want, then I will not complain. I understand that this not the most accurate way to measure my data. The combination of a cheap CT and basic rectifier will result in a somewhat non linear relationship between the actual current and returned DC voltage. If the non linearity is constant, I can simply use some basic logic on the PC side to adjsut hte returned values. If this nonlinearity is not constant and even varies with they type of load on the CT primary (heater, motor, MH ballast, FL ballast etc)... then I may be in for more work than it appears at first glance. However, the whole thing appears at first blush to be easy and cheap to implement. I can feed the signal form each filter into the 1-wire A/D and grab a sample when I need it?

I am not sure what the benefit here is other than using a bit more modern club. From what I gather, my lack of understanding my male the precision rectifier hard to implement. The component count is somewhat higher, but the results will be somewhat more accurate if all is done correctly?

This takes something to sample and compute the current for each CT. This is where the small PICs come in with their onboard A/D. From here I need to get the output to the PC somehow. May get complicated for 24 devices. From what I gather from the previous posts, each CT would be connected directly to the A/D in each PIC (or a pic with multiple inputs for multiple CTs). via a few resistors and/or a constant Vref.

sampling rate of each individual CT and therefore the error rate will be higher. This is getting somewhat complicated and I am afraid it would take a LOT more outside help to get it done. The upside seems to be a small component count.

You have been a large help so far. I LIKE the all digital route, but don't think at this point I have the skills to realize a working project. To many timing issues for a newbie to pull off! That almost dictates that I use Choice A and one of hte options there. I am more comfortable getting data into a PC via an interfaced A/D (1-wire, usb A/Ds etc) or a heap of them, than I am getting the data into a uC and trying to figure out how to get the uC to talk to my software.

Reply to
beananimal

Of course you should. :) I have couple of those. Project was canceled, but the CSL187L worked for me just fine. Expected current was in 10A range. :)

Ideal rectifier is a way to go. The schematic is simple, and it will work. Software is very simple. You don't have the volume to justify long development time, do you?

--
WBR, Yuriy.
"Resistance is futile"
Reply to
Yuriy K.

Instead of buying off the shelf CT from Digikey for $2.5? One's labor should be very cheap to beat this price.

CT -- load resistor -- active rectifier -- low pass filter -- 3pcs 8x1 mux -- MCU with ADC.

Simple, cheap, easy to program, will work.

--
WBR, Yuriy.
"Resistance is futile"
Reply to
Yuriy K.

In message , dated Tue, 12 Sep 2006, beananimal writes

You are probably worrying unnecessarily. The rectifier non-linearity won't have much effect below about 3 V r.m.s. input. Simply choose your CT and burden resistor to keep the voltage away from the non-linear region. Don't try to get an output directly within the range of your ADC, because that WILL be non-linear. Instead, generate more volts and use a resistive potential divider to tap off the voltage you want.

It depends only on the instantaneous voltage applied to the rectifier, and its temperature, for a fixed value of load resistance on the rectifier.

--
OOO - Own Opinions Only. Try www.jmwa.demon.co.uk and www.isce.org.uk
There are benefits from being irrational - just ask the square root of 2.
John Woodgate, J M Woodgate and Associates, Rayleigh, Essex UK
Reply to
John Woodgate

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.