Tag: munin

Inspired by a fellow ne2000-event goer http://juerd.nl/site.plp/kwh (dutch site) who made a kwh-meter-meter. I decided to also do something similar with my Arduino as it was just sitting idle in a box waiting for greatness…

To do such a project requires aÂ light amount ofÂ electronics experience, although you can probably do it without. If you know how to solder and you can tell the difference between positive and negative connections then bob’s your uncle.

Before I could get started on this project I needed a few more electrical components like resistors, more flashy leds and what not.Â I ended up searching the web for a decent place to order the components (which turned out to be Reichelt.de) and ordered the IR Sensor for the project from a local electronics shop in Utrecht because reichelt.de didn’t have it. Three days after ordering all the bits and pieces a package arrived and I could start.

I soldered the TCRT5000 sensor to a piece of soldering board because I didn’tÂ want to break any of its terminals fiddling with cables and such, plus it made for a better connection. Added the resistorsÂ and two leads for power to that piece of soldering board and then connected it up to the arduino read out the value and.. awesome it worked straight away.

After some tweaking of values I got a sensible reading from the Arduino for each cycle on my kWh meter. That was step one actually getting an event outside of the kwh-meter. Now the question was what to do with that.

In the example project that inspired me (juerd’s project) juerd had an OpenWRT router capturing values and storing them into an rrd file. As I dont have any OpenWRT or linux server I thought why not use Munin to monitor my Arduino output.

To accomplish this I used my Ethernet shield as a webserver to serve values to a custom made munin plugin (which was easy to make). That saved me a problem because I already had munin running on a server of mine.

In using munin I have a polling time of 5 minutes which is more than enough to see the amount of power going out, but it would mean that if something used an excessive amount of power in a time period of less than 5 minutes then I could potentially miss it. To fix this I added a variable that gets reset after each web request and holds the highest value: maxwatt. That allows me to see when short bursts occur in my power usage. But overall the 5min poll time is just fine.

A Quick update that this project is still working..
It needed a slight adjustment because my provider hands out dynamic IP addresses, and the arduino lost track of its self after a while.
So I had to change the order of execution in the loop and also added some dyndns updating..
Here’s the latest day graph: