Simple Arduino Home Energy Meter

121,022

652

76

About: The DIY Life is all about your next project. Be it a project to make improvements to your home, something fun to do or guiding you through a repair, The DIY Life will help you find it and give you step by st...

Intro: Simple Arduino Home Energy Meter

I was walking through the hardware store the other day and I walked past an energy meter which clips onto your home’s electricity mains and then provides you with information on your power consumption and cost estimates for the month. I thought it looked really cool until I saw the price, it was almost five times what I thought it would be! So I decided to try and build my own and Arduino was the perfect platform for it.

I had a look around online at what others had done but they all seemed to be a bit over complicated for a simple home application. Sure, for perfectly accurate measurements you need to monitor both the supply voltage and current but for simple household monitoring which gives estimates cost to the closest few cents, why not keep things simple.

So this meter measures the supply current to your home through a CT (current transformer) and then does a couple of calculations to give you your current, power, maximum power and kilowatt hours consumed. Its also really easy to add your local tariff and display the cost of electricity used to date.

This project assumes you know the basics of Arduino programming, otherwise read our article on getting started with Arduino, and that you know how to connect an LCD screen to an Arduino.

Step 1: What You Will Need for a Home Energy Meter

Here is a list of the items which you need in order to complete this project. The LCD screen is optional, it is obviously useful if you plan on permanently installing or using your energy meter however you can just make use of the Arduino serial interface to display the information.

  • An Arduino (Uno used here)– Buy Here
  • LCD Shield (Or LCD Screen, follow how to connect an LCD screen)– Buy Here
  • CT - Talema AC1030 or SCT-013-000 – Buy Here
  • 56Ω Burden Resistor– Buy Here
  • 10µF Capacitor– Buy Here
  • 2 x 100K Divider Resistors– Buy Here

The CT was selected based on a small household and should be suitable for most houses, if you cannot get the same one then you will need to adjust the burden resistor accordingly (details on resizing the components can be found in this link under the Choosing Different Components heading).

Step 2: Assemble the Components

First you need to start by assembling the components onto the CT or onto your breadboard in order to create your current sensor which produces a signal which your Arduino can understand. An Arduino only has analogue voltage inputs which measure 0-5V DC, so you need to convert the current output from the CT into a voltage reference and then scale the voltage reference into a 0-5V range.

If you are going to be installing your power meter somewhere permanently then you may want to solder the resistors and capacitor directly onto the CT so that they cannot come loose. If you are simply trying this project for fun then a breadboard is perfect.

The basic circuit for the connection of the CT to the Arduino is shown in the images attached.

The LCD screen shield already picks up on the analogue inputs but only A0 is used by the shield. Simply solder the three leads from your current sensor onto the pin headers on the shield and use A1 as your sensor input as shown in the attached image.

Once you have connected all of your components, you need to connect your sensor onto what you want to monitor. If you are wanting to monitor a couple of appliances then you should connect the CT onto the input lead of a multi-plug, anything you plug into the multi-plug with then be counted. Alternately, you can connect the CT directly onto your home’s mains supply and monitor the whole houses usage as has been done here. Either way, you need to put the CT around one of the supply cables, preferably the red “live” cable. Be sure to only put it around 1 as it will not work if it is around both and it can’t be connected around the earth wire (yellow, green stripped wire) as energy is not drawn through this wire. If you are connecting it to your mains, connect it to one of the output wires after the main breaker.

NB – Be careful when connecting the power meter to you homes mains and make sure that the power to your board is switched off before doing anything in the mains box. Do not remove any wires or remove any screws before checking with your local authority, you may require a certified electrician to install the CT for you.

Step 3: Upload the Sketch

Now you can upload your sketch onto your Arduino, if you haven’t uploaded a sketch before then follow this guide on getting started.

The code is shown in the attached images, here is the link to download the Energy Meter code.

Because your setup, CT , resistors and input voltage may be different, there is a scaling factor in the sketch which you will need to change before you will get accurate results, see next steps for calibration. If your LCD is connected to the same pins as used here and your CT is connected to the same input pin, you should at least get the screen populated with some figures although these will most likely be incorrect and some may be negative.

If you don’t want to use or don’t have an LCD screen, you can also modify the sketch to output to the Arduino IDE’s serial window as shown in the second image.

Here is the link to download the Energy Meter Serial Output code.

Step 4: Calibrate the Current Reading

As mentioned above, because your setup, CT , resistors and input voltage may be different, there is a scaling factor in the sketch which you will need to change before you will get accurate results.

To calibrate your energy meter, your need to be sure that the current that your meter says is being drawn is what you expect is actually being drawn. In order to do this accurately, you need to find a calibrated load. These are not easy to come by in a normal household so you will need to find something which uses an established and consistent amount of power. I used a couple of incandescent light bulbs and spot lights, these come in a range of sizes and their consumption is fairly close to what is stated on the label, ie a 100W light bulb uses very close to 100W of real power as it is almost entirely a purely resistive load.

Plug in a small light bulb (100W or so) and see what load is displayed. You will now need to adjust the scaling factor uses in the calculation line:

double RMSCurrent = ((maxCurrent – 516)*0.707)/11.8337

