rudloffl wrote: ↑18 Jul 2019, 05:18
Hello to all,
Is it possible to use an IO extension (Via i2c) and connect to it distance sensors or PIRs ?
I would like to automate my garage door and might be short on IOs for my requirement:
- 2 distance sensors (2 IO each)
- 1 PIR would be great (an other IO)
- 2 relays (those will be on an IO extension either way)
- Temperature (can also be done via i2c)
It's most likely possible to fit everything on the esp8266, but I think IO extension can offer more flexibility (and other sensors

).
Any idea ?
Thanks
Laurent
GPIO-4 and GPIO-5 is used as I2C.
I am currently using an MCP23017 with 2 pieces of SR-501 PIR as input, 1 pc door open sensor as input and 1 pin as output with an SSR relay.
I've disabled serial and redefined gpio-3 as output for a buzzer as an extra GPIO. (as rtttl command is not meant for MCP)
GPIO13 is used for RCWL radar sensor, as it did not want to work on the MCP.
Distance sensor is added to GPIO14 and GPIO12 as it needs real GPIO pins.
And there are no more freely usable pins left.
You can use for example:
GPIO-12,GPIO-13,GPIO-14, GPIO-3 for 2 distance sensors (disable serial first and use GPIO-3 as a trigger pin)
GPIO-4&GPIO-5 for I2C to MCP23017 and HTU21D or other I2C temp sensor
1 PIR onto the MCP23017
2 relays onto the MCP23017 (it has to be tested before finalizing, as MCP output can be 25mA/pin and 150mA max)