Skip to content

Commit

Permalink
v117
Browse files Browse the repository at this point in the history
## v117:
* Add ESP32C3 board support (esp32-c3-devkitm-1)
* Add board Pin definition in board_xx.yaml
* Separate logger config in logger.yaml
* Separate sn74hc595 config in sn74hc595.yaml
* sn74hc595 : remove OE pin not needed anymore by esphome (connected to GND)
* add onewire sample configuration
  • Loading branch information
nliaudat authored Jul 7, 2024
1 parent 388221e commit b54cd06
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 11 deletions.
67 changes: 67 additions & 0 deletions board_esp32-C3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
esphome:
name: ${name}
on_boot:
priority: -200
then:
- delay: ${onboot_valve_calibration_delay} #1min
- script.execute: valve_maintenance

project:
name: "nliaudat.floor-heating-controller"
version: "${revision}.dev"
###### only for ESP32-C3 boot loop fix
platformio_options:
board_build.f_flash: 40000000L
board_build.flash_mode: dio
board_build.flash_size: 4MB

substitutions:
#board and compilation
board: esp32-c3-devkitm-1 #ESP C3 supermini : makergo_c3_supermini or nologo_esp32c3_super_mini or seeed_xiao_esp32c3 , esp32-c3-devkitm-1
variant: esp32c3
framework: esp-idf #arduino

# https://www.sudo.is/docs/esphome/boards/esp32c3supermini/
#Pin definition
sn74hc595_data_pin: GPIO21
sn74hc595_clock_pin: GPIO10
sn74hc595_latch_pin: GPIO20
# sn74hc595_oe_pin: GPIO18
adc_bemf_1_pin: GPIO0
adc_bemf_2_pin: GPIO1
adc_bemf_3_pin: GPIO3
adc_bemf_4_pin: GPIO4
onewire_pin: GPIO6

esp32:
board: ${board}
framework:
type: ${framework} #esp-idf #arduino
version: recommended #latest
sdkconfig_options:
CONFIG_COMPILER_OPTIMIZATION_SIZE: y
# Advanced tweaking options for ESP32-C3
advanced:
ignore_efuse_mac_crc: false

preferences:
flash_write_interval: 60min


ota:
- platform: esphome

safe_mode:


# https://git.sudo.is/ben/infra/src/branch/main/roles/hass-esphome/files/packages/boards/esp32c3supermini.yaml

# light:
# - platform: status_led
# name: "${name} Status LED"
# id: espc3_status_led
# icon: "mdi:alarm-light"
# pin:
# number: GPIO8
# inverted: true
# restore_mode: ALWAYS_OFF
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# change log
## v117:
* Add ESP32C3 board support (esp32-c3-devkitm-1)
* Add board Pin definition in board_xx.yaml
* Separate logger config in logger.yaml
* Separate sn74hc595 config in sn74hc595.yaml
* sn74hc595 : remove OE pin not needed anymore by esphome (connected to GND)
* add onewire sample configuration
## v116:
* Revert ADC multisampling - not working good
## v115:
Expand Down
15 changes: 8 additions & 7 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
substitutions:
name: floor-heating-controller
friendly_name: "Floor heating"
revision: "1.115"

#board and compilation
board: nodemcu-32s
framework: esp-idf #arduino

revision: "1.117"

#time
TZ: "Europe/Zurich" #timezone
reboot_days_of_week: "MON"
Expand Down Expand Up @@ -436,15 +432,20 @@ packages:




board: !include board_esp32.yaml
# board: !include board_esp32-C3.yaml
logger: !include logger.yaml
sn74hc595: !include sn74hc595.yaml
wifi: !include wifi.yaml
board: !include board.yaml
time: !include time.yaml
script_calibrate_valves: !include script_calibrate_valves.yaml
switch_others: !include switch_others.yaml
inputs: !include inputs.yaml
sensor_adc: !include sensor_adc.yaml
sensor_temperature: !include sensor_temperature.yaml
sensor_others: !include sensor_others.yaml
# onwire: !include onewire.yaml



Expand Down
14 changes: 14 additions & 0 deletions logger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Enable logging
logger:
level: DEBUG #NONE# ERROR #INFO #DEBUG #VERBOSE
#baud_rate: 0 #to disable logging via UART
logs:
adc: INFO
sensor: ERROR
binary_sensor: INFO
cover: INFO
switch: INFO
climate: INFO
endstop : DEBUG
text_sensor : ERROR
homeassistant.sensor: ERROR
9 changes: 9 additions & 0 deletions onewire.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
one_wire:
- platform: gpio
pin: ${onewire_pin}

sensor:
- platform: dallas_temp
address: 0x1234567812345628
name: temperature
update_interval: 120s
8 changes: 4 additions & 4 deletions sensor_adc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sensor:
### new version with opamp
## in use the motor use 15-20 mV. At endstop, it raise to 50 mV
- platform: adc
pin: GPIO36
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
Expand All @@ -19,7 +19,7 @@ sensor:
id : BEMF_1_2_sensor_ADC

- platform: adc
pin: GPIO39
pin: ${adc_bemf_2_pin} #GPIO39
name: "BEMF 2" #CH3 + CH4
update_interval: 100ms
attenuation : 0db
Expand All @@ -34,7 +34,7 @@ sensor:
id : BEMF_3_4_sensor_ADC

- platform: adc
pin: GPIO34
pin: ${adc_bemf_3_pin} #GPIO34
name: "BEMF 3" #CH5 + CH6
update_interval: 100ms
attenuation : 0db
Expand All @@ -48,7 +48,7 @@ sensor:
id : BEMF_5_6_sensor_ADC

- platform: adc
pin: GPIO35
pin: ${adc_bemf_4_pin} #GPIO35
name: "BEMF 4" #CH7 + CH8
update_interval: 100ms
attenuation : 0db
Expand Down
9 changes: 9 additions & 0 deletions sn74hc595.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SN74HC595 I/O Expander (shift register) to control L9110s chips
# https://esphome.io/components/sn74hc595.html
sn74hc595:
- id: 'sn74hc595_hub'
data_pin: ${sn74hc595_data_pin} #GPIO16 #Pin connected to SN74HC595 SER input
clock_pin: ${sn74hc595_clock_pin} #GPIO5 #Pin connected to SN74HC595 SRCLK pin
latch_pin: ${sn74hc595_latch_pin} #GPIO17 #Pin connected to SN74HC595 RCLK pin
#oe_pin: ${sn74hc595_oe_pin} #GPIO18 ### needed by esphome, but connected to GND (outputEnable is used only for pwm all the pin)
sr_count: 2 #Number of daisy-chained shift registers, up-to 4

0 comments on commit b54cd06

Please sign in to comment.