This is version 1.0 of the mains AC energy monitor, the current version version 3.0 can be found here

 

This method of measuring mains AC electrical energy use is quite nice, it doesn't require any breaking of the mains wire, which makes it nice and safe, you just clip-on to the wire a sensor called a current transformer (CT) that measures the current flowing through either the live or neutral mains wire. It does this by measuring the magnetic field that surrounds the wire, created by the current. The simplicity of just clipping on the sensor means that it can be used to measure the electrical energy used by the whole house. It a method used by many commercial devices that you can buy.

How it works

The electronics only physically measures current which is measured using a CT sensor which produces a small secondary current that is proportional to the current in the mains wire. In the case of the efergy elite sensor the secondary current is 1500 times smaller than the current in the mains wire. A small resistor is then placed in parallel with the CT to produce a voltage proportional to this current. The voltage is then biased (shifted up) by 2.5V using a voltage divider. This allows you to measure both the negative and positive component of the waveform due to 0 -5V input requirement of the Arduino.

The program on the Arduino then calculates the RMS current and with a manually entered value for RMS Voltage (230V in the UK, 110V in the US) it can calculate a value for apparent power. More on this program detailed below.

There is also an alternative experimental arduino program that can calculate in addition real power and powerfactor by synthesising a voltage waveform that is in phase with the peak of the current waveform – this gives the same result as the main program for all normal real loads like heaters and incandescent lightbulbs but can accurately calculate the power factors of less than 1.0 for loads with non-linear current draws such as laptops but does not work for “real” reactive loads such as washing machines and fridges. For more information and the code for this visit this page.

How to build it

Circuit Schematic


 

Components required


 

I got an email from Seeedstudio who kindly offered to cater for any parts for this project, they currently stock 1 current transformer sensor that has current output: 100A CT  $9.78 and are working on an arduino datalogging project called Seeeduino Stalker. I haven't had the chance to test their sensor so I would recommend going for the efergy if you have a choice.

  • 6way header (To broken down in to 1x 1pin, 1x 2pin and 1x 3pin for Sheild-Arduino connection)    farnell £0.162
  • 10way sockets (To be divided in two) farnell
  • Stripboard farnell -£4.73 (you will have a lot left over for other projects)

Total cost of build: £35.76

Step 1

Place the header pins through the stripboard. First you will need to move the little plastic bit to one side of the pins. Make sure that the single pin goes to Arduino analog in 0, the double pin to GND and 5V and the triple pin to Arduino digital in/out pins 5 to 7.


 

Step 2

If you would like to connect up a 7 segment display or make the digital pins below the stripboard accessible for any other reason: Insert and solder in the first 5way socket connector nearest to the digital pins. The second header is used to place Rsens in a way that it can be changed so that you can change the range of current that can be measured.

Hint: To keep it in place while soldering use a couple of striped bits of wire about 5mm longer than the header then insert in to headers and then insert other end into breadboard.

Note: When building the board and taking the pictures I for some reason soldered in the second header after stage 4 but there's no reason why it shouldn't be done at this point.

Step 3

Place and solder both 100kOhm resistors used for the biasing voltage divider.


 

Step 4

Place the 100Ohm resistor used as a current limiter.


 

Step 6

Place the 3.5mm jack used to connect up the efergy CT sensor. I found you can cut off the side pin on the jack and just keep the one at the end and the one on the bottom.

Step 7

Place wire jumpers that route 5V and GND along to the 7 segment display socket.


 

Step 8

Remove some of the copper track. There are 6 breaks to make as in the picture below (let me know if its not clear enough) you can do this with the stripboard tool or a small drill bit.


 

Step 9

Connect the mini shield to the arduino making sure that its inserted into the correct pins as described in step 1.


 

Step 10

Connect up the CT sensor.


 

Step 11

Once your happy there are no shorts and everything is looking good connect it up to the computer the arduino power light should be on as usual and hopefully nothing will be smoking :)

right on to the software

Software side

Step 1 – Arduino software:

Download the Arduino sketch here

