-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/add_power_measure_component' into 'master'
feat: add component for power metering chip See merge request ae_group/esp-iot-solution!1111
- Loading branch information
Showing
34 changed files
with
1,857 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## v0.1.0 - 2024-11-5 | ||
|
||
### Enhancements: | ||
|
||
* Initial version | ||
* Support BL0937 chip to measure voltage, current, energy | ||
|
||
## v0.1.1 - 2024-12-10 | ||
|
||
### Enhancements: | ||
|
||
* Modified the formatting of the document | ||
* Added more detailed documentation | ||
* Optimised some code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
idf_component_register(SRC_DIRS "." | ||
INCLUDE_DIRS "include" | ||
PRIV_INCLUDE_DIRS "priv_include" | ||
REQUIRES esp_timer driver esp_event | ||
) | ||
|
||
include(package_manager) | ||
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
menu "power_measure" | ||
config BL0937_IRAM_OPTIMIZED | ||
bool "Enable IRAM optimization for BL0937" | ||
default n | ||
help | ||
Enable IRAM optimization for BL0937 | ||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Component Power_Measure | ||
|
||
## Overview | ||
|
||
This example demonstrates how to use the **BL0937** power measurement chip to detect electrical parameters such as voltage, current, active power, and energy consumption. It is implemented for **ESP32** using FreeRTOS, and shows how to configure and interface with the BL0937 power measurement chip. The example initializes the power measurement system, fetches various parameters, and logs them at regular intervals. | ||
|
||
This example supports the **BL0937** power measurement chip, which is capable of measuring: | ||
|
||
1. **Voltage** | ||
2. **Current** | ||
3. **Active Power** | ||
4. **Energy** | ||
|
||
The primary goal is to demonstrate how to configure the hardware pins, initialize the power measurement system, and retrieve the data from the chip. | ||
|
||
## Features | ||
|
||
* Measures **voltage** , **current** , **active power** , and **energy** . | ||
* Configures **BL0937** power measurement chip. | ||
* Supports overcurrent, overvoltage, and undervoltage protection. | ||
* Energy detection is enabled for accurate readings. | ||
* Regularly fetches power readings every second and logs them. | ||
|
||
## Hardware Requirements | ||
|
||
The example uses the **BL0937** power measurement chip. To connect it, the following pins must be configured on the ESP32: | ||
|
||
| Variable | GPIO Pin | Chip Pin | | ||
| ------------------- | -------------- | -------- | | ||
| `BL0937_CF_GPIO` | `GPIO_NUM_3` | CF Pin | | ||
| `BL0937_SEL_GPIO` | `GPIO_NUM_4` | SEL Pin | | ||
| `BL0937_CF1_GPIO` | `GPIO_NUM_7` | CF1 Pin | | ||
|
||
Make sure that these GPIO pins are correctly connected to the respective pins on the **BL0937** chip in your hardware setup. |
Oops, something went wrong.