Go Down

Topic: Measuring AC In Rush Current (Read 854 times) previous topic - next topic

twilliamson

I have a test application the I'm currently controlling via Uno R3 and a Ethernet shield, that's working perfect. I'm trying to add a In-Rush current monitoring feature to it. I have a Tektronix's A622 Current probe that I would like to use. It outputs 10mv/Amp; in lab applications we connect this probe to our Tek 2023 scope.  I'm experimenting with it being connected to a 2nd Uno R3 board, possibly later to have it communicate (i2c?) to the Uno with Ethernet Shield.  Here is my interface between my probe and the Uno. Schematic is incorrect i used 1k resistors instead of 10k.

I built this because the waveform out of the probe is a sine wave, it goes negative.
Here is my code so far, I'm getting readings but they aren't very accurate. Always seem to be lower than actual and don't appear to me off linearly either. I can put a second channel of the scope looking at the output of my interface and it seems to be functioning perfectly .

Green is Raw Current Probe, Orange is my interface.

Quote

int zeroValue = 0;
int sensorStore =0;
int sensorValue =0;
int updatedZero =0;
int sensorValue1 =0;
void setup() {
  Serial.begin(9600);
  delay(500); //wait for things to stabilize
  zeroValue = analogRead(A3);  //measure 0A Level
}

void loop() {
  sensorValue = analogRead(A3);
  updatedZero = sensorValue - zeroValue;
    
    if (sensorValue > sensorStore){
    sensorStore = sensorValue;
    
    sensorValue1 = abs(updatedZero);
    float store = ((sensorValue1 * 4.9)/10);
    if (store > 1){
      Serial.println(store);
     }
  }
  

  
}


Any ideas on why I'm missing the peak reading, or why it's not accurate?
Tripp Williamson
KG4UAL

Grumpy_Mike

The capacitor in the scope lead is shifting the position of the peak. Why do you have it in?

twilliamson

The cap is there so i don't feed 2.5v back to the probe or the scope. Using it for decoupling. The Circuit i have seems to be working, I think my problem is software related.
Tripp Williamson
KG4UAL

Magician

Code: [Select]
if (sensorValue > sensorStore){
    sensorStore = sensorValue;
   
    sensorValue1 = abs(updatedZero);
    float store = ((sensorValue1 * 4.9)/10);
    if (store > 1){
      Serial.println(store);
     }
  }

This piece print out only progressively increasing values, so when you reach a peak it stop printing.
Why do you need  if (sensorValue > sensorStore)? If to slow down traffic, probably , it would be better to capture data in array, and print later.
http://oscilloscopeexpress.blogspot.com/

jackrae

Your attenuation formed by the 10mF and the 1 k resistors might be part of the problem.  You need to increase the loading impedance so try using 10k rather than 1k resistors.

dc42

If that scope is set at 2.5ms/div then the predominant frequency of that signal has a frequency around 60Hz. A 10uF capacitor has an impedance of around 250 ohms at that frequency. With 2 x 1K resistors, you are providing a load of 500 ohms, so you are losing a significant proportion of the signal, and also shifting its phase as you can see on the scope. Increasing the resistors to 22K each will cut the signal loss to a few percent.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

twilliamson

Yes it is a 60 Hz Signal its actually a 1000watt incandescent light bulb. I will try that with the 22k's this morning and see if that helps. Does the code look ok? Should it be working...
Tripp Williamson
KG4UAL

dc42

The main problem with your code is that the Serial.println() code increases the interval between readings, which might cause you to miss the peak. Increasing the baud rate to 115200 will alleviate but not entirely eliminate the problem. Alternatively, change your code so as to track the peak and only print it when it hasn't increased any more in the last few seconds.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up