I have relay controlled by BC547 transistor powered by 24V Zener regulator. The transistor is switched by a microcontroller which is powered by a 5V linear regulator. The linear regulator receives input from the 24V from Zener regulator. At the instant when relay is switched, linear regulator 5V output fluctuates between around 1V min to 7.8V max for about 20nS.This causes microcontroller to reset(but not at every instant).

Guys is there any fix to this?? see the scope output

  • 5
    \$\begingroup\$ A schematic would help to formulate precise advice. \$\endgroup\$
    – tobalt
    Commented May 29, 2021 at 14:30
  • 2
    \$\begingroup\$ 1) is there a flyback diode in parallel with the relay coil? 2) does the microcontroller have a large enough supply decoupling capacitor? 3) and obviously you must include a schematic. \$\endgroup\$ Commented May 29, 2021 at 14:38
  • 1
    \$\begingroup\$ provide sufficient current... this can involve something simple such as a capacitor or something bigger such as a completely different beefier 5V power supply. \$\endgroup\$
    – Abel
    Commented May 29, 2021 at 14:46
  • \$\begingroup\$ Use a scope and watch the 24V power supply, I expect it is collapsing, this is just a SWAG. Several others have asked you to post a schematic, that is the only way we can resolve this without spending a lot of unnecessary time and effort. \$\endgroup\$
    – Gil
    Commented May 29, 2021 at 15:15
  • \$\begingroup\$ that sounds like induction voltage from the relay. Possibly forgotten free-wheeling diode or insufficient decoupling capacitor for the microcontroller. \$\endgroup\$
    – arnisz
    Commented May 29, 2021 at 18:38

2 Answers 2


This looks like a step load with a nonlinear high Q with a resonant frequency of 2.5 cycles in 5 ns or 500MHz ! Knowing the RLC equivalent circuit that would create this step response ! How would you decouple this back EMF signal from interfering with the output impedance of your supply by some filter design converting voltage to current and attenuating the reverse transfer function by impedance ratios and Q control? Series RC? Lower output impedance of regulator at 500MHz?

You can design this by using this method of filter analysis. Identify all the variables, DCR, Rs diode, Vf diode, L, C , ESR, Zout (f) , V+ in an equivalent circuit with a current step function or adjust the slew rate of the step by design....

But beware this 0.5GHz BW of probing requires special attention to ground inductance of probe, so the best measurement is a 50 ohm source and 50 Ohm Terminated , AC coupled coax connection to DSO on 1:1 with high quality coax. This is unusually high BW but appears to be a dry contact switch. So use V+> C+50 series>coax>50 shunt>DSO 1:1 Also beware of shared currents on gnd noise and layout LC coupling crosstalk.

Also ensure DSO scale is correct and not “us” instead of ns.


Basically you need to slow down the turn-on and -off of the driver transistor so that it doesn't energize the high frequency parasitic RLC circuit. Likely you can do this by putting a resistor in series with the base to limit the base current (you should already have had a resistor there), and/or putting a capacitor in parallel with the base-emitter -- perhaps 1 nF.

In addition, add better decoupling capacitance at the output of your linear regulator, and/or at the VDD pins of the MCU.


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.