After frying a Rpi with this montage 6 months ago:
I followed advice from kind users here and modified the wiring to this back in February:
It has been working fine for 6 months and suddenly yesterday, this montage fried a Rpi again, probably due to a short circuit or maybe PWM failure pushing back current in GPIO.
Now looking for advice on how to protect GPIO on the Rpi. Diode or any other economic solution... PLEASE BE EXPLICIT AND VISUAL IN YOUR ANSWER as I'm a visual learner. If it requires rewiring please draw it or a particular component added, then please name it.
PWM module I'm using:
The Rpi is powered/grounded via a 12V to USB (5V/3A) converter module, which is wired directly to the 12V battery:
Note: I've been almost bullied :P on raspberrypi.stackexchange.com for asking this question and only received attitude and a downvote. If I knew answers to my own questions, I would not be asking. As ridiculous as my drawings or the "spaghetti" wiring may be to some people, I'm here to learn, just like thousands of future users stumbling upon this post looking for the same answer as I am. Hoping electronics SE will have more class and patience with a novice simply learning.
Now thinking of replacing the above PWM modules with OPTOCOUPLER isolated ones like the LR7843 (max 30V/161A) which seems to address the flash back current problem that I suspect is happening with the current cheap PWM modules (which do not have an optocoupling feature).