Projects/IoT & Electronics/ESP8266/ESP3232: Home Assistan...
February 24, 2019
4 min read
IoT & Electronics

ESP8266/ESP3232: Home Assistant Switch Connected to PCF8574 Controlling 8 AC Relays

📺 Watch the Video View on YouTube --- Home Assistant Switch for 8 Relays: PCF8574 can be used to extend the GPIO of ESP8266/32 and here we use 8 port...

📺 Watch the Video

View on YouTube


Home Assistant Switch for 8 Relays: PCF8574 can be used to extend the GPIO of ESP8266/32 and here we use 8 ports of PCF8574 to control 8 Relay module

GitHub: debsahu/PCF8574_8Relay

Home Assistant Switch for 8 Relays

  • Code can compile on ESP8266/32
  • PCF8574 can be used to extend the GPIO of ESP8266/32
  • 8 ports of PCF8574 is connected to 8 Relay module

Libraries Needed

platformio.ini is included, use PlatformIO and it will take care of installing the following libraries.

Hardware

Items

  1. ESP8266 (aliexpress) / ESP32 (aliexpress)
  2. 3.3V to 5V converter (aliexpress)
  3. PCF8574AP (aliexpress)
  4. 8-port relay (aliexpress)
  5. Plastic Box (amazon)
  6. AC plug socket (aliexpress)
  7. 3-pin AC cable (aliexpress)
  8. 2 sockets (Home Depot)

Instructions

  • Break the tab on the sides with brass screws
  • Connect each of the brass screws to Normally Open (N/O) on relay

plug

  • Use PCF8574AP (exact version used here)
  • Use 3.3V to 5V level shifters for ESP8266 I2C data
  • Set A0, A1, A2 to GND so I2C address is 0x20
  • Use 5V as VCC on PCF8574AP
  • Use a good 110V AC to 5V DC device like a phone charger

schematic

Explore More