Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added wiring diagrams, datasheet and comments on code #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added SD3004 datasheet v0.2c.pdf
Binary file not shown.
13 changes: 10 additions & 3 deletions examples/PZEMDisplay/PZEMDisplay.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#include <SoftwareSerial.h> // Arduino IDE <1.6.6
#include <PZEM004T.h>


//http://www.webx.dk/oz2cpu/energy-meter/energy-meter.htm
//https://wiki.cuvoodoo.info/doku.php?id=spark_abacus
//https://www.arduino.cc/en/Tutorial/SoftwareSerialExample
//https://wiki.cuvoodoo.info/doku.php?id=spark_counter#peacefair_pzem-004
//* RX is digital pin 10 (connect to TX of other device)
//* TX is digital pin 11 (connect to RX of other device)
PZEM004T pzem(10,11); // (RX,TX) connect to TX,RX of PZEM

IPAddress ip(192,168,1,1);

void setup() {
Expand All @@ -11,8 +19,7 @@ void setup() {

void loop() {
float v = pzem.voltage(ip);
if (v < 0.0) v = 0.0;
Serial.print(v);Serial.print("V; ");
if (v > 0.0) {Serial.print(v);Serial.print("V; "); }

float i = pzem.current(ip);
if(i >= 0.0){ Serial.print(i);Serial.print("A; "); }
Expand All @@ -25,5 +32,5 @@ void loop() {

Serial.println();

// delay(1000);
//delay(1000);
}
Binary file added examples/SampleOutput.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/SampleWiringDiagram.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading