Skip to content

Repository files navigation

----- W.I.P -----

Raspberry-Pi Energy Meter

This Project is a combination of custom Hardware and Software, that will allow you to monitor your unique power situation in real time.

This project is derived from and inspired by the resources located at https://github.com/David00/rpi-power-monitor and https://learn.openenergymonitor.org.

What does it do?

This code accompanies DIY circuitry that supports monitoring of up to 3 Phases with 6 current transformers each. The individual readings are then used in calculations to provide real data on consumption and generation, including the following key metrics:

  • Voltage of every pahse
  • Current on up to 6 channels per phase
  • Power Factor
  • Harmonics inspection through a built in snapshot/plotting mechanism.

The code takes thousands of samples per second, corrects for phase errors in the measurements, calculates the instantaneous power for the tens of thousands of sampled points, and uses the instantaneous power calculations to determine real power, apparent power, and power factor. This means the project is able to monitor any type of load, including reactive, capacitive, and resisitve loads.

Where can I get it?

The whole Project is open sourced. You can order your PCBs via the Files provided in the PCB Folder.
You'll also find a README there which will provide more useful information.

Installation & Documentation

Ordering

Components for the PCB

Please take the respective components and their needed quantities from the CSV inside the PCB folder.

The PCB

Just send the gerber files to the PCB Manufacturer of your choice. If you provide the components file and the locations with the gerber files, you might be able to get the PCB nearly fully assembled.

Preparing the Pi

System-Setup

You'll need a raspberry pi 3B with an installed operating system on it. This has to be a 32-bit version, because the overlay file needed for the SPI-bus configuration won't work on 64-bit operating systems. Currently supported operating systems are Debian (>11) and Ubuntu (>20.04)

Installing the necessary software

Installation and Configuration

Installation into the Cabinet

You will need 4 additional components to get the rpi-energy-meter up and running.

  1. A DIN rail mountable power supply
    I had chosen this one: MeanWell HDR-15-5
  2. 3 x fuse blocks, rated for 250V
    I had chosen this one: XCELL UK5
  3. 3 x glass fuse, rated for 250V and 250mA
    I had chosen this one: FUSE GLASS
  4. Wires
    Ideally one would use black for the 230V live wires from and to the fuse holders, blue ones for the neutrals and red/black wires for the current transformer wires.
    The cross sections of the wires is:
    1. 230V/Neutal
      1. To the fuse blocks = 1.5mm² (15 AWG)
      2. From the fuse blocks = 0.5mm² (20 AWG)
      3. From the board (Neutral) = 0.5mm² (20 AWG)
    2. Current transformers
      1. Should be 0.5mm² or less (>= 20 AWG)

Select where you want your Voltage to be taken of for measurement. You'll have to select 3 sources, one for each phase.
Connect wires from these points up to the fuse holders. From there you'll connect wires to the PCB - right where the imprint "DANGER HIGH VOLTAGE" is located.
With the socket located at the bottom, left is phase 1, middle two are phase 2 and the right ones are phase 3.
The Sequence is N-L1-N-L2-N-L3

Measuring required references

This step consists of some measurements which have to be taken in the cabinet and on the PCB. On the PCB are therefore some exposed through holes where you can take measurements from.

!! BE CAREFUL WHEN TAKING MEASUREMENTS ON LIVE COMPONENTS !!

The following measurements have to be done:

  • Voltages DC
    • 3.3V reference -> Exposed pads right next to the MCP3008 chips
      Write down that value, it's needed later for the config.toml
    • Bias_V -> Exposed pads right above the Transformers on the PCB
      Should be half of the reference Voltage
  • Voltage AC
    • L{1,2,3}TRANS -> Exposed pads right next to the MCP3008 chips
      Should read something from 2.0V to 2.2V RMS

Configuring the Energy-Meter

Setting up a systemd service

  • copy the example systemd service file to /etc/systemd/system
  • modify the contents of /etc/systemd/systemd/rpi-energy-meter.service corresponding to your setup
    Most often you will need to adjust paths accordingly

Expected results

Debug mode

The html charts generated by debug mode should look something like this
Phase 1
Phase 2
Phase 3

Contributing

Credits


If you like what I did, you are welcome to leave me some support

Donate

BTC

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages