Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Current Sampling/Measuring

Status
Not open for further replies.

Pagedown

New Member
Hi everyone, I've been trying very hard to contruct an analog front end to measure current with an MCU, using a C.T(preferbly) or a sense resistor. Translating them into positive 0-5V.But find no luck as the I need a wide range and good resolution of 5mA.

Requirements :-

Line current : 0 - 10A 50/60hz AC
Resolution :5 mA

I need to translate them into 0-5V to be measure by my MCU to graph the instananeous current waveform, and of coz the rms values, peaks and so on.

The biggest problem is the 5mA requirement.Any help is greatly appreaciated.
 
Don't start a new thread on the same subject. Bump your old thread if you want further discussion.
 
One, your specifications are all wrong when you think about interfacing to the MCU.

1. You need to think about the peak value of the 10 A current. If your interested in surges, that can be considerably higher than the peak value of 10 Amps.
2. You need to signal condition in two steps. Like normalize to +- the peak current expected such as +-2.5V. A hall effect current sensor such as those made my Alegro should work. See www.digikey.com`A hall effect sensor will provide isolation.
3. Now you can level shift the +- current to 0-5 Volts

Count wise you should be fine. If 10 A were the peak value of current. It's not. It's 10*sqrt(2), but I'm using 10 to make the math simple. 10,000 mA/4 = 4000 counts or +-4000 caounts or 8000 counts total. But you need to measure the peak. Again to keep the math simple for proof of concept, I'll use 1.5 rather than 1.414. At 1.5 * 4000 it's +-6000 or about 12000 counts. So a 12 bit converter won't work. A 16 bit converter would give you 65535 steps.

You also need to look at quantization error for your system. You can't measure a signal of 10 mA becuse the error is 100% or so. As the number of bits increase, the quantization error goes down.

You didn't mention that you need voltage.

There are signal conditioning modules such as the 5B series and others such as Action Instruments which can do math manipulations with 2 signals. Watch the bandwidth needed.
 
You will have several problems starting with quantization errors which are explained well here. Beyond that you will lack the resolution to see 0 to 10 amps with .005 amp resolution. Going back to what KISS covered.

If I wanted to measure 0 to 10 AAC accurately (well pretty accurately I would start by getting a CT similar to one of these. That will afford a nice linear output of 0 to 10 amps = 0 to 5 volts if chosen right. Therefore 0.5 mV / mA of current AC. Therefore to accurately measure 5 mA you need to resolve with accuracy 5 * 0.5 = 2.5 mV.

Most uC units offer at best 10 bit resolution. That becomes 1024 quantization levels of measurement. So your coding would look like this:

Full scale range = 0 to 5 volts.
ADC Resolution = 10 bits (2^10) = 1024
ADC Voltage Resolution = 5 / 1024 = .00488 volts or 4.882 mV.

With a 10 bit A/D you will never see or resolve 2.5 mV (your 5 mA)

If you went to a 12 bit A/D with this sort of setup you would now have a resolution of:

5 / 4096 = .00122 volts or 1.2 mV which would work.

Given a choice for a commercial application I would find a 12 bit or greater with 14 to 16 bit preferred ADC designed for the application.

Ron
 
Simply put. At lower voltages, you get higher errors. Simple way of looking at it, is as you measure the first 100 units of representaion, at 100 units the q error is 1%. As you measure less and less the error goes up.

Ron described a True RMS sensor. I was under the impression that you needed the equivilent of an oscilloscope technology.
 
Simply put. At lower voltages, you get higher errors. Simple way of looking at it, is as you measure the first 100 units of representaion, at 100 units the q error is 1%. As you measure less and less the error goes up.

Ron described a True RMS sensor. I was under the impression that you needed the equivilent of an oscilloscope technology.

Uh Oh, I was caught up in RMS for some reason. Maybe I just like RMS? :)

Then I saw this from the OP:

I need to translate them into 0-5V to be measure by my MCU to graph the instananeous current waveform, and of coz the rms values, peaks and so on.


Actually after reading that I am not quite sure what is wanted. :confused:

However, if I wanted to graph the value(s) for a reasonable price (as in pretty cheap) I would get the current sensor I linked to or similar. However, I would get it with a 4 to 20 mA out and run that through a precision resistor of 500 Ohms. So now 0 to 10 amps is 2 to 10 volts. I would run the 2 to 10 volts into something like this little inexpensive data logger. which includes some prettyy decent data logging software or roll your own from the SDK. Hey, 12 bit and 4 differential channels, not bad for the buck considering plug and play.

Then I would do as KISS suggested back there and use the math to get whatever I wanted. Maybe something along those lines?

Ron

Ron
 
I figured I could just avoid the actual math and deal with estimating instead. Ron's principles are correct for normalizing and agree with mine. It's just RMS has only a positive sign. Both of us hinted on isolation.

The OP mentioned that you had already dealt with voltage. This means that you should have already discovered that 0-120 V RMS is about +-155 V or so. You need the +-10% tolerences, so the 120 increases and the 155 increases. If you need to deal with spikes, then you increase this ceiling again. The normalizing to +-2.5V and then level shifting still applies as it does with current.

Isolation may apply. Differential measurements may apply.
 
Hi everyone, I've been trying very hard to contruct an analog front end to measure current with an MCU, using a C.T(preferbly) or a sense resistor. Translating them into positive 0-5V.But find no luck as the I need a wide range and good resolution of 5mA.

Requirements :-

Line current : 0 - 10A 50/60hz AC
Resolution :5 mA

I need to translate them into 0-5V to be measure by my MCU to graph the instananeous current waveform, and of coz the rms values, peaks and so on.

The biggest problem is the 5mA requirement.Any help is greatly appreaciated.


Hi,

Are you sure you really need 5ma resolution? Out of the full scale value that's only 0.05 percent (five hundredths of one percent, or one half of one tenth of a percent). Most apps dont require that kind of resolution. You'd need a 50000 count meter just to test it. That leads me to ask you what you intend to do with this thing, measure nuclear radiation leakage ? :)
Most apps that require accuracy can be done with more than one range, such as 0 to 500ma and 100ma to 10 amp or something like that. You still dont get the resolution but you get better accuracy overall.
5ma out of 10amps is only 5 parts in 10000, or 500 parts in a million, which is just a little more than the drift of some crystals, so i have to ask again, why the extreme resolution requirement?
 
Last edited:
I can't even do AC at ±0.05% with our fanciest bench top meters. Static DC yes. Dynamic AC no.

Once the errors associated with isolation and ADC are accounted for, our $$$$ rack mounted data acquisition system only does about ±0.1% with a pure sine wave and a resistive load.

Once a 16 KHz VFD output, a reactive load, and the necessary filtering is introduced, I don't think we quite make it to ±1%.
 
Because the project is a power monitor, measuring the power consumption, kwH, thus I need at least 1 watt sensitivity.
Line voltage is 240V.
Thus, current = 1 watt/240volts = almost 5mA.

Is it impossible? Should I lower my requirements?
 
Hello,

Yes but you dont usually need 1 watt resolution out of 2400 watts. You might need 1 watt resolution out of 100 watts for example, but with the full 2400 watts you probably only need to resolve down to maybe 24 watts. In other words, as the current increases you need less resolution. This allows range switching or perhaps other simplifications.
If you really want to keep track of every watt then you're going to need a good design, which will be hard to achieve.
 
Last edited:
Because the project is a power monitor, measuring the power consumption, kwH, thus I need at least 1 watt sensitivity.
Line voltage is 240V.
Thus, current = 1 watt/240volts = almost 5mA.

Is it impossible? Should I lower my requirements?


Nothing like this is impossible but a matter of cost. For example you have a 240 VAC system and need to accurately measure the voltage and current up to 10 amps. 240 VAC at 10 amps is 2,400 watts of power. We won't get into true power or apparent power, we will just assume a purely resistive load.

1 watt is what part of 2,400 watts? That would be right about 0.417% or as you mentioned in mA about 4.17 mA. You are asking a lot at this point considering we need to measure voltage and current. Earlier I mentioned a current transducer that would scale your 0 to 10 amps to 0 to 5 volts or 4 to 20 mA DC. There are voltage transducers that will do the same and scale 0 to 250 VAC to 0 to 5 VDC or 4 to 20 mA DC. Typically good transducers like this carry a price tag of about $215 USD each. They are nice true RMS responding units on the bright side. Their uncertainty is ± 0.5%. We have not yet gotten to your ADC portion yet and earlier we sort of beat the bits to death and the other errors involved with ADC in the conversion process including quantization error. The error in a measurement plane like this is cumulative and starts adding up pretty quick. We have not even gotten into resolution yet, another animal not to be confused with accuracy or uncertainty.

There are instrumentation systems that will do what you want but the cost is extremely expensive. Building your own will also be real expensive. Yes, you can get the pieces and parts and build your own current and voltage transducers but good luck getting the accuracy even close to what I mentioned with off the shelf reasonable cost and moderate accuracy units.

Even with good calibration both in the hardware and software offsets I don't see getting close to what you want. Not unless you have a large surplus of money. :)

<EDIT> Beat by MrAl with more sense and fewer words. </EDIT> :)

Just My Take
Ron
 
Last edited:
So I should set to 24 watts resolution requirement with 0.1A?

But does this mean anything below than 24 watts would not measure in my meter? for example 10watts light bulb for one hour?
 
You have not mentioned exactly what you plan to use for transducers yet? You have also not mentioned the ADC bit as in 10 bit ADC or 12 bit ADC or whatever. Resolution in short is the ability to read an instrument or of the instrument to be read. Not to be confused with accuracy which in short is a deviation from the truth. If for a rough example I have a 0 to 100 amp transducer with an accuracy of +/- 1 amp (1.0%) I can write code to display XXX.XXX but the three places to the right of the decimal are a waste as they will not display accurate data. Give this a read and you should understand what I am getting at.

How do you plan to display and log the data?

Ron
 
for example 10watts light bulb for one hour?

You still haven't mentioned just what sort of waveforms/appliances/devices you're using this for. This has everything to do with what you're likely to need.

If you're looking at light bulbs connected to clean 120/240 VAC power, you can probably get 2 Watt resolution with ±2 Watt accuracy you're looking for pretty inexpensively with 12-bit A/D converter sampling both voltage and amperage at a few KHz. If you want to accurately analyze the power consumption and efficiency of a 200 KHz switching power supply while it's plugged into the same circuit as another 200 KHz power supply you'll have to agonize over details like filtering, grounding, shielding, and sampling. Unfiltered 12-bit data at a few KHz isn't going to cut it.

We have a he!! of a time accurately measuring circuits involving motors powered with PWM drives switching at 16 KHz that are connected to the same mains as several welders and injection molding machines in spite of their being at the other end of the building. Our 16-bit data acquisition system can't sample 6 channels fast enough to accurately analyze the output power. Our oscilloscopes can't record such data over periods exceeding milliseconds. Even at the input, the noise and instability of the power lines mandate proper grounding, shielding, and sampling much faster than a few KHz to be within a few watts.
 
Last edited:
I haven't done any detailed research on the Kill-A-Watts, but I believe they're only accurate to a few watts in spite of being designed specifically for their application. Knowing how marketing departments love to rate things, I'm willing to bet their accuracy degrades to ±10 Watts or even more when presented with difficult measurement environments.
 
So I should set to 24 watts resolution requirement with 0.1A?

But does this mean anything below than 24 watts would not measure in my meter? for example 10watts light bulb for one hour?

Well, no, as if you were measuring only 10 watts then you can downshift to a lower resolution range. Just as a rough idea what you might do, you might have ranges for 10 watts, 100 watts, and 1000 watts and up. If your input is in the range 0 to 11 watts you would use range 1, and if 10 watts to 100 watts range 2, etc. The choice of range and amount of overlap depends on how much accuracy you want. These are just simple examples. By range switching you can get decent accuracy for different levels of power measurements.
 
My power line is 240V AC 60Hz.
My power measuring device in between the line and load.
My load would be 0-10A which means 0-2400watt.

If 2 watt accuracy that means 8.33mA resolution is needed. I think this won't be easy to, am I correct?
Is there a middle point or the best possible solution to this problem?
 
Status
Not open for further replies.

Latest threads

Back
Top