-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
sensor_adc.yaml
77 lines (69 loc) · 2.38 KB
/
sensor_adc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
sensor:
#ADC2 pins cannot be used when Wi-Fi is used
#https://docs.espressif.com/projects/esp-idf/en/v5.3.2/esp32/api-reference/peripherals/adc_oneshot.html
# ADC_ATTEN_DB_0 : 100 mV ~ 950 mV
# ADC_ATTEN_DB_2_5 : 100 mV ~ 1250 mV
# ADC_ATTEN_DB_6 : 150 mV ~ 1750 mV
# ADC_ATTEN_DB_12 : 150 mV ~ 2450 mV
- platform: adc
pin: ${adc_bemf_1_pin} #GPIO36
name: "BEMF 1" #CH1 + CH2
update_interval: 50ms # the start of motor need a lot of current, it must be averaged to not trigger the endstop. 50ms update interval with sliding_window_moving_average [5,5] works
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: ${adc_zero_calibration} # stall voltage : https://github.com/nliaudat/floor-heating-controller/wiki/BEMF-trigger-calculation
# - skip_initial: 10
# only for binary sensors : - delayed_on_off: 100ms # prevent trigger at motor start : https://esphome.io/components/binary_sensor/
- sliding_window_moving_average:
window_size: 5
send_every: 5
id : BEMF_1_2_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF
- platform: adc
pin: ${adc_bemf_2_pin} #GPIO39
name: "BEMF 2" #CH3 + CH4
update_interval: 50ms
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: ${adc_zero_calibration}
- sliding_window_moving_average:
window_size: 5
send_every: 5
id : BEMF_3_4_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF
- platform: adc
pin: ${adc_bemf_3_pin} #GPIO34
name: "BEMF 3" #CH5 + CH6
update_interval: 50ms
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: ${adc_zero_calibration}
- sliding_window_moving_average:
window_size: 5
send_every: 5
id : BEMF_5_6_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF
- platform: adc
pin: ${adc_bemf_4_pin} #GPIO35
name: "BEMF 4" #CH7 + CH8
update_interval: 50ms
attenuation : 0dB #auto
accuracy_decimals: 3
# samples: 10
filters:
- offset: ${adc_zero_calibration}
- sliding_window_moving_average:
window_size: 5
send_every: 5
id : BEMF_7_8_sensor_ADC
# web_server:
# sorting_group_id: sorting_group_BEMF