Step 2 – Computer side

  1. Download the ArduinoComm java program here.

  2. Unzip ArduinoComm.tar.gz

  3. Compile the program by typing $ javac *.java

  4. Run the program with $ java Program

For a 'How to' on compiling and running java programs have a look here. (It also details installation of rxtx library)

For more information about ArduinoComm visit this page

If its all working you should see something like this appear in your terminal window:

153.25 230.00 0.63
126.76 230.00 0.62
128.24 230.00 0.63
....

From left to right we have: apparent power, rms voltage, rms current.

Now clip the sensor around the live wire of a test power strip as in the picture below and connect up some a load something in the 100W range. The value for apparent power and Irms should go up but you may need to calibrate as described below to get accurate values.

Calibration

The values coming out of the sensor probably wont be correct if you compare it with a commercial plug in meter even if you use the a 100Ohm resistor and the same CT Sensor as specified above. I have a couple of CT sensors now and each one seems to give slightly different results from the other as if they have not been coiled with the exact same amount of secondary windings.

So to calibrate you need to get a plug in meter like this one that can measure the RMS current and create a spreadsheet of RMS current values measured by the plug in power meter versus RMS current values measured by the method above for different combinations of lamps, laptop, small heaters etc. Then create a scatter graph of the data points with the commercial meter on the y-axis and the method above on the x-axis and then plot a line of best fit (hopefully the data points should lie pretty close to the line). Now take the equation of the line which should be in the form y = mx +c and enter it in to the arduino sketch by modifying the following variables factorA and Ioffset at the top as follows:

double factorA = 15.2 * m ;

double Ioffset = -0.08 + c ;

Note: factorA here is equal to the CT sensor reduction factor divided by Rsens and so if you placed a 100Ohm resistor in as your Rsens you can work out how many secondary windings your CT sensor has.

Now if you compare the RMS current values again they should now be in better agreement.

Extend it

Next you may want to test it and then do useful things with it by extending it.

Changes since last version

November 5th 2009

Id like to thank Peter and Ed who posted below for pressing me on the voltage synthesis and suggesting I look at more traditional reactive loads like the washing machines or fridges instead of only laptops which even though their powerfactor is less than 1.0 aren't really reactive. The above version does not now feature any voltage synthesis just Irms and apparent power calculations (from a manually set Vrms value). I have relegated the voltage synthesis info to another page here in-case it is of any interest to anyone.

pineapple's picture

I want to see your code please (SCT-013-030)

I can't run my code

Luciano M.'s picture

wireless

I would read a variable to CT sensor and after send data to rf 315 Mhz tx. Read the stream trought virtualwire library due to the rx 315 Mhz. It's possible?Thanks

TrystanLea's picture

re: wireless

Sure that should be possible, check out this page here: http://openenergymonitor.org/emon/node/118

Todd Page's picture

SCT-013-030

First, I am new to this.

I have been working with version 1 using a YHDC SCT-013-030 CT with th e 4 resistor. This is the readings that I am getting back on a 120V 60Watt light, via the serial monitor. Does this seem correct?

-7.96C 120.00D -0.07E <= Started Serial Monitor
-7.16C 120.00D -0.06E
-1.61C 120.00D -0.01E
-4.60C 120.00D -0.04E
0.31C 120.00D 0.00E <= turned on the light
5.51C 120.00D 0.05E
9.84C 120.00D 0.08E
12.12C 120.00D 0.10E
11.58C 120.00D 0.10E
11.51C 120.00D 0.10E
11.75C 120.00D 0.10E
11.81C 120.00D 0.10E
11.47C 120.00D 0.10E
11.47C 120.00D 0.10E
11.76C 120.00D 0.10E
11.47C 120.00D 0.10E
11.69C 120.00D 0.10E
11.59C 120.00D 0.10E
11.85C 120.00D 0.10E
11.87C 120.00D 0.10E
12.05C 120.00D 0.10E
12.61C 120.00D 0.11E
12.30C 120.00D 0.10E
3.33C 120.00D 0.03E <= turned off the light
-0.19C 120.00D -0.00E <= turned off the light
-0.01C 120.00D -0.00E
-0.36C 120.00D -0.00E
-1.13C 120.00D -0.01E
-0.46C 120.00D -0.00E
0.24C 120.00D 0.00E
-1.06C 120.00D -0.01E
-0.37C 120.00D -0.00E
-0.87C 120.00D -0.01E

