Disclaimer: don't use this for anything, This is my first circuit I created (here or elsewhere). My goal was to set the circuit in a way that it amplifies the function of the flyback diode.
I am planning my first IOT miniproject where I want to control a relay with a MCU and I wanted to have some grasp of how the protection works.