105 lines
2.3 KiB
Markdown
105 lines
2.3 KiB
Markdown
# ESPHome components/ads131m08
|
|
|
|
This folder contains source code files and related resources for external ads131m08 component.
|
|
|
|
## Example .yaml config
|
|
|
|
---
|
|
|
|
```yaml
|
|
substitutions:
|
|
ESP32_S3_SPI0_SCK: GPIO12
|
|
ESP32_S3_SPI0_MISO: GPIO13
|
|
ESP32_S3_SPI0_MOSI: GPIO11
|
|
ADC_SYNC_RESET_PIN: GPIO21
|
|
ADC_CS_PIN: GPIO41
|
|
ADC_DRDY_PIN: GPIO42
|
|
|
|
spi:
|
|
- id: spi_bus0
|
|
clk_pin: ${ESP32_S3_SPI0_SCK}
|
|
mosi_pin: ${ESP32_S3_SPI0_MOSI}
|
|
miso_pin: ${ESP32_S3_SPI0_MISO}
|
|
interface: hardware
|
|
|
|
ads131m08:
|
|
- id: highres_adc
|
|
spi_id: spi_bus0
|
|
cs_pin: ${ADC_CS_PIN}
|
|
drdy_pin: ${ADC_DRDY_PIN}
|
|
sync_reset_pin: ${ADC_SYNC_RESET_PIN}
|
|
reference_voltage: 1.248 #1.25
|
|
data_rate: 5MHz
|
|
clock_frequency: 8192kHz
|
|
oversampling_ratio: 512
|
|
spi_mode: MODE1
|
|
dcblock_filter: 5 # 10Hz
|
|
power_mode: high
|
|
global_chop: no
|
|
global_chop_delay: 1024
|
|
current_detect: disable
|
|
current_detect_all: no
|
|
current_detect_number: 16
|
|
current_detect_length: 768
|
|
current_detect_threshold: -500
|
|
|
|
sensor:
|
|
- platform: ads131m08
|
|
ads131m08_id: highres_adc
|
|
channel: 0
|
|
id: ads_ch0
|
|
gain: 1
|
|
input_select: normal
|
|
offset_calibration: 0
|
|
gain_calibration: 0.986
|
|
ac:
|
|
name: "ac_ch0"
|
|
id: ac_ch0
|
|
filters:
|
|
- multiply: 2884
|
|
- sliding_window_moving_average:
|
|
window_size: 50
|
|
send_every: 25
|
|
send_first_at: 10
|
|
|
|
- platform: ads131m08
|
|
ads131m08_id: highres_adc
|
|
channel: 1
|
|
id: ads_ch1
|
|
gain: 1
|
|
input_select: normal
|
|
offset_calibration: 0
|
|
gain_calibration: 0.986
|
|
ac:
|
|
name: "ac_ch1"
|
|
id: ac_ch1
|
|
filters:
|
|
- multiply: 2884
|
|
- sliding_window_moving_average:
|
|
window_size: 50
|
|
send_every: 25
|
|
send_first_at: 10
|
|
|
|
- platform: ads131m08
|
|
ads131m08_id: highres_adc
|
|
channel: 2
|
|
id: ads_ch2
|
|
gain: 1
|
|
input_select: normal
|
|
offset_calibration: 0
|
|
gain_calibration: 1.36153846
|
|
dc_block: enable
|
|
ac:
|
|
name: "ac_ch2"
|
|
id: ac_ch2
|
|
device_class: current
|
|
filters:
|
|
- multiply: 62.97
|
|
- sliding_window_moving_average:
|
|
window_size: 50
|
|
send_every: 25
|
|
send_first_at: 10
|
|
```
|
|
|
|
For more information, visit the [ESPHome documentation](https://esphome.io/).
|