Arduino Forum

Using Arduino => Project Guidance => Topic started by: fatopato on Jun 29, 2015, 05:33 pm

Title: Arduino Current Measuring Project
Post by: fatopato on Jun 29, 2015, 05:33 pm
Hello, I am trying to measure current with Arduino by using non-invasive curent sensor:
https://www.sparkfun.com/products/11005 (https://www.sparkfun.com/products/11005)

That sensor has 30A max current value. Therefore I calculated burden resistor as it is mentioned at:
http://openenergymonitor.org/emon/buildingblocks/ct-sensors-interface (http://openenergymonitor.org/emon/buildingblocks/ct-sensors-interface)

And I found ideal Burden resistance as : 117,9. Then I used 2*56=112 Ohm Resistors to get approximate value.

Then I build that circuit and run the code (I changed 33 Ohm resistor with 2*56 Ohm):
http://openenergymonitor.org/emon/buildingblocks/how-to-build-an-arduino-energy-monitor-measuring-current-only (http://openenergymonitor.org/emon/buildingblocks/how-to-build-an-arduino-energy-monitor-measuring-current-only)

There are some results but even though I unplug the sensor it keeps measuring similar value. Also Irms value is about 200 all the time. Is that normal or what causes the error?
Thank you

Title: Re: Arduino Current Measuring Project
Post by: fatopato on Jul 01, 2015, 11:56 am
Is that because of calibratiom or the circuit?
Title: Re: Arduino Current Measuring Project
Post by: TomGeorge on Jul 01, 2015, 12:39 pm
Hi,
Can you post a picture of your project.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
They are made with the  </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Tom.... :)
Title: Re: Arduino Current Measuring Project
Post by: fatopato on Jul 01, 2015, 03:09 pm
This is the circuit:
(http://openenergymonitor.org/emon/sites/default/files/currentOnly_bb.png)


This is what i have done:
http://i.imgur.com/NPKSihH.jpg?1

When i connect sensor to circuit, results around: 32 A
When i disconnect it, results around 9 A
when i disconnect A1 input pin, results around 3 A

Code: [Select]
#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance
 
void setup()

  Serial.begin(9600);
 
  emon1.current(1, 17.9);             // Current: input pin, calibration.
  //calibration is explained bellow
}
 
void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
 
  Serial.print(Irms*230.0);         // Apparent power
  Serial.print(" ");
  Serial.println(Irms);          // Irms
}
Title: Re: Arduino Current Measuring Project
Post by: DrDiettrich on Jul 02, 2015, 05:07 am
Try to dump the raw A1 values. analogRead(A1) should be constant (~512) with the sensor removed.
Title: Re: Arduino Current Measuring Project
Post by: TomGeorge on Jul 02, 2015, 10:05 am
Hi,
Find attached a schematic of  your project.
The circuit biases the current transformer so with no current V1 has half Vcc or 1/2 of 5Vdc= 2.5V.
When AC is conducted through the transformer, the output will be an AC signal on the 2.5Vdc.
The library converts this reading to RMS.
With the coil disconnected your should have 0 Arms.

Tom.... :)
As you may gather I have an aversion to fritzy diagrams, they  are not schematics, and do not very clearly show how a circuit works.
(Sorry schematic shows A0 not A1)
I hope  you aren't trying to measure DC Current, this unit only measures AC current.
Title: Re: Arduino Current Measuring Project
Post by: dave-in-nj on Jul 02, 2015, 12:54 pm
http://i.imgur.com/NPKSihH.jpg


you have lots of jumper wires to connect the different devices.


you have 10k highlighted but boxed over 2 resistors.
looks like they are supposed to be two to create a voltage dividor.    I assume that the note should be 2x10k


it also looks like the green jumper from the voltage divider is next to the yellow that connects to (or is supposed to connect to) the voltage divider.


I would re-visit that connection.
Title: Re: Arduino Current Measuring Project
Post by: fatopato on Jul 02, 2015, 03:57 pm
I just modified the circuit :
(http://i.imgur.com/ZculRSY.jpg)

Then results:
-when sensor is not connected: around 0.3A
-when sensor is connected: around 1.4A
-when A1 pin is disconnected : around 3A

What could be the problem?
Title: Re: Arduino Current Measuring Project
Post by: DrDiettrich on Jul 02, 2015, 04:15 pm
The problem can reside in the library or in your circuit. Try debugging without the library first.