Emon32 - a modern energy monitoring implementation

Pleased to release an energy monitor system. I’ve been working on this project for a couple of years but have been interrupted by Covid, extra children, and component shortages. The image below is just a development board, and I wanted to post this to see if there was any interest from anyone in a small beta run of a refined version. It’s designed to be compatible with emonCMS and the emonTx series in general. There is space for a 2nd order filter on each input, but I settled for a first order filter in the end.

Firstly, a big thank you to @Robert.Wall for his time in discussing the energy monitoring algorithms and tradeoffs. Before describing, here is a link to the GitHub repo (GPLv3 licensed). There are full rendered schematics, and project files (KiCad) and descriptions to build the firmware.

Rob has been doing heroic work with the AVR parts for the emonTxV4 but the AVR parts (in general) are outdated, expensive, and have few peripheral features. My aim with this was to make a higher performance, scalable, and future proof design based around a more modern microcontroller family. The two main limitations of the AVR micros are the 8bit architecture (which makes any calculation over 16bits extremely slow), and lack of DMA. The lack of DMA means that all ADC acquisitions must be handled in real time, so as the number of channels and/or sample rate goes up, the interrupt density increases so more and more time is spent just entering/exiting the interrupt handler with no real work done.

The main advantages (as I see them :slight_smile:) are:

  • Modern 32bit ARM processor (easily portable to other microcontroller series)
  • 12bit differential ADC with precision reference
  • ADC acquisition period is decoupled from processing time. This fixes the acquistion frequency, so an anti-aliasing filter can be put in.
  • Buffered and shared virtual ground
  • Fully configurable at run time through interactive serial connection.
  • The microcontroller series (Microchip ATSAMD) has well defined price/capability points with simple porting.
  • USB bootloader and serial available (not in this development version)
  • Many more, and more capable, peripherals available for extended uses.

The firmware is not written using Arduino, but as the ATSAMD series is used in many Adafruit/Sparkfun/etc products, that facility is available. I hope the firmware is reasonably easy to understand, and of course I’m very happy to answer any questions/suggestions.

Some things are not yet implemented, I wanted to gauge general interest before developing things I wouldn’t necessarily use myself. These are:

  • Some emonCM results (RMS current, PF, apparent power)
  • OneWire temperature monitoring
  • RFM69 driver

Hope this is of interest, and look forward to hearing any feedback :slight_smile:

2 Likes

Nice work @awjlogan ! looks great and an impressive list of capabilities that you have worked on, I am definitely interested in the ATSAMD range for future emonTx/Pi hardware and would like to get some time to dive into it and learn more at some point soon. Perhaps we can collaborate in some way? thanks for sharing!

Hi @TrystanLea - I’d be delighted to, OEM is a great overall project and hopefully this might provide a foundation for the next emonTx, and other products. I’ve got a couple of spare boards and parts, would you be interested? Can send them over, just send me a message (and anyone else who might like one!). Let me know if you have any queries/feedback around the firmware and overall structure - it should be documented, but obviously that’s coming from my point of view :slight_smile:

1 Like

Yes great, I will send you a message, thanks!

1 Like