I did look at the spec sheet (http://nicegear.co.nz/obj/pdf/SCT-013-datasheet.pdf) and I notice that there is a built in load resistor.

pineapple's picture

Hello !!

I want to see your code please

TrystanLea's picture

Re: SCT-013-030

Looks promising. Did you remove the burden resistor from the circuit? Id recommend using the new energy monitor code on MainAC3.0 (voltage and current sensing) or current only here http://openenergymonitor.org/emon/node/54

The offset removal method is better in the later version and may sort out your slightly negative readings.

Gix's picture

Hello again, i gave up trying

Hello again, i gave up trying to use PIC, and bought an Arduino.

Please can you explain which circuit is correct? the one on this page that uses 4 resistors, or the one that uses 3 resistance and a capacitor, as shown here

http://openenergymonitor.org/emon/sites/default/files/DetailedSystemDesi...

so far i have no luck getting results out.

is there any way of testing with a multimeter? Volts? ohms?
using the circuit in this page gives 2.45V in the output pin, but no change when i turn ON the lights.

please help, specially on the "which layout to use"

thanks a lot !

If anyone has bought a CT do you know the piout of the jack?

btw. its not a 3.5mm jack, its a smaller one. maybe u can update the page.

thanks

TrystanLea's picture

Hey Giz The correct and

Hey Giz

The correct and latest build can be found here: http://openenergymonitor.org/emon/node/58 can be found by going to: main page/ input modules / Mains AC: non-invasive 3.0 / how to build it

Have you separated the live and neutral wires as in the picture in the page I linked to? Do you have a multimeter with AC Voltage measurement? It is easy to test with that.

I recommend just cutting the jack off and wiring straight into screw terminals or just straight into the breadboard for prototyping.

Trystan

 

 

Gix's picture

Thanks Trystan for your

Thanks Trystan for your reply, i got totally confused with so many codes and different wiring circuits.

Whilst i try to make things work. i have seen you have used ethernet arduino card.

have you noticed the voltage drop it creates? does it affect your results? cause in my case i get totally different values with the ethernet board connected and disconnected.
without ethernet...aprox 5Volts
with ethernet ... aprox 4.44Volts

this confuses my results.

any idea?

thanks again.

Gix's picture

sorry for yet another

sorry for yet another message. i think i have figured out what happened. i was using usb to power the arduino. seems that the usb has not got enough power to supply the arduino and the ethernet and therefore the voltage dropped. i have connected a 6V, 700mAmps power supply.

so far no voltage drop. will start to check now if CTsensor readings are correct, recalibrate and cross fingers.

once again. thanks alot

TrystanLea's picture

Another suggestion, sometimes

Another suggestion, sometimes it can be useful to see the waveform coming of the circuit, I put together a program here to do that: http://openenergymonitor.org/emon/visampler

Gix's picture

I need some help to fully

I need some help to fully understand the code for this 1.0 version. I am converting the code to use my PIC16F690 from Microchip.
i have some troubles with doing the calculations inside the hardware but for now i want to fully understand the code as the calculations are being done by a Visual basic.net software i have written.

so, please could you explain a bit the most confusing variables. and the program parts?
example:

I understand this. It gets the value returned by the analogRead and converts it into the voltage read by the arduino,right?
The Arduino turns ....The ADC therfore has a 5V / 1024 = 4.8mV sensitivity (It can detect changes in the input voltage of 4.8mV).
http://openenergymonitor.org/emon/node/9
//Voltage at ADC
Vadc = value * ADCvoltsperdiv;

why do we need to calculate every 1000 times the VDoffset? Isnt the offset related to the resistors used in the circuit, and this are fixed values?
//Remove voltage divider offset
Vsens = Vadc-VDoffset;

not sure why this?
//Current transformer scale to find Imains
Imains = Vsens;

why this?
//Calculates Voltage divider offset.
sum1i++; sumVadc = sumVadc + Vadc;
if (sum1i>=1000) {VDoffset = sumVadc/sum1i; sum1i = 0; sumVadc=0.0;}

why this?
//Root-mean-square method current
//1) square current values
sqI = Imains*Imains;
//2) sum
sumI=sumI+sqI;

please please please can you give me some "basic explanation" so I can understand things better. I dont like copy/paste without knowing whats happening.

thanks a lot

TrystanLea's picture

 I see your looking at the

 I see your looking at the old code here Giz, have a look at the new code I linked to in the previous post, it has a better offset calculation method. And yes your absolutely right that the offset is related to the resistors in the circuit, the problem is it is really quite hard to measure this offset accurately, and if the offset is a little out the measurements will be very inaccurate. The offset calculation provides a way to obtain better accuracy.

To understand how the rest of it works please read this page: http://openenergymonitor.org/emon/node/61 and this page http://openenergymonitor.org/emon/node/62 . Measuring AC power is quite a complex thing so good effort!


TLL's picture

Sorry for my noobness but,

Sorry for my noobness but, I'm not understanding how the ct sensor is connected... isnt the ct sensor connector a 3.5mm audio and the added female plug is a 3.5mm power with a pin in the middle?
Really confused here lol

TrystanLea's picture

:) yes, the efergy CT's used