In this case it was 11.8337, it may be higher or lower depending on your application. Either use linear scaling to calculate this figure or, if you’re not good with math, play around with different values until the load you have plugged in is shown on the energy meter’s screen.

Once you have your energy meter calibrated, you reset it and leave it to do its job.

The first number displayed is the instantaneous current followed by the instantaneous power. On the bottom line, the kilowatt hours used since reset and then the maximum recorded power since reset.

Let us know if you have made this project or done something similar. We're always looking for quicker and easier ways to do things. Leave a full review in the comments section at this link to have some of your ideas added to our page.

Step 5: Autodesk Circuits Diagram & Simulation

Please note that Autodesk Circuits doesn't support a current transformer. A signal generator has therefore been used to generate an example signal however it is not really suitable for the application, therefore the displayed energy consumption is erratic, in practice this does not occur.

2 People Made This Project!

Recommendations

  • Furniture Contest 2018

    Furniture Contest 2018
  • Audio Contest 2018

    Audio Contest 2018
  • Fix It! Contest

    Fix It! Contest

76 Discussions

0
None
trm33

3 months ago

You are using only a CT and one ADC input, how you calculate power. because calculation of power needs a voltage input.

0
None
KahW1

Question 5 months ago

May I know how you set it as 11.8337 for scaling?

0
None
Anthony Lai

Question 5 months ago on Step 2

Hello, the circuit only detect current through CT. How about the voltage? How can you detect the voltage since it will fluctuate sometimes but not a fixed value.

0
None
tinac160

Question 6 months ago

Can you help me ?I'm having a hard time connecting the circuits to the lcd. SInce I'm not sure on what wire i should connect to it . Also I'm a little bit confuse on how i will connect the CT , can i just alligator clip the end of the the other components to its jock?

0
None
tinac160

8 months ago

Hi!, in my country the voltage used for appliances is 220 v. Can I use this project for my home or is it only compatible for US households?

1 reply
0
None
john henrytinac160

Reply 7 months ago

if you read the code comments its already set up for 220v AC.
110V users have to edit it slightly.
my area gets 120v as it varies but the US is generally 110-120V.
I would measure your actual Voltage with a voltage meter for additional accuracy.

0
None
john henryYouW4

Answer 7 months ago

you could program the Arduino to upload information to its own local web page and check it on the cellphone. (easy solution) there should be tutorials out there for it already.

0
None
KahW

Question 7 months ago on Introduction

May I see the overall connection of CT used. I mean physically

0
None
dogla

9 months ago

Hi, In my country we also use 2 phases (110V each) AND neutral. The 2 phases are being used for 220V equipment. So how to setup power measurement for whole house now? I can't simply measure neutral cuz for my 220V equipment current doesn't flow through neutral.

0
None
JofejemaP

1 year ago

hi, here in Canada like in the US we use two phases of 110V each. So to measure power accurately I would need to CTs. Can you suggest some and also let me know how the connections and code would change for handling two CTs?

best regards from Gatineau, QC

4 replies
0
None
thediylifeJofejemaP

Reply 1 year ago

Hi JofejemaP,

I could be wrong but I don't think you have two phases. You have two supply cables (live and neutral) which make up a single phase, you only need a single CT on one of the two wires. To modify the code for 110V, you just need to change the line with 220 to 110, everything else stays the same. Hope this helps.

0
None
doglathediylife

Reply 9 months ago

Hi, In my country we also use 2 phases (110V each) AND neutral. The 2 phases are being used for 220V equipment. So how to setup power measurement for whole house now? I can't simply measure neutral cuz for my 220V equipment current doesn't flow through neutral.

0
None
nicolasumarasJofejemaP

Reply 1 year ago

You could either buy to transformers or tap the neutral. You only need to monitor both phases if you have something that runs on 240V, in that case the electricity flow between the two phases and not through the neutral. If you don't have any 240v socket just use the neutral: everything that "comes" from both phases will flow trough the neutral.

0
None
JofejemaPnicolasumaras

Reply 1 year ago

hi, the first thing I would like to monitor is the power usage of my electric water heater (60 USg, 4500W, 240V). it is at the end of its useful life and I must decide to stay electric or go natural gas. I will get the two CTs as you suggested,
thanks

0
None
hussien88

10 months ago

execuse me, please how can i be sure from that my ct is work?

0
None
ajayt7

1 year ago

So for whole house use the main conductor , Phase wire, for metering

0
None
ajayt7

1 year ago

The principle of CT is to use an Electric field surrounding a current carrying conductor. If both the conductors are used together, their effects would cancel each other out.

0
None
mikenaly

1 year ago

Could this be modified to monitor both mains lines to get a reading for whole house usage? As written, it seems thst it would only measure one side of my breaker box. I would be most interested in monitoring both sided

1 reply
0
None
thediylifemikenaly

Reply 1 year ago

Hi Mikenaly,

Your mains line has two wires connected to it to form a closed circuit, the current essentially flows in through one wire and out through the other wire. You therefore only need to measure the current through one of the wires to get the whole houses consumption. You can try this by connecting up two meters, one to each wire and you should get the same measurement on each.