arduino energymeter_bb.png

I belong to a village of Odisha, India where frequent power cut is very common. It hampers the life of every one. During my childhood days continuing studies after dusk was a real challenge. Due to this problem I designed a solar system for my home on a experimental basis. I used a solar panel of 10 Watt ,6V for lighting few bright LEDs. After facing lot of hardships the project was successful. Then I decided to monitor the voltage, current, power & energy involved in the system. This brought the idea of designing an ENERGY METER.I used ARDUINO as the heart of this project because it is very easy to write code in its IDE and there are huge numbers of open source library available in the internet which can be used according to the requirement.I have experimented the project for very small rated (10Watt) solar system but this can be easily modified to use for higher rating system.

Energy monitoring by
1.LCD display
2. via internet (Xively upload)
3. Data logging in a SD card

You can see my new instructable ARDUINO MPPT SOLAR CHARGE CONTROLLER ( Version-3.0)

You can also see my other instructables on



Remove these adsRemove these ads by Signing Up

Step 1: Parts Required :

Picture of Parts Required :

1. ARDUINO UNO (Rev-3)

4. RESISTORS (10k ,330ohm)

Step 2: Power and Energy

Power :
Power is product of voltage (volt) and current (Amp)
Unit of power is Watt or KW

Energy is product of power (watt) and time (Hour)
E= Pxt
Unit of Energy is Watt Hour or Kilowatt Hour (kWh)

From the above formula it is clear that to measure Energy we need three parameters
1. Voltage
2. Current
3. Time

1-40 of 78Next »
HriddhiD16 days ago

3.4 V is equivalent to 696

since 0 to 5 in analog is scaled to 0 1023 in digital

3.25 V should be --> 1024*5/3.25 = 665.6 --> 666

If I use a voltage divider so that I can monitor a 100 W system, I think I will generate too much heat. Do you have a energy meter for a larger system?

dutuc.nicolae2 months ago

Monitor the energy production of a wind turbine with GREEN POWER METER :

Hi Deba, I have similar project to do. But I have to work with 230v ac supply voltage. have you done with 230v supply voltage? please let me know and share you work kindly, it will be helpful. my email {}..
SyedA22 months ago

thanks a lot !!

SyedA22 months ago

hi deba,

can you please provide me the arduino sketch.

deba168 (author)  SyedA22 months ago

Hello :)

The arduino sketch is in step-9.It is a text file attached bellow.

ngpha2 months ago

hi Deba,

I have problem with energy consume. Due to the watt fluctuate, so when calculate energy consume = watt x time (since start) it is not correct. )

as you can see the watt output from energy meter. I compare it with an AC power meter. It is wrong result. I know that my inverter effiency is only 80-90%.

so I use the formula as below, but the result still wrong

watt =voltage*amps; // power=voltage*current
wattttg= watttg+ sqrt (watt*watt);//
wattcc= (wattttg)/time ; average watt hour
energy=wattcc*time /(1000*3600); //total energy in milli second

cong suat.bmp
ngpha made it!3 months ago

hi, Deba. due to short circuit the positive source touch to the arduino, so all of my equiment blow-up -die. I have to build myself a new type. Now i upload it to thingspeak as

here is my new prototype. I make a plastic case for it.

deba168 (author)  ngpha3 months ago

Hey it looks really very nice.Thingspeak graphs are more eye catching than Xively. Thank you for sharing.

Oh sad thing.I will advice before giving power to the circuit, checkrepeatedly.Though it happened to me also.

Hi Deba.

Great Project. It helps me a lot. I just wanna ask about the LCD display. Did u use the serial or parallel LCD??

Thank you.

deba168 (author)  Noor ShahirahS3 months ago

Hi Deba.

Great Project. It helps me a lot. I just wanna ask about the LCD display. Did u use the serial or parallel LCD??

Thank you.

BelialD3 months ago

Whould anyone know if the ACS712 is capable of accurate calculations of 0-20mA at 1-30V? I want to make something very similar to this project but calculate the total mA passing through over time.

deba168 (author)  BelialD3 months ago

I think it will work,but you will not get the exact reading.May get some error.