:) yes, the efergy CT's used to come with the power jack plug type but they have changed now to 3.5mm audio plugs... not sure why...

Gix's picture

just ordered an efergy CT

just ordered an efergy CT sensor with the jack connector. Which two pins are required to be connected? the third one is left unconnected?

thanks

TrystanLea's picture

Hey Giz, not sure what pins

Hey Giz, not sure what pins are the ones to be connected, I cut the jack plug off my CT's and just connected the wires via skrew terminal. Have you got a multimeter? Try measuring the voltage across the pins, to find which ones are connected.

Guest's picture

First off, thanks for all

First off, thanks for all your hard work. Is there any way to do a very simple version of this without using Java?

Thanks

TrystanLea's picture

 Hello, using the Arduino

 Hello, using the Arduino serial monitor is probably the simplest way of reading the output. If you prefer not to use java, it may be worth looking at processing, there are some guides on interfacing between the arduino and processing on the arduino website. Which part of the java software do you think could be simplified?

Maarten's picture

Hi there! First, I'd like to

Hi there!

First, I'd like to say this is a brilliant project! I’m new to this but I want to try it out for myself by making a prototype.
Therefore, I bought a CT Sensor (SCT-013-030 (www.seeedstudio.com/depot/noninvasive-ac-current-sensor-30a-max-p-519.html)) at Seeedstudio. Afterwards I concluded there is only one version that gives a DC output (SCT-013-000). Therefore, I have to convert the AC to DC. However using my SCT-013-030 around a power cord of a turned-on 2000W device, I’m not able to sense any AC using my multi-meter or oscilloscope. What goes wrong? How can I fix it?
I hope you can help me out. Thanks in advance,

Kind regards,

Ps. I’m living in the Netherlands, so we use 230V @50Hz

harisdmac's picture

Hi, I am having a similar

Hi,

I am having a similar problem with a different CT though. Are you connecting your multimeter directly on the output wires of the CT? Have you tried to connect first a small resistor (e.g., 100 Ohm) and try detect any current or voltage in parallel? And what are you trying to measure directly? AC current or AC voltage?

One idea might be that the current flowing is so small that you cannot get any value out of it. Only if you try the circuit on the diagram on this page (or of the version 3 ) then you might be able to read something in arduino.

Thanks and hope you find a solution to this.

TrystanLea's picture

Hello Maarten and

Hello Maarten and harisdmac

Good troubleshooting questions and suggestions harisdmac thanks for helping out! my first thoughts Maarten is are you clamping your CT around the whole cord, neutral+live?, as this would give you no AC output on the multimeter as the magnetic field from the neutral would combine with the live and cancel out. The live and neutral wires need to be seperated and CT clamped around live or neutral only.

