I have a PCB (SEPARATE PCB) that I want to test by building up a "Test PCB". The test will involve switching the relays. This PCB (SEPARATE PCB) has a few relays on it, however, they do not have any flyback diodes on it.
I am using an Atmega32 to turn on an IRL540 logic MOSFET. I thought by applying a flyback diode across a resistor and an LED on my Test PCB then the voltage spike can be suppressed through my Test PCB instead of the SEPARATE PCB that does not have a flyback diode.
D3 is a 20V Zener diode
I am not PWMing the MOSFET, just using it has a switch.
Is this method okay? If not how do I prevent the spike from the SEPARATE PCB using my Test PCB?
I cannot tamper with the SEPARATE PCB, by adding components to it
Before:
simulate this circuit – Schematic created using CircuitLab
After: