Arduino energy meter on-line (Part 2)

In this part we get our hands dirty by installing the sensor and putting the code in the arduino energy meter. Our “Hello world’ of energy metering.

This is the second of a two post series. Check the first part here.


The code of the Arduino energy meter:

This sketch is based on examples found at , and on a nice post at by Hadley Rich

My code has the ability to post to both sparkfun and thinkspeak data streams at the same time. The posting to this services can be enabled or disabled by commenting the defines at the beginning of the code.


Here is the complete code:

You can find the most up to date code at my github Doctor bit’s arduino energy monitor


The circuit of the Arduino energy meter:

For the project I’m using an arduino ethernet because I happen to have a bunch laying around. You can use a normal Arduino Uno with an ethernet shield or a wifi shield. I shroud try an ESP8266, I’ve ordered a few and I’m looking forward to give it a try. Anything capable to connect to the net will do the job.

The circuit for the arduino energy meter is quite simple. Just an LDR and a resistor in series (as seen in the picture). I had to play a bit with the resistor, and the value might vary depending on the brightness of the LED in your meter. I found 200K to be just fine.

arduino energy meter schematic
Arduino energy meter schematic


Arduino installed
Arduino connections



Check Sparkfun data at:

And the visualitzation of sparkfun at (Press “load all” to see the full graph)





Other web logging options:

This are some other options worth taking a look for logging data. They are all for free (or semi-free) and they can also plot information. Leave a comment bellow if you do try them, and let us know.


Future modifications:

While researching for this project I came a cross a full system for keeping house consumption logged. The platform did a great job creating such a complete solution. Next thing I will do is take a look at it and try to integrate it into my set-up. I will tell you my progress with it.
Open energy monitor interface


Let me know in the comments bellow if you have any questions, if you like this project or if you would have done it different.


Till next project,

The Doctor.

2 Responses to “ Arduino energy meter on-line (Part 2) ”

  1. is the clear winner for me; easy to setup, clean interface and powerful features like alerts, multiple dashboards and even HTML writer for your custom widgets 🙂

    The other websites don’t seem to exist anymore, or don’t even appear on traffic ranks – a sign of being out of the market.

    As for, they seem to have the same basic graphs and interface than years ago, nothing sexy :/

  2. Hi Fer!

    Thanks for your comment. didn’t know about Ubidots. I’m preparing a new version of the energy meter that will include a ESP for wifi connection and I will definitely include an example using ubidots.

Leave a Reply