Problem: I have an induction spike feeding back into my AirCon and Fan control project when the fan or Aircon is switched off. The program keeps running on the microcontroller but the spike disconnects the Raspbery Pi Pico from the SDK (Thonny running Micropython) so I cannot debug my code. My problem is I don't know how to stop the spike hitting the microcontroller and I am not sure if it may damage the RP Pico. I had assumed the optocoupler and flyback diodes in the relay modules would stop any spike returning to the GPIO pin of the microcontroller. Could it be coming through the signal line to the GPIO pin, the 5V power lines to the relay modules or even the 240VAC lines into the PSU?
Request: How do I identify what path the inductive spike is taking? What is the most likely route, How do I test for it, How do I fix it? Can I assume that it is NOT on the GPIO pin as each relay module (30A 5V trigger module YYG-2) and (10A 5V rigger module) has a flyback diode and an opto-coupler? I have a Uni-T UT210 volt/ammeter and a small oscilloscope (that I am a novice on). Where and how do I look for the spike and where and what type of snubber circuit should I add?
Background: I am reasonably new to electronics but have spent 6 months learning so I know the problem - a spike when a large inductive load is switched off. I just don't really know how to go about identifying what path the spike is taking and how to protect my microcontroller. My microcontroller is protected with a 6.3V 1000uF capacitor between Vsys and GND. There is a MOSFET (DMG2305ux) as recommended by Raspberry Pi switches the Pico from Vbus to Vsys power when the USB cable is connected to the laptop and SDK Thonny.
There is a high level module layout diagram showing the AC and DC connections of Relays, Loads, PSU and RP Pico Microcontroller. I have labelled it [A] to [J] as to where I could look for the spike or fit a snubber circuit.
All help and suggestions welcome - advice and pointers to training also welcome.