Post History
Generally you can protect against most kind of harmful events with a TVS placed on the output, with a value slightly higher than your expected signal voltage so roughly 6V. The only thing the idea...
#1: Initial revision
Generally you can protect against most kind of harmful events with a TVS placed on the output, with a value slightly higher than your expected signal voltage so roughly 6V. The only thing the idea of building this yourself with BJTs got going for is somewhat fast switching but <100Hz is slow. A generic buffer IC with 3.3V on one side and 5V on the other would work about the same and if you can find a fairly modern one it ought to have ESD protection. Maybe there is one which can drive 50mA even? You can also check out "analog switches" - fast switching parts usually designed for lower voltages. Another solution is to get pre-made "smart MOSFET driver" which is essentially a MOSFET that can supply lots of current while remaining rugged and protected against all kinds of harm: shorts, ESD, polarity flips etc. The automotive industry use them for relay replacement so the main thing is that they can source a lot of current (which you don't need). I'm not sure if there are any that can work with relatively low voltages - they are designed for 5V gate voltage, but a standard buffer IC between the MCU and the driver would fix that. This is best answered by browsing the stock of a suitable IC manufacturer. Infineon has a lot to pick from for these kind of parts so maybe check https://www.infineon.com/products/power/gate-driver-ics. Renesas, ST, Onsemi etc should have similar products.
