All Projects → mandulaj → Pzem 004t V30

mandulaj / Pzem 004t V30

Licence: mit
Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter

Projects that are alternatives of or similar to Pzem 004t V30

TLV493D-A1B6-3DMagnetic-Sensor
Library for the TLV493D-A1B6 3D magnetic sensor for Arduino.
Stars: ✭ 27 (-65.38%)
Mutual labels:  sensor, arduino-library
TLE5012-Magnetic-Angle-Sensor
This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
Stars: ✭ 37 (-52.56%)
Mutual labels:  sensor, arduino-library
BME680
Arduino Library to access the Bosch BME680 - temperature, pressure, humidity and gas sensor
Stars: ✭ 30 (-61.54%)
Mutual labels:  sensor, arduino-library
Bh1750
An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
Stars: ✭ 173 (+121.79%)
Mutual labels:  sensor, arduino-library
Adafruit TSL2591 Library
This is an Arduino library for the TSL2591 digital luminosity (light) sensors.
Stars: ✭ 46 (-41.03%)
Mutual labels:  sensor, arduino-library
bme280
Arduino and CMake library for communicating with the Bosch Sensortec BME280 environmental sensor.
Stars: ✭ 21 (-73.08%)
Mutual labels:  sensor, arduino-library
ublox
Arduino and CMake library for communicating with uBlox GPS receivers.
Stars: ✭ 89 (+14.1%)
Mutual labels:  sensor, arduino-library
SparkFun CCS811 Arduino Library
A library to drive the AMS CCS811 air quality sensor
Stars: ✭ 38 (-51.28%)
Mutual labels:  sensor, arduino-library
BMP180 Breakout Arduino Library
Arduino libraries for the BMP180 pressure sensor breakout board
Stars: ✭ 30 (-61.54%)
Mutual labels:  sensor, arduino-library
Adafruit CCS811
Arduino driver for CCS811 digital gas sensor
Stars: ✭ 60 (-23.08%)
Mutual labels:  sensor, arduino-library
arduino-sht
Repository for Sensirion humidity and temperature sensor support on Arduino
Stars: ✭ 43 (-44.87%)
Mutual labels:  sensor, arduino-library
SensorFusion
A simple implementation of some complex Sensor Fusion algorithms
Stars: ✭ 101 (+29.49%)
Mutual labels:  sensor, arduino-library
Ultrasonic
Minimalist library for Ultrasonic Module HC-SR04, PING))) and Seeed SEN136B5B to Arduino
Stars: ✭ 77 (-1.28%)
Mutual labels:  sensor, arduino-library
Tm16xx
Arduino TM16xx library for LED & KEY and LED Matrix modules based on TM1638, TM1637, TM1640 and similar chips. Simply use print() on 7-segment and use Adafruit GFX on matrix.
Stars: ✭ 61 (-21.79%)
Mutual labels:  arduino-library
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (-14.1%)
Mutual labels:  arduino-library
Pysmartnode
Micropython Smarthome framework
Stars: ✭ 58 (-25.64%)
Mutual labels:  sensor
Edgeml
This repository provides code for machine learning algorithms for edge devices developed at Microsoft Research India.
Stars: ✭ 1,093 (+1301.28%)
Mutual labels:  sensor
Opensensemap
Platform for storing and exploring sensor data
Stars: ✭ 69 (-11.54%)
Mutual labels:  sensor
Micronmea
A compact Arduino library to parse NMEA sentences.
Stars: ✭ 66 (-15.38%)
Mutual labels:  arduino-library
Sx126x Arduino
Arduino library to use Semtech SX126x LoRa chips and modules to communicate
Stars: ✭ 55 (-29.49%)
Mutual labels:  arduino-library

PZEM-004T v3.0

Arduino communication library for Peacefair PZEM-004T-10A and PZEM-004T-100A v3.0 Energy monitor.


This module is an upgraded version of the PZEM-004T with frequency and power factor measurement features, available at the usual places. It communicates using a TTL interface over a Modbus-RTU like communication protocol but is incompatible with the older @olehs library found here: https://github.com/olehs/PZEM004T. I would like to thank @olehs for the great library which inspired me to write this one.

Common issue:

Make sure the device is connected to the AC power! The 5V only power the optocouplers, not the actual chip. Also please be safe, AC is dangerous. It can cause more serious issues, such as death. You are responsible for your own stupidity. So don't be stupid.

Manufacturer (optimistic) specifications

Function Measuring range Resolution Accuracy TODO: Realistic specifications
Voltage 80~260V 0.1V 0.5%
Current 0~10A or 0~100A* 0.01A or 0.02A* 0.5%
Active power 0~2.3kW or 0~23kW* 0.1W 0.5%
Active energy 0~9999.99kWh 1Wh 0.5%
Frequency 45~65Hz 0.1Hz 0.5%
Power factor 0.00~1.00 0.01 1%

* Using the external current transformer instead of the built in shunt

Other features

  • 247 unique programmable slave addresses
    • Enables multiple slaves to use the same Serial interface
  • Over power alarm
  • Energy counter reset
  • CRC16 checksum
  • Better, but not perfect mains isolation

Example

#include <PZEM004Tv30.h>

PZEM004Tv30 pzem(&Serial3);

void setup() {
  Serial.begin(115200);

  Serial.print("Reset Energy");
  pzem.resetEnergy();


  Serial.print("Set address to 0x42");
  pzem.setAddress(0x42);
}

void loop() {
  float volt = pzem.voltage();
  Serial.print("Voltage: ");
  Serial.print(volt);
  Serial.println("V");

  float cur = pzem.current();
  Serial.print("Current: ");
  Serial.print(cur);
  Serial.println("A");

  float powe = pzem.power();
  Serial.print("Power: ");
  Serial.print(powe);
  Serial.println("W");

  float ener = pzem.energy();
  Serial.print("Energy: ");
  Serial.print(ener,3);
  Serial.println("kWh");

  float freq = pzem.frequency();
  Serial.print("Frequency: ");
  Serial.print(freq);
  Serial.println("Hz");

  float pf = pzem.pf();
  Serial.print("PF: ");
  Serial.println(pf);

  delay(1000);
}

Installation instructions

You should be able to install the library from the Library Manager in the Arduino IDE. You can also download the ZIP of this repository and install it manually. A guide on how to do that is over here: https://www.arduino.cc/en/guide/libraries


Thank you to @olehs for inspiring this library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].