u/GonnaChangeThisL8er

Hi all,

I want to make a clock generator and divider using a Lilygo T-QT Pro, which is sized perfectly for a 4HP module. The board is based on an ESP32 so 0-3.3V at the GPIO pins.

I am still not sure how to design the hardware to prevent accidentally frying the ESP32. Currently, I plan to use NPN transistors to isolate the GPIO pins. This inverts the logic but can be easily inverted back via software.

Planned design for a gate/trigger input: https://is.gd/grZZed

  • 100k resistor for high input impedence
  • diode to block negative input voltages
  • 27k resistor as voltage divider to increase level needed for a trigger to about 3V (instead of 0.6V)
  • transistor to isolate the ESP32 from the hot input signal
  • 10k to limit current through transistor / into ESP32

https://preview.redd.it/xik7byrmm5zg1.png?width=1300&format=png&auto=webp&s=fddcbce93183ee203d447fc5af100eae5d89f118

Planned design for gate/trigger output: https://is.gd/JnlUJq

  • 10k resistor to limit current through transistor
  • transistor to raise 3.3V out to more standard 5V out for gates/triggers
  • transistor also ensures that current drawn by other modules comes from the 5V rail instead of the ESP32
  • 2k resistor to limit current through transistor but still have low-ish output impedence (3k in total)
  • diode to protect transistor from negative voltage, if an input is accidentally plugged into this output (and 1k to limit current into that diode)

https://preview.redd.it/brb4mg0sm5zg1.png?width=1537&format=png&auto=webp&s=19ccafa3697a141888082eade7fffcb71fdf9824

As you can see, the circuits are not only for protection but also adjusting the voltage levels to better interface with other modules.

Now I am wondering:

  • Am I missing something here or should this work reliably?
  • Is this overkill and there is a simpler way?

Thanks!

reddit.com
u/GonnaChangeThisL8er — 10 days ago