All the seedstudio CT's produce AC outputs. SCT-013-000 is like the efergy sensor it does not have a sense resistor (burden resistor) built in and so for that CT a sense resistor needs to be added, to convert the proportional current output to a proportional voltage output. All the other CT's in the seedstudio range produce voltage outputs, these CT's have a sense resistor already build in and so there is no need to add one as in the circuit above.

Since your CT is the SCT-013-030 the output is a proportional voltage so try setting your multimeter to AC voltage, you should get about 0.290V rms with a 2000W load. Let me know if you have any luck

harisdmac's picture

Hi Trystan, Thanks for the

Hi Trystan,

Thanks for the quick reply and the helpful hints. Indeed my case was that I was clamping the CT around the whole cord. The funny thing is that it worked on the phase cable (reasonable) but I thought it was because more current was floating through! The auto-canceling thing never crossed my mind! :P
So in order to avoid any other questions like this, maybe you should update the tutorial with a memo for beginners stating that in case one tries the CT first on a device at home, one should separate the cord and use live or neutral wire only!

Alan's picture

Hey, I'm using the Irms value

Hey,

I'm using the Irms value from the Energy Monitor to control the flow of water from a 12v pump. I want the flow of water to represent the energy being used in my home. I'm sending the Irms value to digital pin 9 which then controls the pump. A schematic of my project can be found at http://alanmeany.wordpress.com/2010/03/01/ambient-energy-monitor-schematic/. The problem is that when the pump starts running it is affecting the Irms value.

Because I am using the Irms value to change the flow of water the value itself does not need to be accurate, it could be any number that changes when appliances are turned on and off.

Would you have any ideas how I could:

(a) Change the code so that the pump does not effect a value being read form the CT Sensor.

OR

(b) Rewire the circuit so that the pump does not effect the Irms value.

Any help would be greatly appreciated!

TrystanLea's picture

 Hey Alan  by how much does

 Hey Alan 

by how much does the value change? 

you could add another transistor between the PWM output and the TIP 121 which would reduce the load the TIP121 is putting on the arduino, which may then reduce the effect it is having on the Irms value. Or yes Im sure you could do something in software especially if the change is always the same: if (pumpIsOn==1)  Irms = Irms - change;

I like the sound of using the flow of water to represent energy use, that would be really cool!

Alan's picture

Trystan, Thanks for the reply

Trystan,

Thanks for the reply but I do not think it will be a solution to my problem. I will use the following simplified example to explain.

If Irms is at 0 the pump is off. When I turn on a light and Irms rises to 5, the pump starts to gently flow to represent a small current flowing(the light). But when the pump does this it then increases the Irms value which then in turn increases the flow of water. Even if I say Irms = Irms - change; this new value will be changed when the pump comes on therefore turning the pump on more and keeping it on even if the light is turned back off.

If I do reduce the load the TIP121 is putting on the Arduino, the pump still gradually starts effecting the Irms value.

I was considering using the value straight from analog 0 (because the pump turning on and off should not effect this value?) but when appliances are turned on this value doesn't just rise it fluctuates up and down (like a wave).

Ideally I would like to be able to control the pump off a different arduino than the CT Sensor so that it cannot interrupt the Irms value, but I do not know if this is possible. Sending the value being read by one arduino to the computer and then from there to another arduino that controls the pump?

TrystanLea's picture

 I see a bit of a problem....

 I see a bit of a problem.... not sure what the best way to go and why its doing that, all I can suggest is trying to reduce the load on the arduino with yet more transistors? If I think of anything else I will let you know.

You could quite easily communicate between two arduino's. Create a software serial port on each arduino assign pins like for example RX =2 and TX=3 and connect the RX of one arduino to the TX of the other and vice versa. You will also need a wire between both arduino grounds. Then just serial print values between them. Let me know if you need any more help with that.

 

Alan's picture

I have been working on the

