More

    How to Add more GPIO to ESP devices

    In today’s video we are going to take a look at expanding the GPIO that is available on a ESP32 by using a pcf8575 I/O Expander

    Code used to scan for connected devices

    i2c:
    
      sda: GPIO1
      scl: GPIO3
      scan: true
      id: bus_a

    Code Used for adding the pcf8575 I/O Expander With a contact sensor

    binary_sensor:
      
      - platform: gpio
        name: "pin0"
        id: pin0
        pin:
          pcf8574: pcf8575_hub
          number: 0
          # One of INPUT or OUTPUT
          mode: INPUT
          inverted: true  

    Code For adding a relay

    switch:
      
      - platform: gpio
        name: "pin0"
        id: pin0
        pin:
          pcf8574: pcf8575_hub
          number: 0
          # One of INPUT or OUTPUT
          mode: output
          inverted: true  

    Latest articles

    Previous article

    Related articles

    Leave a reply

    Please enter your comment!
    Please enter your name here

    spot_imgspot_img