Question: howto extend GPIO and read them 1 by 1

I want to extend the GPIO’s in order to have 1 esp32 do multiple task(s)

I am (re)building my pellet smoker, (bigger/better)

  • relays to switch the heater,fan(s),auger, lights
  • read the 6 or 8 thermocouplers
  • multiple temperature (meat) readers
  • some controls (buttons and rottary encoder)
  • LCD screen
  • wifi
  • bt proxy

i don’t need everything to be read at 1 exact moment … cycling or reading things 1 by 1 is fine… even the documentation says for example that multiple ADC reading(s) can go wrong … but they don’t give a solution to read in a certain order for example so I need help how to do this.

You’re looking for a Multiplexer.

There are lots that are compatible with ESPHome.

1 Like

It is a matter of counting up your devices and how many GPIOs they require. Then see if esp32 is enough. If not, consider what @brooksben11 said, or use more than one esp32.

1 Like

Probably not quite what you want but I used these recently and they saved me lots of pins (they do this by using i2c).

I coupled this with some multi channel mosfets to drive what was basically a bunch of separate led strips.

I2C devices are good if you want to save on pins without a multiplexer (I haven’t tried one yet).

if you have yaml example(s) that would be great

ITs not the chip/multiplexer that is the issue its how to control it from esphome (aka how to code in the Yaml)

Pretty open-ended question. I haven’t actually used a multiplexer with ESPHome, so I can’t provide any specific examples. But the YAML is going to be specific to what device you end up getting.

I’d start with searching the ESPHome website for supported multiplexers and go from there.

Look for Expander in the docs, I think they all have examples