Protecting your arduino inputs and outputs

Thanks! I’m curious what the advantages are of using a transistor here. My initial thought is that this would be more then enough:

My guess is that, depending on the use-case, you could even leave out the capacitor.

I also received my schottky diodes today :raised_hands: