This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SN74LVCH8T245: Looking for a shift register to interface transistors to an I2C port extender (TCAL6416)

Part Number: SN74LVCH8T245
Other Parts Discussed in Thread: TCAL6416, , LM339B, LM339LV

Tool/software:

Hi

I'm working on a project where I need to sense mains power using a Darlington optocoupler. The output will be read by an I2C port extender (TCAL6416), which is connected to an ESP32. Here’s my setup and thought process, and I'd appreciate any feedback or validation!

Simplified schematics:

Full schematics: https://raw.githubusercontent.com/crgarcia12/electronics-homeassistant-lightscontroll/9c6ecb32e179fa4865b70cdc9c16a9ec8835ebc7/PCB/schematics-v24-1-jlcpcb/readme-media/schematics.svg

Current Setup:

  1. Optocoupler Output: The optocoupler’s output measures about 2.7V in testing, but it could occasionally drop lower.
  2. TCAL6416 Input Requirement: The TCAL6416 detects a high input signal at 0.7 * Vccp, which in my case is around 2.31V.

Challenge: The potential drop in the optocoupler's output voltage means it might not always reach the TCAL6416’s threshold for a high signal.

TCAL6404:

Solution Approach:

  • I plan to use the SN74LVCH8T245 voltage level shifter to reliably shift the signal.
  • Vcc for the level shifter will be set to 3V using a voltage divider. This way, the SN74LVCH8T245 should detect any input above 2V as high, ensuring the TCAL6416 receives a clean signal.

Question:

Are my voltage calculations and approach with the SN74LVCH8T245 correct for ensuring a stable high signal to the TCAL6416?

Do you think on alternatives to the SN74LVCH8T245  or  TCAL6416 that are more suitable for my project?

Thanks in advance for any insights or suggestions!

PS: Full project schematics, code, etc: github.com/.../electronics-homeassistant-lightscontroll