Description
IPEM PiHat Lite – Raspberry Pi IoT ATM90 Mains Power Energy Monitor
Introduction
As an extension to my STEM ESP32 based Home Automation Power Energy Monitors, a new expanded version has been designed for flavours of the Raspberry Pi – the IPEM PiHat Lite
IPEM PiHat enables an alternative version of the IPEM to flourish and evolve to help others in the quest to improve and monitor energy usage.
Video
What is a Power Energy Monitor?
A Power Energy Monitor is hardware that essentially safely samples and collects data via one or more CT Cable Clamps. This then allows the user through the software to report and analyze electric energy usage.
With this data, you can simply report usage, or expand and use the information to save, or divert, energy in many different ways to improve efficiencies and ultimately reducing your costs to the mains power energy provider.
Monitoring power consumption is typically completed using a CT current clamp (essentially a transformer), clipped over the premises mains consumer unit tails and plugs into the local mains circuit to ‘sample’ the mains voltage and frequency in some way.
NB. You do not need to be an electrician to do this!
The CT clamp(s) could equally be clipped over a live wire from one, or more, ring circuits, workshop feed, or solar inverter mains connection, so measuring and monitoring individual circuits, rather than just the overall mains input connection.
Important
The most important take away point, is that this is all done safely and with no connection to live mains electricity.
What is the ATM90 device?
The heart of the IPEM boards is the Microchip ATM90E32 or ATM90E36. These are high-performance and accurate AC mains energy metering devices for:
- Single phase
- Two phase
- Dual phase
- Split phase
- Three-phase four-wire (3P4W, Y0)
- Three-phase three-wire (3P3W, Y or Δ), systems.
The ATM90 device is used in a range of premises and applications including:
- Smart Meters
- EV Charging
- Homes
- Education
- Offices
- Commercial
- Factories
- Farms
- Greenhouses
- Factories
- Industry
- Solar Farms
- Wind Farms
- Off Grid Systems
The ATM90 series of monitor devices are proven for accuracy. The IPEM PiHat core is the ATM90E36A which is used around the world in power monitoring instruments that also need to measure voltage, current, THD, DFT and mean power.
The IPEM boards requires little, to no, calibration and is easy to setup. You can use the ATM90E32 code for the standard functionality.
As the IPEM boards only safely sample the AC via a low voltage transformer, you are able to monitor varying AC (RMS) voltage mains around the World, such as:
- USA and Canada which typically is 120 V or 230 V @ 60 Hz
- With ranges around 114 V to 126 V
- Europe and UK which typically is 230 V @ 50 Hz
- With ranges around 216 V to 253 V
- Japan which typically is 100 V @ 50 Hz or 60 Hz
- Eastern Japan is 50 Hz, and western Japan is 60 Hz
- Should you wish to know more, see this Wiki
Evolution
The below flow chart shows the selection of energy monitor types that has evolved through my designs, AC and DC, then flows down to the new IPEM PiHat
The IPEM PiHat IoT Power Energy Monitor SDK design contains all the proven key technology of my IPEM and IPEC including the ADC and DAC, neatly packaging these for use on a Raspberry Pi PiHat, flavours thereof, or other MCU boards such as ESP32 and STM32, or even on my new ESPuno Pi.
The Board
The IPEM PiHat has been designed to be easy to use and offer a range of extended and powerful features which would conventionally need extra hardware.
Interfaces
A top level list of interfaces include:
- ATM90E36
- Accurate Energy Monitoring
- Easy to setup and use
- Current Monitoring Inputs
- 3 Line and 1 Neutral
- CT Clamp
- Example: YHDC SCT-013 100A-50mA
- Rogowski Current Transformer
- Example: PA3202NL from Pulse Electronics
- RTC
- DS3231
- Accurate Battery Backed on-board clock
- DAC
- Provide analogue signals, or PWM/MPPT output, driven from data measured from the current clamps
- Could be used to control battery charging or window openers for example
- ADC
- Provides a means of external Voltage monitoring
- Solar Battery voltage monitoring for example
- Relay Outputs
- Control of external equipment based on Energy usage from two isolated and independent outputs
- OLED Display
- Adding an I2C display to easily show real-time information and monitoring
Bonus
IPEM could be thought of as a Swiss Army Knife of the Mains Energy Monitor world for use by STEM, developers, maker communities, solar energy and industries.
The IPEM PiHat has been designed to fit Raspberry PI 3, 4 and 5, equivalent clones.
Photo shows the IPEM PiHat with my PEPS GPIO Board
Board Stacking
IPEM PiHat allows stacking, although the variant IPEM PiHat Lite, is also required (as you cannot stack two or more IPEM PiHats).
The IPEM PiHat Lite only has the ATM90E36 Energy Monitor, removing any port conflicts from the the other ADC/DAC devices, as they are not required when stacking.
As the IPEM PiHat board uses SPI as a means of data communication, an I2C expander provides individual GPIO functionality to each ATM90E36.
I2C Expander.
This provides 64 individual addresses, so essentially 64 stacked IPEM’s.
The design improvement is a much more sensible route as you now assign a fixed address to each board using a DIP switch. This also makes it so much easier is field and with software support and configuration.
The unique design will allow up to a max of:
* 1 x IPEM PiHat + 63 x IPEM PiHat Lite‘s
or
* 64 x IPEM PiHat Lite‘s
Stacking of IPEM PiHat and/or IPEM PiHat Lite boards, if needed, is subject to only a potential limitation in system noise. In the real world though, three or four boards would normally be more than sufficient (remembering each board has three CT Clamp inputs).
CT Clamps and Rogowski Current Transformer
The original IPEM design provided for using the YHDC SCT-013 100A-50mA.
The updated IPEM PiHat and IPEM PiHat Lite production design, now allows for either use of CT Clamps, and/or Rogowski Current Transformers.
Multiple Phases
AC inputs between the boards can be paralleled up as needed when stacking, so you can mix and match single, two or three phases between boards.
The unique ability to stack the IPEM PiHat Lite boards allows great flexibility to the end user and the eventual project installation.
Mains Monitoring
All my boards are designed to be safe and easy to use – with NO live working, mains electricity parts or dangerous exposed high voltages.
The IPEM PiHat uses only low voltage 8 to 12 V AC such as from a bell transformer and clip on CT Clamps.
Electrical Circuit Types
The IPEM and IPEC series are capable of monitoring a number of variations in energy monitoring systems, the IPEM PiHat offers the same monitoring features.
- Accurately monitors both Import and Export
- Single phase (Home, Office etc.)
- Multiple Single Phases. (Different circuits or home/office rings, Inverters etc.)
- Dual Phase (2 x Live -Typically for USA. i.e. 2 x 110V)
- Three Phase Star (3 x Live and 1 x Neutral) [Needs ATM90E36 version]
- Three Phase Delta (3 x Live)
What is the resultant Output?
Data provided from the IPEM PiHat can be extrapolated through your code in any way you wish, in order to easily integrate with your IoT Home Automation system, or Solar Installation monitor.
All software and code is open source, community based and allows you to develop and integrate as you wish.
The main process typically used for publishing data (internally or externally), is via MQTT, or you could use other direct publishing routes such as to Domoticz, Zabbix or Home Assistant.
Data from the ATM90 includes:
- Mains RMS Voltage (each phase)
- Mains Frequency (each phase)
- Import and Export Values
- Mains RMS Current
- Calculated RMS Power
- Active Power (Absorbed or Used by the Load)
- Calculated Total Active Power
- Re-Active Power
- Calculated Total Reactive Power
- Apparent Power (Total Amount of Power Flowing from Source to Load)
- Calculated Total Apparent Power
- Fundamental Power
- Harmonic Power
- Power Factor
- Phase Angle
Programming and Development
The IPEM PiHat and/or IPEM PiHat Lite SDK is controlled via the host Raspberry Pi using languages such as Python or C, or your preferred language.
If the board is fitted to my ESPuno Pi, then you can alternatively control the IPEM PiHat using a ESP32-S3, or ESP32-P4, or even your own separate ESP32, or other preferred MCU.
Full details are currently being written up and will be posted on my GitHub and Hackster.io
Enclosure
A set of 3D files are available to print your own enclosure.
Example Stacked Render
Reviews
There are no reviews yet.