I have been working on the communication between the two arduino's. The good news is that when the pump is running off a seperate arduino it no longer effects the Irms value. I'm using the following code to send a value from analog 5 on Arduino 1 (Sender) to control the pump on Arduino 2 (Receiver). Now that I have this working I want to replace the value of analog 5 with Irms value (Sender) and control the pump (Receiver), but I am having problems ....again.

//Sender

int analogValue5, val5;

void setup() {
// Serial port enable
Serial.begin(19200);
}

void loop() {
// read analog pin 5
analogValue5 = analogRead(5);

// remap values from the analogValue5 variable to 0 / 255
val5 = map(analogValue5, 0, 1023, 0, 255);

//send the value to the serial port
Serial.println(val5, BYTE);

}

//Receiver

byte incomingByte;

void setup() {
// Serial port enable
Serial.begin(19200);

// declare pin 11 as output, this is the LED
pinMode (11, OUTPUT);

}

void loop() {

// if there is bytes available coming from the serial port
if (Serial.available()) {

// set the values to the ‘incomingByte’ variable
incomingByte = Serial.read();

// write the value to the pin 11
analogWrite(11, int(incomingByte));

}
}

Although I got this code working I cannot get it to work along with your code, for example to send Irms value instead of analog 5 value to control the pump. Sorry for all the questions but I'm a bit of a newbie and now that I got this far I don't want to stop. If you could just give me any advice on how to change this code to work with yours so that I can send the Irms value instead of analog 5 value?

Thanks again for all your help.

TrystanLea's picture

Hey Alan Could you do the

Hey Alan

Could you do the calculation with my code on the first arduino and then send the Irms value instead of the analog read value to the second arduino? I think you'd get a faster sample rate that way and it may simplify things a little.

I wrote a bit of code to send Irms, Vrms, values etc from my measurement arduino to the ethernet arduino via xbee. But it will work with a wire connection just the same.  If you download the ethernet sketch here:

 http://openenergymonitor.org/emon/sites/default/files/EthernetSketch27Jan.tar.gz

values are sent from the measurement arduino as a stream of characters and so the ethernet sketch converts this steam of characters back into values that you can then use, have a look through it and let me know if anything doesn't make sense.

Trystan

Alan's picture

I'm getting an error when I

I'm getting an error when I upload the sketch:

http://openenergymonitor.org/emon/sites/default/files/CTmethod.pde

error: expected ',' or ';' before 'double' In function 'void loop()':

How do I fix this?

TrystanLea's picture

Hey Alan There was a missing

Hey Alan

There was a missing ; in the sketch, I've corrected it now, let me know if you still get the problem.

Trystan

Steven's picture

I've built the the non

I've built the the non invasive home energy controller, but the thing is i'm not looking to connect the CT to the main. I want to connect it to like a external receptacle to measure the current of a single device much like kill-a-watt or something similar.

I have a CT rated for less than 60A with output at 0.333Vac. I was looking at the arduino sketch and i was wondering how does setV change? because from the example setv prints
242.62
243.17
242.90
??

Also can you explain the ADCvoltsperdiv= 0.0048? how do we arrive this number and why do we use it?

TrystanLea's picture

Hey Steven, I see the mistake

Hey Steven, I see the mistake I made on the page, sorry yes the sketch should just output a fixed 230.

This sketch should do that:

http://openenergymonitor.org/emon/sites/default/files/CTmethod.pde

The ADCvoltsperdiv= 0.0048 is the ADC voltage range (0 to 5V) divided by the ADC resolution 1023. ADCvoltsperdiv  = 5V / 1023 = 0.0048

If you dont want to measure the whole house, the easiest way to measure from an outlet, is to get a small extension cable or 4-bank and take a small section of the outer sleeving off the cable leaving the 3 inner cables with their insulation sleeving intact. Only do this if your completely happy you know what your doing. The picture at the top of the page shows what I mean.

 

Steven's picture

Trystan, So how do we measure

Trystan,

So how do we measure the resolution? is it generally? This is from a oscilliscope?

I have a 2 bank receptacle and that's what i'm using this AC non invasive method to measure the current.

I still have some configurations to make.

