Hi, my name is Michael and I started this blog in 2016 to share my DIY journey with you. Since most household wouldnt have too many low power factor contributors, the meter works quite accurately. Do not remove any wires or remove any screws before checking your local regulations with your local authority, you may require a certified electrician to install the CT for you. This code, unlike our original simple Arduino energy meters code makes use of the millis() function to calculate the duration between cycles instead of relying on an estimate, this results in a slightly more accurate (about 0.5%) calculation.
The jumper wires that comes with the arduino kit should suffice ? If it for DC energy meter, can i ask your help for AC energy meter porject? Hi Harshini,
With a few changes to the code, you can also add your local tariffs and display the cost of electricity used to date. Just something to keep in mind; if youre going to the trouble to increase the accuracy of the measurement to that degree then youll probably want to look into measuring the voltage using a small transformer to convert your supply voltage down to 5V.
For connection to a typical 3 phase mains supply, connect one CT around each of the phases as shown below. The capacitor used is 10F which should be sufficient for most CT ranges for household applications. Safety. In each case, the top line displays phase 1 and phase 2s measurements and the bottom line displays phase 3s measurements. So far Ive thought of two options: 1. where do i begin? I have drawn more current for testing but its just that, max 16.91Amps. Save my name, email, and website in this browser for the next time I comment.
If you are going to be installing your power meter somewhere permanently then you may want to solder the resistors and capacitor directly onto eachCT so that they cannot come loose. If your load and grid tied solar inverter are both on one side of the CT and your main electrical connection is on the other side then if there is less load then what the inverter can produce then you could get a negative current reading. Yes, we connect it to the high side of the voltage divider so that the current sine waves midpoint is elevated to 2.5V. To calculate how many amps yours needs to sense, take the maximum continuous power your are expecting to sense and divide that by your voltage (usually 110V or 220V depending on your country).
Now you can upload your sketch onto yourArduino, if you havent uploaded a sketch before then follow this guide on getting started. Another thing for Arduino and this kind of stuff, which is useful for current sensor selection, is that many sensors have a 0.333V output. if (maxCurrent = 517? For example, if the overflow happens at 10000, the start millis was 9987 and the end millis was 2031, the difference would be 2031-9987=-7956 but the value cant be negative as it is unsigned so it becomes -7956+10000=2044 which is the correct duration. very thanks for this project. It likely wont respond to 50Hz when measuring DC voltage, youll need an AC voltage measurement.
This project is shared under the Creative Commons License: The best resource for tech and electronics projects, tutorials and reviews. The LCD screen shield already picks up on the analogue inputs but only A0 is used by the shield for the button inputs. Im not aware of any specific shields designed for the Arduino Uno which provide WiFi connectivity. There are a few free IO pins which should allow you to connect the WiFi module in conjunction with the LCD shield (if required). This will enable you to measure true power rather than apparent power and should also improve the accuracy of your meter. i rebuilted your power meter and it works good, but it does not count the kWh. Looking forward to seeing some of your pictures. 2 years ago, Yes, it works.
Skste to preformulova a sksim vm odpoveda. My mains are 3 wired, phase 1, 2 and Neutral. The first is the CT or current transformer. Sounds great, I look forward to seeing your finished project! Why not just measure the positive component between GND and Ax and ignore the negative component (maybe add a diode to protect the analog input pin)?
The regular Arduino jumper wires should suffice? There are essentially four components which need to be chosen or correctly sized for your energy meter.
Here are some options on different CTs and their ideal burden resistors (in standard sizes): The capacitor used is 10F which should be sufficient for most CT ranges for household applications.if(typeof ez_ad_units!='undefined'){ez_ad_units.push([[300,250],'the_diy_life_com-banner-1','ezslot_10',175,'0','0'])};if(typeof __ez_fad_position!='undefined'){__ez_fad_position('div-gpt-ad-the_diy_life_com-banner-1-0')}; Finally you need two dividing resistors to get the 2.5V reference voltage from the Arduino. Hi Mario,
RMSPower[i] = 220*RMSCurrent[i]; < if it is 3 phase should this not be like 400, I have got the box built and hooked it up to emoncms so i get pretty nice graphs and the bells and whistles .. its just as soon as i check on the "lives" of the 3 phase i get about a 6 amps difference, We are actually measuring a cold rooms compressor. Hi Michael, I am building a small wind project, where I am using a 3 phase 2kW wind turbine. Hope this helps. Yes, you could either connect a data logger through SPI or I2C or simply connect an SD card reader/writer to the Arduino and have it write the data to a CSV file. Simply solder the fiveleads from your current sensors onto the pin headers on the shield and use A1 to A3 as your sensor inputs as shown below. But when i instal everything in the electric cabinet the readings are wrong. Here is the three phase energy meter modeled in Autodesk Circuits so that the code can be simulated. Finally you need two dividing resistors to get the 2.5V reference voltage from the Arduino. Would it be difficult to modify the sketch to only measure 2 inputs, and then add both inputs to display the total on lcd or serial monitor? To calculate how many amps yours needs to sense, take the maximum continuous power your are expecting to sense and divide that by your voltage (usually 110V or 220V depending on your country).
Again, with this meter Iwas going for simplicity. I thought it would involve more complex math, dealing with the phase angle. Youll have to install a step down transformer to around 3V for the Arduino to read the voltage. An Arduino only has analogue voltage inputs which measure 0-5VDC, so you need to convert the current output from the CT into a voltage reference and then scale it into the 0-5V input range. I didnt realize the voltage values from the CT would be negative. I try to figure out what the problem is. Hi Michael, If i had the room Id used the same comonents to copy your setup but I have restricted space for the CTs Once you have connected all of your components, you need to connect your sensors onto the supply you want to monitor. It depends on your multimeter and what setting youve got it on. The closest standard resistor value is 56, so this was used. Great! Since writing up thearticle on how to build a simple Arduino home energy meter which measured the energy consumption for a single phase, Ivehad a number of people ask about doing a 3 phase energy meter. They must be the same value, so R1=R2 and we dont need much current so this articles uses two 100K resistors. This code will only work for a 4 wire installation where all phases are referenced to the neutral phase.
Youll get very low incorrect readings with this code on a 3 wire three phase system. When using a CT like this even with a high turn ratio (not high turn ratio CTs are safer than low turn ratios) with an open circuit the CT becomes a voltage source meaning a high and dangerous voltage can be present! Cant explain it myself maybe you have an idea. This is correct, the circuit and CT will convert the current sine wave into a scaled voltage sine wave between 0 and 5V, which is then read in by the Arduino. I would like to connect all the -ve sides together and tie those to ground. Sizing The Capacitor & Dividing Resistors. This should be around 500-5000 to 1. 3 years ago. (and then calculate the real power with emonlib ?
Good luck, sounds like an awesome project to try! An Arduino only has analogue voltage inputs which measure 0-5VDC, so you need to convert the current output from the CT into a voltage reference and then scale it into the 0-5V input range. Today i hooked up the oscilloscope and found that there is a dc signal on the analogue lines which amplitude grows with higher AC current. With same current its repeating identical every 20millisec (230ac -50hz) It seems that the 16,91 amps corresponds with a 5volt amplitude (but its only there for a short while, I geuss this is why the multimeter reads 2.5V all the time. Are they not changing or are all three giving the same reading?
Always make sure the burden resistor is soldered to the CT leads, preferably as close to the CT as possible.
Is your setup a 3 or 4 wire three phase installation? My 220V is wired on phase 1 and 2 so if I would be using 220V it would not be registered. 3 x CTs Talema AC1030 (See step for different options). Hope you can find the time to shed some light. Would that work?
The code however wont allow for a negative energy measurement, it will just be ignored. You need to measure the voltage as well to make an accurate inductive and capacitive load meter. how about using one potential divider for all CT's ?
hey there. Sure, for perfectly accurate measurements you need to measure both the supply current and voltage but for this application and in the interests of keeping the energy meter simple and safe only requiring a non-contact connection to your mains Ive decide to stick with a simple current measurement which gives you an estimate to within a couple of decimal points of a kilowatt hour. This can be done very easily by stripping some of the wires away, soldering the burden resistor in and some heat shrink over the whole lot. This article worked on 42A with a turns ratio 0f 1000:1 giving a secondary current of 0.042A or 42mA. Since writing up instructions on how to build a simple Arduino home energy meter which measured the energy consumption for a single phase, Ive had a number of people ask about modifying it to be a 3 phase energy meter. Hi Adam, I do not understand where this 42A comes from.
Hi Steven, So for scaling the CT output to suite your Arduinos analogue input voltage, you need to select a maximum current youd like your energy meter to sense which should be between this range. Do not remove any wires or remove any screws before checking your local regulations with your local authority, you may require a certified electrician to install the CT for you. For those of you who have read that the millis() function goes into overflow after about 49 days, the code deals with the rollover automatically by making use of the unsigned long variable. You can email the code and any photos you have through to admin(at)the-diy-life.com and well have a look at posting your project, with credit to you of course. Would you be willing to share the code? An perhaps test the voltage on the analogue input and check that it continues to increase when the input current goes beyond 16.91 amps.
The highest current Ill be measuring would be around 50A or 50ma, Hi would you be able to tell me the best way to get this connected to wifi?
2 years ago. For a list of some options on different CTs and their ideal burden resistors, visit this link.
Simply solder the five leads from your current sensors onto the pin headers on the shield and use A1 to A3 as your sensor inputs as shown in the attached image.

Start by dividing your primary current (the maximum as used above) by your CTs turns ratio (available on the data sheet). Good luck! This meter measures the supply current through each phase using a CT (current transformer) and then does a few calculations to give you the current, power, maximum power and kilowatt hours consumed for each phase.
c genial et merci beaucoup de maider ,mais jai loportunite a props ce projet de metre en oueuvre les information dans une aplication mobile a le but de diminuer la cosomation de mison par alerte cosomation dans chaque heure et donner des solution pour le diminuer. First you need to start by assembling your components onto the CTs to create the current sensors which produce a signal which your Arduino can understand. That sounds like a great addition to the project. Hi Michael,
Just using LCD Screen 16*2, Hi Ahmad, Is there a reason you connect the burden resistor and the current transformer to the high side of the voltage divider (that creates the 2.5V reference). Doesnt matter if i draw 1amps or 16amps. What about adding a second LCD to show the total cumulative KWh? The higher your maximum current, the high the power your meter can sense but the lower your resolution and accuracy will be for smaller currents. Your entrance or front door to your home is the first thing people look at when they walk past, drive past or come to 12 Ideas To Use Ordinary Things In Extraordinary Ways, Using Arduino Functions Correctly, Make Your Code More Efficient, https://github.com/samotage/Aiko/blob/master/SEGmeter/seg_meter_v0_199.pde, https://www.the-diy-life.com/connect-an-lcd-screen-to-an-arduino/, https://learn.openenergymonitor.org/electricity-monitoring/ct-sensors/interface-with-arduino?redirected=true, The reTerminal E10-1, the First Expansion Board for the reTerminal, What Makes TMC2208 Stepper Motor Drivers Silent, I Made A Home Assistant Hub Using The Atomstack X20 Pro, Recondition a Lead Acid Battery, Dont Buy A New One, DIY Raspberry Pi 4 Desktop Case With OLED Stats Display, How To Upgrade Your Homes Entrance & Increase Curb Appeal, 3 x CTs Talema AC1030 (See below for options and purchaselinks), CTYRZCH SCT-013-000 100A Built In Burden Resistor . The one used here is the Talema AC1030 which can sense 30A nominal and 75A maximum current. The first is the CT or current transformer.
To calibrate your energy meter, your need to be sure that the current that your meter says is being drawn on each phase is what you expect is actually being drawn.
This meter measures the supply current through each phase using a CT (current transformer) and then does a few calculations to give you the current, power, maximum power and kilowatt hours consumed for each phase. A couple of notes based on my experience! good greeting Hi Muhammad, In each case, the top line displaysphase 1 and phase 2s measurements and the bottom line displays phase 3s measurements. Thanks ! Hi Emmanuel, Question If you have any questions or would like to share your build of this three-phase energy meter, please post a comment below or send a mail using the contact form. You have entered an incorrect email address! The energy meter I build stops measuring above 16.91Amps at 230Vac, it is accurate to that point. Next you need to size your burdenresistorR3, this converts your CT current into a voltage reference. If you are simply trying this project for fun then a breadboard is perfect. The Arduino analogue input ideally maps the AC current sine waveform from 0 1024 with the mid point at 512. Hope this helps and I have explained it clearly enough.
Hi Mitch, I think youre going to need something quite a bit more complicated than this. Id rather keep it to one board. Using the 2 CT's would be the way to go then.
The current transformers have two wires: +ve and -ve side. It is about 0.5 mm / 25 gauge wire. One 3 wire installations, the voltage and current run phase to phase which means that some of the power being measured is being cancelled out by the return path through the phase.
The other option would be to use an Ethernet shield and then plug in an Ethernet to WiFi adapter. The basic circuit for the connection of the CTs to the Arduino is shown in the attached circuit diagram.
Best regards
do other maths for energy based on time etc, The sketch for Arduino based ADC is used in the SEGmeter V1 is below Are the readings staying the same as when the lamps were connected? This instructable assumes you know the basics of Arduino programming, otherwise read my guide on getting started with Arduino.
Your calculations and components look correct. The further from unity the power factor of the inductive load is, the less accurate it is going to be. first off all maybe my measuring points are wrong, but when I measure between the analogue inputs on the arduino uno and as negative the wire that supplies the CT sensor I measure always 2.47volts +/-0.10. It would certainly make the circuit simpler.
apply the calibration factor to this result How exactly do you feed the signal to the arduino? 2. Your analogue reference voltage to the Arduino is 2.5V so to determine the resistance you use R=V/I R=2.5/0.042=59.5. Dear Michael, thank you very much for sharing these plans. 25Amps 25/750=0.033Amp =33milliAmp How can I apply items without LCD Shield on Step 7. It really can be made quite simple, there are two things which typically complicate it, one is when your supply is three wire three phase (this setup and code require the neutral) and the second is if you have very inductive or capacitive loads (low power factor). Or will the 3rd reading show 0 since there will be no input there at all. How do i get started in debugging it? Its really easy to modify the code to measure 2 inputs as the inputs are stored in an array.
What could be the problem? DIY, Wireless, Modular, Arduino, 3D Printed! Nice and useful project. Please email me talema AS-105 750:1 Hope you enjoyed this Instructable? Im just a little confused by this line: For that purpose I am going to attach an Adafruit ADS1115 16bit ADC which allows to connect all the three CTs at the same time. Any suggestions? This will tell you whether you have a hardware or code problem. Hi Jayd, First you need to start by assembling your components onto the CTs to create the current sensors which produce a signal which your Arduino can understand. If you are simply trying this project for fun then a breadboard is perfect.
Here is the link to download the 3 phasemeter code. Upon startup, youll see a 3 Phase Energy Meter screen followed by cycling through the current, power, maximum power and kilowatt hours consumed screens. 2 months ago This is great was a bit busy but i made the 3 phase circuit in the meantime and put together some code Thanks for the feedback. With a few changes to the code, you can also add your local tariffs and display the cost of electricity used to date.
Question Putting the CT onlu on neutral will give only the single phase 127V reading.
Question Yes you can, have a look at our post on the Simple Arduino Energy Meter for coding to the serial monitor.
Is it necessary to have 3 individual voltage dividers? How can I adapt this to my 2-phase installation? Then connect the +ve sides to adc1, adc2 and adc3 (with burder resistors on each). If you're looking for some different projects with step by step guides and code, have a look at these Arduino base projects which I've written.
You will now need to adjust the scaling factors defined in line 8 accordingly: double calib[3] = {11.8337,11.8234,12.0325}. How did this project go for you? The code is simply saying that any readings below 516 are negative and should be discarded. Makes sense. You need to go through the calibration process and adjust the code to get the correct current reading and this will carry through to your kWh recordings as well. It depends what youd like to do with the WiFi but I think your first option (connecting the ESP8266) would be the easiest. Now you can upload your sketch onto your Arduino, if you havent uploaded a sketch before then follow this guide on getting started. ), In Sizing The Burden Resistor section you mention: Searched some more and will start the build from scratch as the issue is resolved. The Arduino uno doesn't really have enough output pins to drive two LCDs but you could setup the LCD to change between two screens, one containing the cumulative kWh.
Sure, for perfectly accurate measurements you need to measure both the supply current and voltage but for this application and in the interests of keeping the energy meter simple and safe only requiring a non-contact connection to your mains Ive decide to stick witha simple current measurement which gives you an estimate to within a couple of decimal points of a kilowatt hour. Notify me of follow-up comments by email.
Most of the work will be in modifying the display code to suite your application but youll only be working with the summed results and not the array elements. Because your setup, CTs , resistors and input voltages may be different, there is a scaling factor in the sketch which you will need to change before you will get accurate results, see below for calibration.
Last year Seeed Studios launched the reTerminal, a Raspberry Pi Compute Module 4 based touch display terminal with a pretty good list of features. A while ago I did a bit of an experiment to compare the sound level between TMC2208 and A4988 stepper motor drivers.
Does the code need to be modified to read only 2 inputs?
Hi Dave, 1.
4 years ago.
They may be higher or lower depending on your application. 4 years ago. Once you have connected all of your components, you need to connect your sensors ontothe supply you want to monitor. Hi Friederik,
Thanks for the great feedback.
Start by checking the measured value on your analogue input and see if this changes with and without a load.
Reply I can get around 4kHz sampling using the 16Mhz arduino. or could it be connected to a datalogger?
When every component arrives, I will start the project. If you want your meter to start counting from 20500kWh then you'd simply change the kilos variable to start from 20500 instead of 0. To calibrate your energy meter, your need to be sure that the current that your meter says is being drawn on each phase is what you expect is actually being drawn. 5 years ago. This means that the peaks of the sine wave are between 0V and 5V. I chose 42A to allow for some margin on the 30A nominal but without going too high that if affects my meters resolution when measuring lower power devices. There isnt really any current flowing through the wire as all of the components are mounted directly onto my CT.
Dividing resistors (on the left side) must have the same values - 10-100k. And let's say at the time of completing your project your energy meter showed 20500 KWh, how will you tell your Arduino to start counting from that number onward? But the readings of current I got r much more higher than the actual current value. Question They must be the same value, so R1=R2 and we dont need much current so this articles uses two 100K resistors. Keep on posting! I wanted to measure the output from the wind turbine itself which is not an true RMS, the rated frequency of the wind turbine is 32Hz. in the tech specs the CT has a 3.5 audio plug and according to the specs, they are output on the tip and near the plug. I want to add cost in this what can I do for code?? At 220VAC, it can theoretically sense up to 16.5kW for short periods of time but it is sized to continuously sense 6.6kW which is suitable for a small household. Upon startup, youll see a 3 Phase Energy Meter screen followed by cycling through the current, power, maximum power and kilowatt hours consumed screens. This code, unlike ouroriginal simple Arduino energy meters code makes use of the millis() function to calculate the duration between cycles instead of relying on an estimate, this results in a slightly more accurate (about 0.5%) calculation. Thanks for your reply Michael, Thanx for the instructable. It doesnt seem that the correct RMS calculation is being done, plus there is math going on in the sampling meaning that the current waveform being sampled may not be fast enough With the SEGmeter codes I have developed, I have an array that I sample into, meaning the sampling can be as fast as possible. 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 have built the circuit as is in the schematic, but the current readings are always at zero with resistive load. Hey If my Kwh consumption is large enough and i need the exact potential for the voltage which in this case you've taken directly a constant voltage.how can i get the PT value for three phase and from what thing i can get it?? I dont see any reason why you wouldnt be able to use the same voltage divider for all 3 CTs. Or should the other values also be changed accordingly.
It was quite gud to do and was very simple to implement . In order to do this accurately, you need to find a calibrated load. 16.91amps x1.414=almost 25Amps Thank you. What do you mean by the same current and power readings. Make sure youre not putting more than 5V onto the Arduinos analogue input. Hello Michael,
Setting the Arduino analog reference to INTERNAL, means that it uses the internal 1.1V as its ADC vRef a handy hint I got from @jonoxer once upon a time.
Why not just have a single divider to provide a 2.5V reference to all CTs? NB Be careful when connecting the CTsto your mains and make sure that the power to your board is switched off before doing anything in the mains box. Custom NanoLeaf Lights! At 220VAC, it can theoretically sense up to 16.5kW for short periods of time but it is sized to continuously sense 6.6kW which is suitable for a small household. Each CT should only have one wire/phase running through its core. Learned something here. Simply how this should be done is: If you're really only concerned with the total power consumed then you could just use a single CT on the neutral phase and that will give you the combined power consumption.