Energy Monitor - My Way

After some time searching for a suitable energy monitor I found this project. Congratulations! 

Now I have some experience with it and I'm posting my modifications and suggestions. Since they are both hardware and software related I'm posting in the general discussion forum.


I was not satisfied with the voltage transformer since the waveform was distorted. I found a simple way to sample the actual line waveform. I'm using a simple resistor divider (1M - 10k multiturn trimpot) connected capacitively (via 2 2u2/300V capacitors) to the 230 V power lines. The output of the voltage divider is connected to the existing Vcc/2 ADC voltage divider via 10u capacitor. With multiturn trimpot I can adjust the voltage to be around 3.1 Vpp. This approach has almost no phase shift and the ADC waveform is very accurate representation of the line waveform.

I was also not satisfied with the current sensor. Since the current in my case is below 30 A I used two CTs with different burden resistors: CT1 with 68R and CT2 with 120R. CT2 is additionally protected with two antiparallel 1V8 zener diodes. The first input (CT1) behaves like in the original emonTx but with higher sensitivity. If the current is below 10 A I make the second measurement via CT2. Zener diodes protect ADC input if the current produces too high voltage. 

With both modifications I have improved the accuracy of the readings even for low powers.

As a base station I use RPi. This RPi also runs Nagios (with pnp4nagios). I have created also services for all parameters monitored by the energy monitor.

The emonTx is powered via small switching 5V power supply. I have also added a small I2C 4-digit 7-segment display to the emonTx. It is conencted directly to the I2C bus on the emonTx and shows current power. The display was purchased on eBay:


EmonCms is great software - I'm only posting my comments and hints for future improvements:

- Dashboard editing: if you set (drag) either width or height of any element to 0 then you can not edit the element anymore.

- Dashboard size can not be edited

- Charts: the buttons are too big and should be located outside (top right)

- Charts: I'm missing the option to select the color

- Access via NAT: local address is used to access charts - relative paths should be used. $path should still be absolute since code to embed visualizations (shown in emoncms) uses it.

- DB size: pnp4nagios stores data into RRD-databases (Round Robin Databases, see RRD Tool I propose to use this approach also for emoncms to avoid having a huge database.

- Maybe some setting to limit the age of the data kept in the DB. Having samples of voltage and current for ever 10 s is probably not needed. Maybe this is not needed if the RRD approach is implemented.


I was hoping the SMD version of emonTx will be smaller but this doesn't seem to be the case. Anyway, here are my wishes for future versions:

- higher accuracy

- environmental sensors that are used in Air Quality Egg


That's it. I'm having a lot of fun with energy monitor! Thanks to everybody who have contributed to this project.

Robert Wall's picture

Re: Energy Monitor - My Way

I hope you have installed your hardware in a double-insulated fireproof box, that your 5 V power supply is inside it and that that you never connect to anything else outside the box.


There is a very good reason for using the voltage adapters that are recommended, that is to avoid having a direct connection to the electricity supply. If you do connect directly, then you must adhere to the minimum standards for safety.

This post Galvanically Isolated Voltage Monitor - GIVmon  is the proper way to do it.

funa's picture

Re: Energy Monitor - My Way

Of course, the hardware is completely isolated inside a box. I assume anybody doing this knows the potential danger. Thanks for the red text, I forgot to warn other users trying this approach.

Robert Wall's picture

Re: Energy Monitor - My Way

"I assume anybody doing this knows the potential danger." That's a very dangerous assumption. We have on these forums a complete range of skills and abilities ranging from complete novice to experienced professional electrical engineers. You must assume the worst and as far as possible warn the inexperienced against putting themselves in danger.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.