Esp32 x8 board and manual button

Hello everyone,

I need help adding 8 physical buttons to this board ESP32 Relay Board x8 | devices.esphome.io

GPIO 12, 13, 14, 25, 26, 27, 32, and 33 are already used for the relays, while GPIO 23 is for the status LED and I need another one for a DS18B20 sensor.

Therefore, the available GPIO pins for connecting 8 buttons are limited, and I would need to use pull-up resistors for all of them.

Using I2C would be a better solution, but I have no idea about the type of IC to use or the connection diagram. I’m not sure if pull-up resistors are needed or about the yaml file for the board.

Has anyone had experience with this?

You don’t need an I2C expansion chip. You have one i/p to spare.

GPIO Use
12 Rly
13 Rly
14 Rly
16 S1
17 S2
18 S3
19 S4
21 S5
22 Dalas
23 LED
25 Rly
26 Rly
27 Rly
32 Rly
33 Rly
34 S6 needs physical pull-up
35 S7 needs physical pull-up
36 S_VP S8 needs physical pull-up
39 S_VN Spare (input only) needs physical pull-up

And if you are careful GPIO 4 is available too.

1 Like

Thank you so much!
i/p maybe you meant to write i/o?
S1 to S5 go to GND or VCC?

No. The spare, GPIO39, is an input (i/p) only.

That’s up to you (and it is all of them, S1 to S8). You did say “pull-up resistors” though so in that case the switch would connect the GPIO to ground when active (on). In this case you would set the input to inverted in software.

If you used pull-down resistors then the switch would have to connect the GPIO to 3.3v when active. In this case you do not invert the input in software.

GPIOs 34 to 39 are input only and do not have software pull-up or down resistors, hence the need for physical ones (10k Ohm is a good value). The other inputs do have software enableable pull-up/down resistors available so you don’t have to add physical ones.

2 Likes

What are GPIO 36 and 39?

They are the pins labelled SVP and SVN