BelialD deba1683 months ago
Any approximation of the error? Do you think it will it be lower than 4%?
deba168 (author)  BelialD3 months ago

You refer the following links for more details on ACS712 current sensor.

jaykentchriss3 months ago

Hi deba. What if a solar tracker is added to your project? Is it possible to combine your codes with the solar tracker code in one arduino sketch? Is it possible to run your project with solar tracker in a single arduino simultaneously? Just like multi-threading?

deba168 (author)  jaykentchriss3 months ago

I have not tried yet.I think it works.Have a try at your own risk.

sabs.2813 months ago

Hello Sir. How did you get the 696?

thank you.

ngpha sabs.2813 months ago

696 get by the line command


this is the value which the pin 3 in Uno read

sabs.2813 months ago

Hello. I have seen your images attached. Can you please tell me the code to obtain sample1 value which was 927.18?

thank you very much

npitz7 months ago

Hi Deba, I have similar project to do. But I have to work with 53V 20Ah lithium-ion battery
supply voltage and ACS712 30A. would you explain? please let me
know and share you work kindly, it will be helpful. my email

deba168 (author)  npitz3 months ago

Sorry friend.I don't know much about the Li Ion Battery Charging.

IzyanA7 months ago

hai deba! i have a similar project to do. but i cant do with the parts xively. how was it? hmm

deba168 (author)  IzyanA3 months ago

Tell me the exact problem you are facing.I will help you.

ngpha made it!4 months ago

I ask my friend do it for me. Now I can't upload it to I want to upload my data on can someone help me the code. Thanks

deba168 (author)  ngpha3 months ago

Hey it looks great.

jaykentchriss3 months ago

Good day!.. Your project is great.... What if a 12 volts battery will be used?... Do we need to use the same 10 kilo ohms resistances of the voltage divider? or do we need to change it to a higher value in order the ardiuno will not damage?.. Sorry my english :) ...

deba168 (author)  jaykentchriss3 months ago
miragempro3 months ago

Thanks for the tutorial, I was looking for one of those. but I would like to know how to make a program that displayed the value in US dollars spent, for example: I want a dimmer to shower, and want to know how much I spent in real (Brazil's currency) or US dollars, the time that I was in the shower, an example would be 10 10-minute bath what it would cost in US dollars? that would be displayed on the LCD and stored. And put a password, limiting shower time my son in 10 minutes and when the time is up, the water cools, the doubt is how to code. a hug

GiovanniQ5 months ago

Could you post the complete code for current reading please? I need it for a project. Thanks!

deba168 (author)  GiovanniQ4 months ago

You can refer the following link.It explains details on how the hole effect current sensor works.It also include a sample code for current measurement.

auva.pearl8 months ago

Hi Deba, I have similar project to do. But I have to work with 230v ac supply voltage. have you done with 230v supply voltage? please let me know and share you work kindly, it will be helpful. my email

deba168 (author)  auva.pearl7 months ago

I have not tried.You can go through the following link

Hey I had one problem in Arduino code for current measurement. Why did you multiplied actual value to 10 in order to get amp value?

deba168 (author)  gaurav masiwal9 months ago

As per data sheet of ACS 712 , analog output = 100mV/A

But I get the output in Volt.


karcsika92210 months ago

Hi deba. I have one question and one sugestion . First the question ,why do you used the : totamps,avgamps,amphr ,where the energy formula only used the watt and time ?
The sugestion is ,if you allready have amp hours use that in the energy formula

deba168 (author)  karcsika92210 months ago

As you have seen in my code I takes 150 samples of current reading with a time interval of 2 millisecond .Now sum all the samples ( total amps) and to get the exact value of current you have to take the mean or avg of the all samples (a method of digital signal processing ).This current reading is more accurate and reliable than the instantaneous value of current (one sample).

Thanks for your suggestion.It will also works.

What i don't understand is that tree parameters in this case

// totamps=totamps+amps; // total amps
// avgamps=totamps/time; // average amps
// amphr=(avgamps*time)/3600.0000; // amphour

without this the energy reading are still right

VOLTAGE : 4.967 Volt
CURRENT :0.061 Amps
POWER :0.302 Watt
ENERGY CONSUMED :0.0040 Watt-Hour

1-40 of 78Next »