TrystanLea's picture

 Hey Steven, The resolution

 Hey Steven, The resolution is a property of the Arduino's ADC (Analog to digital converter)  it isnt something we measure. The Arduino ADC is a 10bit ADC 2^10 = 1024. We divide by 1023 since there are 1023 spaces inbetween the 1024 divisions. Here's a couple of pages that might be worth reading:

http://www.arduino.cc/playground/CourseWare/AnalogInput

http://en.wikipedia.org/wiki/Analog-to-digital_converter

The 2 bank receptacle sounds ideal! Let me know how you get on

 

Steven's picture

Trystan, do you think the

Trystan,
do you think the arduino sketch you have will work the same on my 2 bank receptacle? The readings its giving me are totally off. I was wondering if you have any input.

I plugged in a toaster and I have a fluke power meter that's telling me the toaster was 6A rms but the arduino was outputting 0.244 Arms.

TrystanLea's picture

 Hey Steven, have you

 Hey Steven, have you calibrated the energy monitor? Make a table of rms current values from the energy monitor and their corresponding rms current values from the fluke meter. Then create a scatter plot your spreadsheet program with the energy monitor values on the x-axis and the fluke values on the y-axis. Then plot a line of best fit and get the equation. 

The equation of the line is of the form y = mx + c. Find the line in the arduino sketch that sets factorA and multiply factorA by m giving you a new value. Add c to Ioffset.

Let me know how that goes

Steven's picture

Hi, For current transformer

Hi,

For current transformer circuit, if i'm not using a 7 segment display can i just remove the 5V input power and the 2 100k resistors? and connect the bottom branch straight to ground? or are these that important?

TrystanLea's picture

Hey Steven, the 2 100k

Hey Steven, the 2 100k resistors are important, they form the voltage divider that biases the signal from the CT by 2.5V to keep the signal from the CT within the 0 to 5V analog input range required by the arduino.

If you dont intend on having a display you dont need the little wire jumpers and the 5way header on the far left side that can be seen in this picture: http://openenergymonitor.org/emon/sites/default/files/B08.JPG 

Does that make sense, sorry if its not so clear.

Steven's picture

Trystan, So i calibrated the

Trystan,

So i calibrated the CT and it measures current a bit better, I'm going to re-do the calibration and hopefully that will make it within +/-5A error, I was just wondering do you think it's possible to measure the Vrms? instead of having in constant without having to build that extensive circuit that you have in the non-invasive that measures voltage and current?

Steven's picture

I've built the the non

I've built the the non invasive home energy controller, but the thing is i'm not looking to connect the CT to the main. I want to connect it to like a external receptacle to measure the current of a single device much like kill-a-watt or something similar.

I have a CT rated for less than 60A with output at 0.333Vac. I was looking at the arduino sketch and i was wondering how does setV change? because from the example setv prints
242.62
243.17
242.90
??

Also can you explain the ADCvoltsperdiv= 0.0048? how do we arrive this number and why do we use it?

Louis Beetge's picture

Hi Trystan I eventually

Hi Trystan

I eventually bought an efergy CT an got my meter working. I also hooked up a 16x2 LCD display that scrolls through the different readings with a pushbutton. So the next step for me is to build the voltage sensing circuit. I'd just like to say thank you for your help so far.

I have one question. When I read the current from my power meter (for my desktop PC), I get a reading of say 0.81A. I borrowed a friend's clip on DMM and this gives a reading of about 0.63A. However, when I hook up a 2000W hairdryer, my meter gives a reading of about 5.45A, and the DMM gives a reading of 7.8A. Could this difference be because my meter is measuring Irms and the DMM is measuring Ipeak or should I be concerned about my meter's accuracy?

I can't find a datasheet on the DMM. It's a MajorTech MT750. It seems to be a discontinued meter.

Any help and insight would be much appreciated

Louis

TrystanLea's picture

Hey Louis Great to hear that

Hey Louis

Great to hear that you have got it working!, the LCD sounds really good! Do you have any pictures of your setup? If you'd like to share what you have done I can add you to the blog if you like? just send me an email.

