Community
OpenEnergyMonitor

Community

Diy - software needed?


(Cassie) #1

Hi,
I live in South Africa and wanted to implement a power monitoring solution, and came across this site. Locally I cant find anyone that stocks any of the products in your shop (Closest being a rpi3 hat: PiShop - but the cost for this hat seems excessive)

I have just about all the components needed to make a diy monitor (Thinking about using a arduino, and a ESP-01 to send the data to a RPI3)

I am assuming I need to load EmonCMS on my pi3, and then use emonlib on the arduino to read the current and voltages. - can this then be sent via MQTT to the pi3 (Sent via serial to the ESP-01, then sent via WIFI over to the PI3)?


(Paul) #2

Pretty much!

You will find many software on this project that do what you want either as they are or with some tweaking. All the code and hardware designs are open source and available (somewhere or other) to use.

The emonESP is an esp8266 based serial to wifi bridge with both http and mqtt capability.

As for the monitor, there is ample code and/or guides to run emonlib on an Arduino, depending on how close your implementation is to the emontxShield, emonTx v2 or emonTx v3 will define what software might be useful. But these are all ATmega328p based so there is a large code/knowledge pool to tap into here.


(Cassie) #3

Thanks,
Will start by setting up EmonCMS on my laptop first and play around with different sensors/arduino/ESP8266.

I see you use a 9v AC-AC adapter on the learn section, can I use a 6v AC-AC instead?


(Paul) #4

As long as it is a linear transformer rather than a switched mode PSU and you adjust the voltage divider resister (and calibration) values accordingly, I don’t see why not.

Of course we can’t speak for the quality of the unit you have, not even all 9vac linear transformers are created equal :slight_smile:.


(Cassie) #5

Thanks,
Will see if I can get a 9V AC transformer first.
I was planning on building my own little shield for an Arduino Nano. I want to measure the transformer voltage, and in parallel build a dc regulator circuit to power the arduino and esp with the same transformer. Will this interfere with the voltage measurements? Should I be using 2 transformers?

Basically I want to add 5 x SCT-013 current sensors, with one voltage sensor in my apartments electrical db.


(Bill Thomson) #6

In short, yes and yes.

Using the same transformer to perform both functions tends to distort the sample waveform.
Something you’ll want to avoid, if possible.

If you ensure the transformer is lightly loaded, you can use the same transformer for
both jobs. That’s how the EmonTx is constructed. But the maximum available current is ~60mA,
which definitely won’t be enough to power an Arduino Nano and ESP.


(Cassie) #7

What about using something like this PCB MOUNT ENCAPSULATED TRANSFORMER for measuring the voltage?


(Bill Thomson) #8

That one has a primary voltage rating of 386 Volts. Had you noticed that?


(Robert Wall) #9

Plus, from experience those are designed down to size and not up to quality, so the waveform of ones we’ve looked at is very distorted, hence you introduce measurement errors. For what you need for measuring the a.c. waveform, fidelity of the wave shape is important.


(Cassie) #10

Ok, so best to get a AC-AC wall adapter then and stay away from PCB mount transformers?


(Robert Wall) #11

If you have the ability to fully test one and it turns out OK, then that’s fine. But our experience is, many are not.
And by “fully test”, I mean for harmonic distortion and phase errors.


(Cassie) #12

Can’t test it no, I will look for a 9v AC wall adapter then…

Will it have a huge impact if the voltage measurements isn’t spot on?
I just need an indication on were I am using power (Like stove / water heater and so on). I want to use this data to cut back on usage wherever possible and also determine if appliances are being used unnecessarily (like putting the dishwasher on multiple times a day just to was a couple of cups)…


(Robert Wall) #13

The impact will be as much or as little as it is! I can’t give a definitive answer.

Our UK a.c. adapter is rated at 9 V, but that is at full load. For our purposes, it is effectively working on no load, and in that situation, the output voltage is 11.6 V ± 3%. Yours will almost certainly be different unless you get one from our shop. The output voltage must not be significantly higher than this (bearing in mind our nominal voltage is 240 and it can go up to 254 V - implying ~12.27 V rms maximum), but no harm will be done if yours has a lower output voltage. If you can measure the mains voltage and see what Nano reports, you can adjust the calibration coefficient so that it gets it right. All that is in the ‘Learn’ section.

If you can’t do that, I really can’t estimate the error you will have in absolute terms, but of course the relative values will still be in the correct proportions.


(Brian Orpin) split this topic #14

A post was split to a new topic: Getting started EmonCMS on a PI3 and EmonESP