This project demonstrates how to read sensor data from a PZEM-017 power meter using an Arduino Mega. The data includes voltage, current, power, and energy measurements, which are displayed on an I2C LCD screen and sent to the Serial Monitor.
- Arduino Mega 2560
- PZEM-017 Power Meter
- TTL to RS485 Converter Module
- I2C LCD (16x2)
- Jumper wires
- Arduino IDE
- SimpleModbusMaster library
- LiquidCrystal_I2C library
-
Arduino Mega to TTL to RS485 Converter:
TX1
(pin 18)RX1
(pin 19)GND
toGND
5V
toVCC
-
TTL to RS485 Converter to PZEM-017:
A
toA
B
toB
-
Arduino Mega to I2C LCD:
SDA
(pin 20) toSDA
SCL
(pin 21) toSCL
GND
toGND
5V
toVCC
- Download and install the Arduino IDE.
- Install the
SimpleModbusMaster
library. - Install the
LiquidCrystal_I2C
library. - Open the Arduino IDE and load the provided sketch.
- Connect the hardware as described in the wiring diagram.
- Open the Arduino IDE.
- Upload the sketch to your Arduino Mega.
- Open the Serial Monitor to view the sensor data.
Feel free to contribute to this project by submitting issues or pull requests.
This project is licensed under the MIT License.
- Ensure proper connections between the Arduino Mega, TTL to RS485 converter, and the PZEM-017 module.
- The
TxEnablePin
is used to toggle the receive/transmit pin on the RS485 driver. Adjust it if necessary based on your setup.
By following this guide, you should be able to successfully read data from a PZEM-017 power meter using an Arduino Mega, display the data on an LCD screen, and monitor it via the Serial Monitor. This project can help many people in monitoring and managing their power consumption effectively.