Friday, May 19, 2017

ATM90E36 Dev-kit for 3-phase AC Metering

ATM90E3X Devkit PCB 5x5
After successfully building the single-phase energy monitor with the ATM90E26 there has been lots of interest in the 3-phase version. Being an open-hardware project, many people have created remixed and derived versions as well. After a while I started receiving requests to assist with the code for ATM90E36, the 3-phase version of the Energy Monitor chip. However I did not have the hardware to test the code, so I put together this basic devkit to access the SPI bus and easily inject voltage and CT signals to take the ATM90E36 through its paces. This is the first board I have designed based purely on user demand rather than to scratch my own itch, since I don't have 3-phase supply at home.

Design station for Energy Monitor PCB
I ended up making a 12V AC targeted design like my single-phase version with stereo jacks on board for directly connecting current transformers. The test PCB also has few LED's to show energy pulses and is basically a low voltage version of the 3-phase 4-wire Atmel/Microchip reference design. I restricted the size of the PCB to 5x5 for hackvana's specials category. These can also be obtained from if you want to send some credits my way. The final touches to the design were put in my shed drawing power from my solar panels and marine battery during a now notorious Adelaide blackout.

Logic analyzer SPI protocol analysis

This chip uses the 16-bit SPI mode while most Arduino compatible CPU's only implement an 8-bit SPI mode, so bit of SPI sequencing was necessary to get the results. A cheap Saleae compatible logic analyzer went a long way to pinning down the protocol and getting the right values. You can see the protocol analysis fot the ATM90E36 in the logic analyser screenshot.
Test rig with Teensy and logic analyzer
The ATM90E32 and ATM90E36 share the same footprint you can choose either chip when building the board. The ATM90E36 has slightly more functionality including data dumping over DMA with the chip in SPI-master mode.The unused pins on the ATM90E32 can be grounded when using the board. My library for the ATM90E36 should work for the ATM90E32 as well with meaningless results for the CRC check code. I am re-writing the library specifically for the ATM90E32 while I design some featherwing hardware around it as well.
I took the whole thing for a test to the Hackerspace in Tonsley who graciously provided me a set-up involving a 3-phase variac, an isolation transformer and a 3-phase load bank with wire wound resistors. The test set-up can be seen in the video below. I actually managed to blow up the load bank by pushing 12V AC through a 2ohm load rated for only couple of amps, maths failure there. Just excited to be able to play with the 3-phase at an isolated low voltage. While the load ran it gave nice readings on the monitor which I had previously calibrated using a single phase at a time.
For the next test to have a safer and more controlled conditions I am trying out several DAC's to simulate Voltage and Current waveforms with relevant phase shifts. That is another blog post and project altogether.

No comments: