Skip to content

drivers: sensor: pzem004t: add pzem004t AC parameter sensor driver #89123

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

srishtik2310
Copy link

Adds driver for Peacefair pzem004t multifunction AC parameter sensor.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new sensor driver for the Peacefair PZEM004T multifunction AC parameter sensor. Key changes include:

  • New header files defining sensor channels, attributes, and driver configuration.
  • Device Tree binding files to support the new sensor.
  • Implementation of the sensor driver with functions for initialization, data sampling, attribute get/set, and optional energy reset.

Reviewed Changes

Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
include/zephyr/drivers/sensor/pzem004t.h Defines sensor channels and attributes for the new sensor driver.
dts/bindings/vendor-prefixes.txt Adds vendor prefix for Peacefair.
dts/bindings/sensor/peacefair,pzem004t.yaml Provides DTS binding for the sensor device.
drivers/sensor/pzem004t/pzem004t.h Declares register addresses, lengths, scaling factors, and data structures.
drivers/sensor/pzem004t/pzem004t.c Implements the sensor driver with init, sample fetch, and attribute functions.
Files not reviewed (6)
  • drivers/sensor/CMakeLists.txt: Language not supported
  • drivers/sensor/Kconfig: Language not supported
  • drivers/sensor/pzem004t/CMakeLists.txt: Language not supported
  • drivers/sensor/pzem004t/Kconfig: Language not supported
  • tests/drivers/build_all/sensor/app.overlay: Language not supported
  • tests/drivers/build_all/sensor/uart.dtsi: Language not supported
Comments suppressed due to low confidence (1)

dts/bindings/sensor/peacefair,pzem004t.yaml:18

  • Typo detected: 'snsor_attr_set' should be corrected to 'sensor_attr_set'.
after which multiple devices with different addresses can be connected and snsor_attr_set has to be used for each device

@srishtik2310 srishtik2310 force-pushed the add_pzem004t_sensor_driver_support branch from 645c545 to 7d55f13 Compare April 26, 2025 07:31
Adds driver for Peacefair pzem004t multifunction AC parameter sensor.

Signed-off-by: Srishtik Bhandarkar <srishtik.bhandarkar2000@gmail.com>
@srishtik2310 srishtik2310 force-pushed the add_pzem004t_sensor_driver_support branch from 7d55f13 to 54194cb Compare April 26, 2025 07:34
@srishtik2310
Copy link
Author

srishtik2310 commented Apr 28, 2025

I have made the changes suggested in review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants