# Average Current

Discussion in 'The Projects Forum' started by aman92, Feb 8, 2013.

1. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
I am trying to implement the following circuit through an Arduino

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.

2. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
Is there anyone who can help? I am kinda stuck on this since a long time

3. ### crutschow Expert

Mar 14, 2008
21,330
6,115
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).

absf likes this.
4. ### Ron H AAC Fanatic!

Apr 14, 2005
7,018
682
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: Feb 10, 2013
5. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,349
731
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.

• ###### 26327-Use_a_transistor_and_an_ammeter_to_measure_inductance_appendix.pdf
File size:
158.1 KB
Views:
17
absf likes this.
6. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
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.

7. ### crutschow Expert

Mar 14, 2008
21,330
6,115
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: Feb 10, 2013
absf likes this.
8. ### Ron H AAC Fanatic!

Apr 14, 2005
7,018
682
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.

9. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
So essentially a simple RC circuit should give me the required average current?

10. ### crutschow Expert

Mar 14, 2008
21,330
6,115
With the switch added, as I stated.

11. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
what i need to know is that whether I can replicate the function of the 555 through an Arduino Uno.

12. ### crutschow Expert

Mar 14, 2008
21,330
6,115
I would think you could. You just need to program the Arduino to output the various square-wave frequencies that the 555 does.

13. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
That's the thing...I don't think the Arduino Uno is capable of producing such high frequency square waves.

14. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,349
731
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.

Code ( (Unknown Language)):
1.
2. /*
4.   Turns on an LED on for one second, then off for one second, repeatedly.
5.
6.   This example code is in the public domain.
7.  */
8.
9. // Pin 13 has an LED connected on most Arduino boards.
10. // give it a name:
11. int led = 8;
12.
13. // the setup routine runs once when you press reset:
14. void setup() {
15.   // initialize the digital pin as an output.
16.   pinMode(led, OUTPUT);
17. }
18.
19. // the loop routine runs over and over again forever:
20. void loop() {
21.   digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
22.   //delay(1000);               // wait for a second
23.   digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
24.   //delay(1000);               // wait for a second
25. }
26.
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.

15. ### Ron H AAC Fanatic!

Apr 14, 2005
7,018
682
Not sure where you got those numbers. Here's a quote from the article:

thatoneguy likes this.
16. ### thatoneguy AAC Fanatic!

Feb 19, 2009
6,349
731
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.

17. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
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

18. ### Ron H AAC Fanatic!

Apr 14, 2005
7,018
682
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?

19. ### aman92 Thread Starter Member

Aug 22, 2012
33
0
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.

File size:
251.4 KB
Views:
7
20. ### Ron H AAC Fanatic!

Apr 14, 2005
7,018
682
Not everyone here has Eagle (including me). Post the schematic as a .png, and we can all see it.