Simple Arduino Home Energy Meter

208,708

721

86

Introduction: 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.

Circuits Contest 2016

Participated in the
Circuits Contest 2016

3 People Made This Project!

Recommendations

  • Fruit and Veggies Speed Challenge

    Fruit and Veggies Speed Challenge
  • Fandom Contest

    Fandom Contest
  • First Time Author Contest

    First Time Author Contest

86 Comments

0
faisalalbati
faisalalbati

5 months ago on Introduction

Don't you need to measure the voltage to get accurate readings? Also, what do you recommend to test this on if I can't access a home circuit breaker?

0
JofejemaP
JofejemaP

4 years 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

0
john henry
john henry

Reply 1 year ago

sorry bud.. 120v has been standard in the US nation wide since 1967..
its 120v or 240v now.
do they really still use 110v in Canada?

0
thediylife
thediylife

Reply 4 years 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
cme1ca
cme1ca

Reply 2 years ago

I'm a little late to the conversation, but technically, North America power systems (Canada/US is 1 grid) are "split phase" with two 120v lines 180˚ apart so it's more like two phases than one. This is a great write up, but over-simplified as you're missing 1/2 of the entire panel, plus any 240v loads. One CT will only monitor 1/2 the house. As others have suggested, you also need voltage to calculate power. I'm sticking my finger/meter in the socket and currently see 122.4v to neutral, 240+ line to line, so if you want to monitor 1 load, this instructable works fine. If you want to monitor the whole house, you need a more robust system. Alternative how-tos are complex for a reason. Thanks.

0
dogla
dogla

Reply 3 years 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
nicolasumaras
nicolasumaras

Reply 4 years 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
JofejemaP
JofejemaP

Reply 4 years 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
irina.vaghin
irina.vaghin

Question 1 year ago

Hi! I followed your instructions, connected the sensor to just one of a power strip chords, yet it show wattage even when no consumer is plugged (144-170Watts). Why is that and how can I make it right?

0
info127
info127

Question 1 year ago on Introduction

I've followed your instructions very carefully. I've tried the calibration and it works fine when I use a 40 watts bulb. Then I plug in another bulb and my calibration is way off (60 watts). I've also tried other devices to measure and I keep recalibrating. I've tested my voltage with a meter and all, so I'm wondering what I'm missing.

The second issue is I get a spiked reading everytime I start. This means my Peak Wattage is always off at the start. Should we be debouncing before the first reading ?

Otherwise the project is great. I'm planning on using this sensor with my GAS Generator as an indicator of AMPS and WATTAGE consumption.

0
Uno-123
Uno-123

Answer 1 year ago

Can you show me your diagram ? Because im having a hard time. Mine didnt work at all

0
info127
info127

Reply 1 year ago

Hope this diagram helps. I'm still having troubles with calibartion. Every time I change the wattage source, I need to recalibrate as the readings are off. Not sure what I'm doing wrong.

Capture.JPG
0
Uno-123
Uno-123

Question 1 year ago

Can you tell me the connection for lcd screen. Because I'm having a hard time connecting it to the arduino?

0
john henry
john henry

1 year ago

your voltage isn't guaranteed to be 220v or 110v AC.
to be more accurate use a volt meter. i typically get around ~120v. currently mine is 124v +/- 1.5v AC
and that's read with a high quality $130+ multi meter.

I threw out the LCD code as i plan to send the data to a raspberry Pi. its just sending the data through the serial monitor for now.
but i did get it working no thanks to the bare minimal schematic. i had to use whats called in the industry as an "educated guess" of what resistor goes where and which way the capacitor goes... I got it right first try.

0
john henry
john henry

Reply 1 year ago

the power rating doesn't guarantee it will operate at that wattage constantly. its more a max rating. it changes depending on how warm the bulb is. eventually it will settle after awhile.
if you get a watt meter and a lamp you can see exactly how much that specific bulb its using at the time of testing.

same thing with everything else. i calculated my computers max watt to be about 550w (bought a 650w psu) but at idle its around 200-230w. with max cpu-gpu load it was around 410-450w. id hit higher numbers with all my cd and hard drives running. as well as using all spare usb ports to charge phones.

0
trm33
trm33

3 years ago

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

0
KahW1
KahW1

Question 3 years ago

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

0
Anthony Lai
Anthony Lai

Question 3 years 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
tinac160
tinac160

Question 3 years 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?