Problem whit my 74HC595

Hi,

I have a problem to control my 8 relays board whit my 74HC595, esp32 nodemcu-32s and ESPHome.

It turning on … but the turn off only after I toggle the switch 3-4 times

OE pin on Low
I have a capacitor between the + an -
All on 5 volts

sn74hc595:
  - id: 'sn74hc595_hub'
    data_pin: GPIO14
    clock_pin: GPIO12
    latch_pin: GPIO04
    

# Individual outputs
switch:
  - platform: gpio
    name: "Zone 1"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 0
      number: 0
      inverted: true
      
  - platform: gpio
    name: "Zone 2"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 1
      number: 1
      inverted: true
      
  - platform: gpio
    name: "Zone 3"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 2
      number: 2
      inverted: true
      
  - platform: gpio
    name: "Zone 4"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 3
      number: 3
      inverted: true

  - platform: gpio
    name: "Zone 5"
    pin:
      sn74hc595: sn74hc595_hub
      # Use pin number 4
      number: 4
      inverted: true

Do you realize the 74HC595 is a shift register and not an octal latch?

https://learn.sparkfun.com/tutorials/shift-registers

I think that sn74hc595 should be powered with 3.3V, since esp32 is 3.3V device.
Take look at:

esp8266 and esp32 are the same internally powered by 3.3V

BIIIGGGG THANKS for the answer !!!

The SRCLR need 3.3V or 5V … It was my problem !

The sn74hc595 can be power with 3.3V or 5V even if the esp32 is 3.3V device

1 Like

Yoou are wellcome. Glad to help.

This is just FYI.

CMOS logic families typically require all unused inputs to be connected to a high or low state (i.e. Vcc or Gnd). Essentially, a floating input could result in unusually high internal currents to flow between Vcc and Gnd.

https://www.ti.com/lit/an/scba004e/scba004e.pdf