One fundamental problem is that you're probably (you haven't said what your LED current is) not operating the MOSFET within its Safe Operating Area. Never go by the 'headline specs' on page-1 of a datasheet. Check page-4 Fig.3 of the datasheet, for DC operation (curve-3 or 5), at say 15V (i.e. car battery is charging), this MOSFET doesn't want to be carrying more than about 50-60mA. With 100ohm in series with your LED, knowing nothing about the LED, my suspicion is that you're at or over that limit, in which case MOSFET death is just a matter of time.
But you may be right, it may be user installation SNAFUs that's causing MOSFET failure. At the very least I'd add a 'polyfuse' (a PTC self-resettable fuse) between the LED & the MOSFET, to provide some over-current protection. Places like Littlefuse & Belfuse have plenty of guidance on selecting the right thing here.
I'll assume you're using a +5V PIC24 on a %V Vcc, and not a 3.3V one, as that MOSFET won't be saturated on with a 3.3V PIC's GPIO. I have a disturbing feeling that if you're quibbling about a single protection resistor that you may not even have decoupling caps on the MCU's Vcc-to-Gnd pins nor on the input & output of the Vregulator. This is bad at the best of times, but especially in the hostile environment of a car.
Selling a product that customers have to install themselves, without "protection" of various kinds, is a recipe for disaster. Customers always reverse the polarity when connecting things like this, or as you guessed, put 12V into the MOSFET's D, and other atrocities that are an unavoidable challenge to try to mitigate. This is one of the differences between a hobby-project and a product :)
There are three main issues that come to my mind:
- Wire resistance: you already took it into account.
- Wire inductance: you already took it into account, too (more on this later).
- Transmission line effects: these will affect your circuit if the wires have a length which is comparable or greater than the minimum wavelength of the "signal".
About point 3: since you are not concerned with signal integrity (your "signal" is the power rail to the relay) you only need to worry if your switching times are too quick (some energy could be reflected back from the line toward your transistor ad fry it). If you switch the MOSET relatively slowly the frequency content of the "step" (a ramp, actually) won't hit that limit and you won't have problems, apart from higher power dissipation in the MOSFET during switching, but given the extremely low duty cycle of the system it is of little concern here probably.
Anyway LTspice has two different models that can represent transmission lines: a lossy one and a non-lossy one. Excerpts from the online guide:
T. Lossless Transmission Line
Symbol Name: TLINE
Syntax: Txxx L+ L- R+ R- Zo= Td=
L+ and L- are the nodes at one port. R+ and R- are the nodes for the
other port. Zo is the characteristic impedance. The length of the line
is given by the propagation delay Td.
This element models only one propagation mode. If all four nodes are
distinct in the actual circuit, then two modes may be excited. To
simulate such a situation, two transmission-line elements are
required. See the schematic file
.\examples\Educational\TransmissionLineInverter.asc to see an example
simulating both modes of a length of coax.
and:
O. Lossy Transmission Line
Symbol Name: LTLIN
Syntax: Oxxx L+ L- R+ R-
Example:
O1 in 0 out 0 MyLossyTline .model MyLossyTline LTRA(len=1 R=10 L=1u
C=10n)
This is a single-conductor lossy transmission line. N1 and N2 are the
nodes at port 1. N3 and N4 are the nodes at port 2. A model card is
required to define the electrical characteristics of this circuit
element.
Model parameters for Lossy Transmission Lines
[...table with all parameters omitted...]
Point 2 is more problematic, especially when switching the relay OFF: you could have an inductive kickback that destroys your MOSFET due to the wire inductance. Note that the diode across the relay won't protect you in this case. Thus a protection Zener at the switching transistor output (between drain and ground, cathode connected to drain) may be necessary to dampen that inductive kickback.
An article on the subject is here (not directly related to your specific case, though).
Best Answer
If a small delay between switching is acceptable, you can easily insert these with minimal parts. This is sometimes called "dead-time insertion" or "dead-time generator", something along those lines. There are tons of variants out there.
This is one of the most common I see around:
Uses a RC time constant to achieve the delay:
You can find a few more on this website. Or just google for "dead-time circuit".