To answer your question about the DMM. I also had a go at measuring with a DMM and found it to be very different, I think a lot of DMM's do only measure Ipeak/sqrt(2) not Irms. Do you have a plug meter that measures Irms to compare it with?

Trystan

 

Joachim's picture

Hi again, I have the

Hi again,

I have the Seeedstudio 100A ct sensor, and I have calibrated it on a circuit of 1kW. However when I clipped it to my mains intake, I got a hum,ming noise and measured the signal to 5.5V AC. Shifted up 2.5V that would certainly fry my Arduino, right? Has anyone else used that sensor?

TrystanLea's picture

Hey Joachim. That doesn't

Hey Joachim. That doesn't sounds to good! Your right 5.5V+2.5V will be no good for the arduino. What size resistor have you connected in parallel to it?

The measured signal can be decreased by decreasing the size of the resistor in parallel with the CT. Im using a 56 Ohm resistor for measuring the whole house. Gives me a range of 0 - about 10kW. At 10kW the rms Voltage across the resistor is about 1.75V (peak voltage 2.5V)

Joachim's picture

Thanks again, I will change

Thanks again,

I will change the resistor before I conect it to the arduino. Can I assume the seeedstudio one have about the same conversion factor as yours? I cannot find a datasheet...

The humming noise, is that normal?

Joachim

TrystanLea's picture

Well I dont get any humming

Well I dont get any humming noise, so I dont think its normal... From their website it says: "Output mode:  Current/33mA" I took that it meant 33mA at max current 100A which would work out to be a conversion factor of 3030. Lets say you wanted to measure 1V rms at 1kW then you need a 720 Ohm resistor across it. With a 100Ohm resistor and a 1kW load you should measure 0.14V. Do you get this?

Can you measure the rms current flowing in the circuit consisting of just the CT and the resistor?

Joachim's picture

Hi and thanks for a wonderful

Hi and thanks for a wonderful and inspiring site. I notice that you are using one clamp only, and there's another site using two clamps (http://www.picobay.com/projects/2009/01/real-time-web-based-power-charti...). I am thinking of monitoring the power use in my home, and clamping the device(s) at the mains intake (before the breakers). I live in Norway, using 240V 50Hz. Is one clamp enough? I am struggling a little with the theory here. And I think I will try without the phase changes in the first place (although we use the washing machine constantly...), but could I measure the voltage in one outlet instead of in the breaker box?

Joachim

TrystanLea's picture

Hey thanks Joachim! From what

Hey thanks Joachim! From what Jason says he is using two clamps because: "in most US homes, the electricity comes in as 220v on 3 main lines. Some appliances, like ovens and clothes dryers, are connected to these 220v lines directly. However, by using just one of the lines, the power is reduced to 110v for all the wall outlets. Usually, a home’s electrical wiring is divided into two sections. One line (known as a leg) powers one section of the home and the other line powers the other side. To get the total power usage in my house, I put an AC clamp on both legs and added the measurements together."

It seams that in my home I can put a clamp over one wire and measure all electricity consumption in the house and so if you have similar wiring to what I have you should be fine with one.

As for voltage yes you can certainly measure it at one outlet, I dont think you would want to measure it in the breaker box... I have been using a standard step down AC to AC transformer pluged in to one of the house outlets to measure voltage recently, something I intend to write up here as soon as I can. Maybe if you want have a go at the current measurment first and add the voltage measurment later?

Trystan

Louis Beetge's picture

Hi there First off, let me

Hi there

First off, let me say that this is my new favourite site on the net!

I would really appreciate it if you guys could help me out. I am a total newbie when it comes to electronics.

I have a CT which is very similar (if not identical) to this one: http://www.magnelab.com/catalog/sct_0750.php.
It's a 150 Amp CT which outputs 0.33 Vac at rated amps instead of current. I got it from a friend, so I thought I would try it out with my shiny new Arduino. :)

How would I be able to hook this up to the Arduino? Would I need to install a bridge rectifier to turn the Vac output to DC? Does it then still need to be biased up?

If so, could anybody help me out with a circuit diagram to explain?

Any help would be much appreciated.

Louis