Go Down

Topic: current sensor (Read 3 times) previous topic - next topic

Joablen

@retrolefty: thats what I thought but I tried the code from the guys at openenergymonitor.org at it didn't work either...

here's the code I got (http://openenergymonitor.org/emon/buildingblocks/arduino-sketch-current-only)
Code: [Select]
#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance

void setup()

  Serial.begin(9600);
 
  emon1.current(1, 111.1);             // Current: input pin, calibration.
}

void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
 
  Serial.print(Irms*230.0);        // Apparent power
  Serial.print(" ");
  Serial.println(Irms);        // Irms
}

johnwasser

Code: [Select]
void setup()

  Serial.begin(9600);
  emon1.current(1, 111.1);             // Current: input pin, calibration.
}


I sure hope that '1' means analog input pin 1 (A1) and not digital pin 1, a.k.a. Serial TX.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Joablen

sorry forgot to change that to A0 before posting... the code I used was with A0 which is the pin I'm using...

dhenry

Quote
all I'm getting is 511 or 512 values both when the TV is on and off...


That value makes sense, right: it comes from Rvd dividing the 5v Vref.

The signal from your current sensor is going to be very low: how low? it depends on your ct design and likely in the mv range. You should have it amplified to be detected by the arduino. This can be done via a simple amplifier.

How to detect the amplified signal will be a matter of implementation. For example, you can detect the presence of 50/60hz voltage; or if you have rectification, you can detect the rectified dc voltage...

You should analyze the pros / cons of each approach and pick one that suits your needs.

Nunov

Hi,

Did you tested the sensor itself? How?
Are you sure it is working?

I'm working in the same project from the energy monitor website, but i bought a current sensor ( see here: http://arduino.cc/forum/index.php/topic,125863.0.html ), but i'm having a bad time to calibrate it. The value given in the datasheet doesn't give the right current value... I'm now finishing to connect a energy meter that gives me the current value to check what is wrong.. I hope.

Go Up