ESP32 Wiring scheme 2x8ch relay / HASS

thunderbirds
Posts: 1
Joined: Thu Nov 05, 2020 4:55 pm

ESP32 Wiring scheme 2x8ch relay / HASS

Postby thunderbirds » Thu Nov 05, 2020 5:02 pm

Hi all,

We’re trying to setup 1x ESP32 with 2x8ch relay modules (please find wiring scheme).
The relay modules receive power and can be invididual toggled as switches in home assistant.
We tried to attach a pushbutton to the ESP to trigger a scene in HASS.
However, it keeps turning on/off without even pushing a button (see log).

YAML config - binary sensor part:
binary_sensor:
- platform: gpio
name: "esp01_button01"
id: esp01_button01
pin:
number: GPIO34
mode: INPUT_PULLUP
inverted: True

on_state:
then:
- switch.turn_off: esp01_r2_8_button_led
(Manually switching “esp01_r2_8_button_led” works fine as said before)

We think some wiring is incorrect. I think we lack some knowledge regarding electronics.
Could someone check the wiring scheme and clarify what is wrong/give your opinion?
Please don’t hesitate to ask for more information.
Thanks in advance.
Attachments
esp32forum.jpeg
esp32forum.jpeg (477.09 KiB) Viewed 1946 times

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: ESP32 Wiring scheme 2x8ch relay / HASS

Postby becorey » Mon Nov 09, 2020 5:41 am

Try a scope on GPIO34, see if there is noise maybe triggering it.
An RC filter on GPIO34 would be good for switch debounce.
What does "Inverted: True" do? Try inverted: False

The "on_state" might be triggering in a loop. You might need to keep track of the switch state with a flag, see if it flipped, then send the switch command. Try some print debugging to see when on_state is firing.

Who is online

Users browsing this forum: Baldhead and 175 guests