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? My project

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.

  • 1
    \$\begingroup\$ You are already assuming it's an conducted path. What if it's a radiated path? Do you have a photo of your current setup? \$\endgroup\$
    – Jeroen3
    Jan 3 at 7:51
  • \$\begingroup\$ Is your PC a laptop or desktop? If a laptop you can see if the problem appears when the laptop is plugged into mains or not. For a desktop, it is likely USB gets upset as the PC itself is grounded and the transient finds its way through the 2A psu via USB to ground on the PC. \$\endgroup\$
    – Kartman
    Jan 3 at 12:35

1 Answer 1


The path doesn't matter too much, because the wave radiates outward from the spark.

The problem is: sparks are fast.

Breakdown in air can occur in an instant: fractional nanoseconds. Voltage across the contacts can go from a few 100V (having just opened) to a few thousand (~ms later), suddenly to zero when they spark over. At these time scales, the change in voltage, literally radiates outward like an EMP blast, inducing a voltage drop in anything nearby, and dropping off with distance. Direct wired connections are more strongly affected (the blast is carried along them, shedding higher frequencies along the way, due to losses to materials and radiation).

A representative regulatory standard is IEC 61000-4-4, electrical fast transients. This is a rapid-fire burst of pulses, typically 1-2kV amplitude, 5ns rise, 50ns duration (50% amplitude), from a 50Ω generator. This simulates, in a controlled manner, the crescendo of sparks from a mechanically switched inductive turn-off condition, typical of switching loads like motors or unloaded transformers.

ESD waveforms are similar, as you might guess, though fewer at a time, and can be higher voltage.

It takes two to cause interference: there must be an aggressor (source) of some level, and a victim vulnerable to those levels. You can solve your issue two ways: one, snubbing the contacts to prevent sparking; or shielding and filtering your circuit well enough to be immune to it. Of course, both is preferable.

The snubber, simply something to absorb the inductive energy, and slow the voltage rise, so the voltage peak is reduced, and the contacts can open fully before peak is reached. Typical values would be an R + C, 0.1-0.47µF and 10-100Ω. A MOV can also be used (has capacitance, and clamps voltage, dissipating energy), but also lets through more leakage, and lets through mains surges (for the same reason that a shunt MOV absorbs surges). There are a few other strategies but most likely the RC will suffice here.

Shielding is harder to describe. Whereas the contacts are a point source with a point solution (add a snubber across them), you need to shield against fields. A bit of topology is helpful here. Consider a closed metal box: incident radiation is either reflected or absorbed by the outer surface (assuming it's several skin depths thick; as these pulses have some MHz of bandwidth, not much material is needed), and blocked from the interior and vice versa. We have [RF] isolation. Open a hole in the box and pass a wire through it: now we have a conductive path where outside radiation can enter the box. If we add filtering at this point (where the conductor penetrates the enclosure), or ESD protection or both, we can block surge or interference from entering.

Of course, filters also block high-frequency signals, so this is not a complete solution. But this might perhaps give you a start on thinking about how shielding and filtering can be done.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.