crjens / pipowermeter Goto Github PK
View Code? Open in Web Editor NEWRaspberry Pi Power meter
Raspberry Pi Power meter
I'm using the power meter for several years, and really liked it, but recently faced an issue on an jack connector.
I'm looking more specifically for the 16 channel input board. I tried to contact @crjens by email, but without success.
So if someone has one available, please contact me.
Philippe
is it possible to rewire GPIO2 and GPIO3 (pin 3 and 5) to some other pins?
i'd like to use i2c along with pi power meter, but not sure about pullup resistors or other hardware limitations.
i'm connecting it on ribbon, so it's easy to me to rewire and change the reader code accordingly.
I have the dl-ct08cl5 CT's (2000/1) and am unable to configure the readings properly. I also dont seem to understand the scaling factors or where the phase configurations are defined (V1,V2, V3, V1+V2). The CT's seem to be detect voltage and frequency, but no current. I am measuring ~150ohm across the CT's leads before connecting to anything. I am measuring ~44 vac and ~7.6M ohm on a 1AMP load.
Also - For any 220V circuits, do we need both legs? Just curious how the off the shelf clamp meters are calculating load when using only a single leg?
Hey Craig,
First off, thanks for open sourcing this project! I've recently been using it as a reference to develop a power monitor with 6 CS5463s for 3 phases of solar generation and 3 phases of household consumption.
Unfortunately, I think that I may have found a potential issue when examining your hardware specs. In your PowerMeterCurrent_DigikeyBOM.txt it indicates that the value of your current sensing resistors is 5 ohms. In your documentation you recommend using sct-013-000 100A:50mA current transducers. Furthermore, on page 7 of the CS5463 datasheet, it indicates that the differential current inputs can handle up to a 500mVpp difference (+/- 250mV since the signals are ground tied).
From those numbers I'm getting that the CS5463 would only be able to measure up to a maximum of 70.8A of sinusoidal input, not 100A before the CS5463 current readings start "peaking". I believe that you may have forgotten to divide by sqrt(2) when choosing your 5 ohm current sense resistor. My reasoning for dividing by sqrt(2) when going from a peak-peak to RMS can be found at the bottom of the Average Electrical Power section of the Root Mean Square Wikipedia page where it states that Vrms = Vp / sqrt(2).
If the CS5463 can measure a max of 250mV peak, then it can only handle a 250mVp / sqrt(2) = 177mVrms sinusoidal signal without "peaking". Dividing this by your current sense resistor of 5 ohms gives 177mVrms / 5 ohms = 35.4 mArms through your current sense resistor. Finally, multiplying that by the turns ratio for the sct-013-000 of 100A:50mA (N = 2000) gives 35.4mArms * 2000 = 70.8Arms through the current transducer before "peaking" begins to occur.
I believe that if you were to substitute a 5.00 ohm / sqrt(2) = 3.5 ohm resistor, you would again be able to read the full 100Arms range of the sct-013-000.
I am quite new to hardware of this complexity, so it is likely that I have made a mistake in dividing by sqrt(2), but I wanted to bring this to your attention nonetheless. Have you been able to take measurements above 70.8 A of sinusoidal current? While currents this high are unlikely to be seen under normal circumstances, I believe that the PiPowerMeter would not be able to handle them.
Thanks again for your time and for developing this amazing project,
Julian
This is more a question. The Irms and Vrms seems to always be positive no matter what the direction of the CT is and no matter what the direction of the current/voltage is.
I have a couple of CT on a Solar line and the Grid that is sometimes fed by Solar and then becomes negative Power.
How can I find out the direction of the power with the CS5490 ?
Thank you,
Christian
Hi there,
Just tried to do a fresh install of the current version of PiPowerMeter but can not get it to work correctly (I'm back to using my old version via a disk img I had created back in 2019 - PiPowerMeter Software timestamp: 018-11-26T02:58:19.000Z
).
The installer seems to complete without any errors, it does hang for a while here and there thou.
Once installed and rebooted the web page is accessible but no power readings can be obtained and the nodejs.err.log has the following error:
Error: Cannot find module '/home/pi/app/node_modules/CS5490/build/Release/CS5490.node'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:364:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:577:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/pi/app/CS5490.js:3:14)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32) {
code: 'MODULE_NOT_FOUND',
path: '/home/pi/app/node_modules/CS5490/package.json',
requestPath: 'CS5490'
}
node:events:491
throw er; // Unhandled 'error' event
^
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at new NodeError (node:internal/errors:387:5)
at ChildProcess.target.send (node:internal/child_process:742:16)
at /home/pi/app/driver.js:170:20
at /home/pi/app/database.js:874:37
at Statement.<anonymous> (/home/pi/app/database.js:605:17)
Emitted 'error' event on ChildProcess instance at:
at node:internal/child_process:746:35
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
code: 'ERR_IPC_CHANNEL_CLOSED'
}
node:internal/modules/cjs/loader:372
throw err;
^
Error: Cannot find module '/home/pi/app/node_modules/CS5490/build/Release/CS5490.node'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:364:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:577:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/pi/app/CS5490.js:3:14)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32) {
code: 'MODULE_NOT_FOUND',
path: '/home/pi/app/node_modules/CS5490/package.json',
requestPath: 'CS5490'
}
Fresh install details:
Rpi 3B 1GB
SD card flashed with official image - "2021-03-04-raspios-buster-armhf-lite.img"
Logged on as pi then executed: wget -O - https://raw.githubusercontent.com/crjens/PiPowerMeter/master/setup.sh | bash
driver.js in line 125 contains invalid if sentence
should be
if (data.Configuration....
Hi,
Just before I wanted to order the components I try to install the software, but whatever I try, I keep getting errors as below.
Does anyone has suggestions? I am running 2020-02-13-raspbian-buster-lite
Many thanks in advance, Jan
make: *** [CS5490.target.mk:109: Release/obj.target/CS5490/CS5490.o] Error 1
make: Leaving directory '/home/pi/app/node_modules/CS5490/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/.nvm/versions/node/v14.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 4.19.97-v7+
gyp ERR! command "/home/pi/.nvm/versions/node/v14.15.3/bin/node" "/home/pi/.nvm/versions/node/v14.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/app/node_modules/CS5490
gyp ERR! node -v v14.15.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
Enable UART
Disable bluetooth
Removed /etc/systemd/system/multi-user.target.wants/hciuart.service.
CS5490 is installed. Please reboot to apply changes.
[email protected] install /home/pi/app/node_modules/sqlite3
node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.0/napi-v3-linux-arm.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v83 ABI, glibc) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/app/node_modules/sqlite3/build'
AND:
[email protected] install /home/pi/app/node_modules/CS5490
/bin/bash ./install.sh
make: Entering directory '/home/pi/app/node_modules/CS5490/build'
CXX(target) Release/obj.target/CS5490/CS5490.o
../CS5490.cc: In function ‘void DriverVersion(const Nan::FunctionCallbackInfov8::Value&)’:
../CS5490.cc:110:75: error: no matching function for call to ‘Nan::ReturnValuev8::Value::Set(v8::MaybeLocalv8::String)’
info.GetReturnValue().Set(String::NewFromUtf8( isolate, version.c_str() ));
^
My Pipowermeter is now quite old and has been sitting in a box. I now have time to revisit it and get it going. However, when I start installing it there seems to be a lot of code errors in getting the preliminary dependencies even before loading the Pi software itself. Is there new instructions on how to do the initial install with new references?
Thanks.
Are these board purchaseable someplace?
This looks to be the best raspberry pi based power monitor I could find on the net.
the only other one I could find was this: https://store.ncd.io/product/12-channel-on-board-95-accuracy-ac-current-monitor-with-i2c-interface/
but your project looks more flexible and even has a way to monitor the mains in the breaker panel.
Hello,
We are a young company starting an electric motorcycle business in Uganda. For this purpose, we need to measure the consumption of 6 motorcycles chargers independently. And your solution looks terrific. Is there a way to find the hardware you use here? We are open to discussion to buy your solution.
Hope to read you soon!
Hi Craig!
I'm XO from the Philippines. First, I would like to thank you for your PiPowerMeter. I recently used your schematic of the board and have it printed. I bought the BOM, however some are not available, will it be possible to change the components with the same specifications? Also, my mains do not have grounding and neutral wire, it is ok to use only the two live wire? (240V Line-Line).
Thanks!
I am interested in this project. But I have some questions?
Is the project still active?
What is the difference between v2.2 and v4.0?
Is there any "ready-to-use" gerber files that can be uploaded?
Any up-to-date BOM files?
Pick-and-place instructions for fab-house?
How 's the kWh calculation going?
How many measurements take place per hour?
And in general it is interesting for how much ms get full data on current?
Just I made an almost similar device, but I use MCP3208CI/SL there and all rms calculate in code, more than 40 current sensors do not get to use to withstand 3200 measurements per hour.
Thanks.
Hi folks,
I am using the boards of the fork from CircuitSetup which are based on the Version 2.2 of the crjens boards. Due to circumstances I was only able to finish the assembly of the boards by now and I am trying to use the current software of this master version.
I have troubles getting the voltage reference working. The probe overview looks like this:
The configuration of the probes is this:
The overall configuration is this:
For reference, here some information:
I am living in Germany and trying to use a three phase network with neutral.
I am using the TV16E voltage transformers from YHDC (black ones).
What seems strange to me:
a) The frequency of all three phase-phase references is nearly a plausible value of ~50Hz.
b) The secondary side of the voltage transformers (TV16E) is reversed when comparing the data sheet of the TV16E and the schematics of version 2.2 of the boards (does this matter?)
Can anybody give me a hint on this, where to look first?
Is there any configuration that has to be done additionally to the this to work (e.g. enable voltage references or something like that)?
How can I check if the CS5463 is reading a plausible voltage value?
Thanks!
Cheers elektrolubach
When install using the latest instructions I receive the following error during the install process --
wiringpi-latest.deb 100%[=====================================================================================>] 51.04K 224KB/s in 0.2s
2022-03-13 12:52:17 (224 KB/s) - ‘wiringpi-latest.deb’ saved [52260/52260]
Selecting previously unselected package wiringpi.
(Reading database ... 40126 files and directories currently installed.)
Preparing to unpack wiringpi-latest.deb ...
Unpacking wiringpi (2.52) ...
Setting up wiringpi (2.52) ...
Processing triggers for man-db (2.8.5-2) ...
Install PiPowerMeter
bash: line 32: git: command not found
bash: line 33: cd: app: No such file or directory
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/pi/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2022-03-13T16_52_29_821Z-debug-0.log
PiPowerMeter is installed
Restarting...
So when I use the URL to access the GUI I receive the message "This site can’t be reached"
The BoM file generated by eagle for V4.0 boards has a discrepancy.
On PiPowermeter board. The resistors value is 59K. The BoM Partnumber is of 1K resistors
On PiPowermeterCurrent board. The resistor value is 5K but the part number is 7.5K.
hi there,
I need your help!
Which hardware do you have select?
Do you have details or maybe a datasheet/shopping link?
i can´t find anything about boards like yours!
best regards
Linus
Hello,
On some of my probes I have a few watts of remanence while nothing is consumed (2x93W in the example attached). Do you have any idea where this could be coming from? How can I investigate? Should I play with the "scale"? I didn't touch these values in practice.
Many thanks in advance (for the answer and for the product).
PS: I wrote to you for a board order 4 days ago, I don't know if you saw my email or if it's a spam problem again.
Sent you a PM
First of all. Thanks for all the work that you've done with this project, and for putting it up on here.
I just uploaded a slightly reworked version of the two boards to my fork of your project. I moved everything that was on the bottom side to the top, and replaced through hole components with smd.
I'm just curious if the resistor arrays for the voltage readings were on the back of the board for a reason, like to cut down on transients interfering with other components? I noticed the space between the copper fills was increased a lot around the high voltage components, but wasn't sure if that was enough.
It would be really nice to be able to choose the location of the db file. The db writings make the system's SD card very tired. I would like to put it in tmps or on another media.
Hello,
Thanks for making this project. I started my own with a standard MCP3208 but found that a 12bit ADC is not accurate enough. I like the approach of the CS5490.
I have a question for you. In the driver.js, I saw that you have some provision for MQTT but I could not find anywhere on the configuration web page a way to enter the MQTT server, username, password and port. Am I missing something ?
Thanks
Chris
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.