Average Current

Thread Starter

aman92

Joined Aug 22, 2012
33
I am trying to implement the following circuit through an Arduino
http://www.edn.com/design/component...-inductance?cid=Newsletter+-+EDN+Design+Ideas

Now basically I need to replace the ammeter and somehow measure the average current. Can anyone give me some methods to achieve this using an Arduino. I need accurate measurements as that value of average current will be proportional to the net inductance which I am trying to measure.
 

crutschow

Joined Mar 14, 2008
34,472
You should be able to measure the voltage across R (2.5kΩ) to get the average current. Just use a high value resistor in series (say 1MΩ) and a capacitor (0.2uF for 1MΩ) from the resistor output to ground to filter the wave and get the average value..

For that, the 100μA full-scale output will be 250mV. You likely will want to amplify that with a low-offset, non-inverting op amp to get a higher full-scale voltage (say a gain of 20 to get 5V full scale).
 

Ron H

Joined Apr 14, 2005
7,063
I think you are wasting your time. If I understand the circuit and the accompanying explanation, the entire premise is wrong. Does anyone else here think it will work?

I believe the average current through the inductor will be essentially independent of the inductor's value.

EDIT: I was wrong. See post #8.
 
Last edited:

thatoneguy

Joined Feb 19, 2009
6,359
I agree with Ron H on this one. I've converted their Appendix A that details the operation to a .PDF file. It's similar to the oscilloscope method, but.. not. It tries to show time constants, which is only useful for large value inductors.

Is your goal to reproduce the linked circuit, or to measure inductance?

A quick search did show results for uC impedance measurement, but be careful with some, if they use LM741 op amps, they may work, but a better op amp may work better, depending on the circuit.
 

Attachments

Thread Starter

aman92

Joined Aug 22, 2012
33
Essentially it is a circuit to measure inductance...though I don't see how the average current won't be proportional to the inductance as RonH is implying.
 

crutschow

Joined Mar 14, 2008
34,472
The circuit description states that the inductor is first charged to the maximum current as determined by the 2.5kΩ resistor with the meter disconnected. Then the inductor drive voltage is removed, the meter is connected and the inductor average decay current is measured. That would indeed give an average current proportional to the inductance.

But that brings up an error in my previous suggestion. You would need to move switch S4 to be in series with the measurement RC circuit connected to R. S3 could be eliminated and a short put in its place.
 
Last edited:

Ron H

Joined Apr 14, 2005
7,063
I agree with Carl.
I was wrong. I had misinterpreted the circuit's operation.
The meter only measures the decay current, so the average current is proportional to the inductance. My apologies.:(
 

thatoneguy

Joined Feb 19, 2009
6,359
I just performed a test with an Official Arduino Uno, 16Mhz.

Code running (Changed to Pin 9 and removed delays). This is just the "Blink" program with delays removed and different pin.

Rich (BB code):
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 8;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  //delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  //delay(1000);               // wait for a second
}
I'm a bit more sad with Arduino after seeing this response.
Max Frequency of Square Wave using digitalWrite - 116kHz
Freq| 116.00kHz
Square wave Rise Time| 40nS
Square Wave Fall Time| 48.3nS
Period| 8.62μS
On Time| 4.01μS
Off Time| 4.61μS
Duty Cycle| 46.52
That is the absolute fastest The arduino Uno can toggle an output using digitalWrite, no interrupts, no calculations between state switches, etc.

The OP posted circuit goes from ~2Mhz for the 5mH/20nF, 198kHz for the 50mH/20nF. So with the data above, it should be able to measure an inductor of 100mH or larger.
 

Ron H

Joined Apr 14, 2005
7,063
The OP posted circuit goes from ~2Mhz for the 5mH/20nF, 198kHz for the 50mH/20nF. So with the data above, it should be able to measure an inductor of 100mH or larger.
Not sure where you got those numbers. Here's a quote from the article:
the NE555 connects as an astable multivibrator oscillator to produce a square wave of approximately 50% duty cycle at frequencies of approximately 46 Hz, 230 Hz, 2.3 kHz, and 23 kHz, depending on the position of the range-selector switch. These values correspond to a full-scale inductance- measurement range as high as 2.5H, 500 mH, 50 mH, and 5 mH.
 

thatoneguy

Joined Feb 19, 2009
6,359
I was still flashing back to the oscilloscope method.


The timing on the lower value inductors will be iffy though, if all instructions have a 0.125% scale to the oscillator.
 

Thread Starter

aman92

Joined Aug 22, 2012
33
Now the problem is how to achieve the required switching without using the CD4066 and 4011. I tried to produce the square wave and switching both through the Arduino but I think the coding may be too complex
 

Ron H

Joined Apr 14, 2005
7,063
Now the problem is how to achieve the required switching without using the CD4066 and 4011. I tried to produce the square wave and switching both through the Arduino but I think the coding may be too complex
If you can replicate the function of the 555 with the Arduino, you can do it without the 4011, if you have an extra output on the Arduino (I can show you how), but I don't see how you can avoid the analog switch. Why do you need to eliminate it?
 

Thread Starter

aman92

Joined Aug 22, 2012
33
I have attached the schematic of the circuit which I hope finally works. I will supply the square pulses through the switches from an Arduino

Still need to know whether I need an amplifier for the current.
 

Attachments

Ron H

Joined Apr 14, 2005
7,063
I have attached the schematic of the circuit which I hope finally works. I will supply the square pulses through the switches from an Arduino

Still need to know whether I need an amplifier for the current.
Not everyone here has Eagle (including me). Post the schematic as a .png, and we can all see it.
 
Top