Skip to content

Commit

Permalink
set attenuation : auto
Browse files Browse the repository at this point in the history
auto mode is now working fine. 
replace 
attenuation : 2.5db
  • Loading branch information
nliaudat authored Sep 13, 2024
1 parent 0d58297 commit 5149efd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions sensor_adc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@
sensor:
#ADC2 pins cannot be used when Wi-Fi is used

#https://docs.espressif.com/projects/esp-idf/en/v4.4.7/esp32/api-reference/peripherals/adc.htm
# 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

### new version with opamp
## in use the motor use 15-20 mV. At endstop, it raise to 50 mV
- platform: adc
pin: ${adc_bemf_1_pin} #GPIO36
name: "BEMF 1" #CH1 + CH2
update_interval: 100ms # the start of motor need a lot of current (>480 mv), it must be averaged to not trigger the endstop. If 10ms, it always stop. The BEMF trigger must be approx 0.32mv
attenuation : 0db
attenuation : auto
accuracy_decimals: 3
# samples: 10
filters:
Expand All @@ -22,7 +28,7 @@ sensor:
pin: ${adc_bemf_2_pin} #GPIO39
name: "BEMF 2" #CH3 + CH4
update_interval: 100ms
attenuation : 0db
attenuation : auto
accuracy_decimals: 3
# samples: 10
filters:
Expand All @@ -37,7 +43,7 @@ sensor:
pin: ${adc_bemf_3_pin} #GPIO34
name: "BEMF 3" #CH5 + CH6
update_interval: 100ms
attenuation : 0db
attenuation : auto
accuracy_decimals: 3
# samples: 10
filters:
Expand All @@ -51,7 +57,7 @@ sensor:
pin: ${adc_bemf_4_pin} #GPIO35
name: "BEMF 4" #CH7 + CH8
update_interval: 100ms
attenuation : 0db
attenuation : auto
accuracy_decimals: 3
# samples: 10
filters:
Expand Down

0 comments on commit 5149efd

Please sign in to comment.