I'm using two LM2596 regulator module, set to 3.3V and 5V. Both regulators are powered by a Meanwell DR-30-24 PSU.
The device supplies power to an STM32F103C8 microcontroller and other auxiliary components, including a buzzer (driven by a transistor and a monostable 555 timer).
As I cut off the power (disconnect from the mains), I always hear a slight sound from the buzzer so I decided to perform a measurement at a power off event. I used a Saleae logic analyzer as I don't own an oscilloscope.
The issue is that there was a significant voltage fluctuation at the moment of switching off. The fluctuation had the same characteristics at any pins of the microcontroller and also directly at the voltage rails. The following measurements were performed at some pins (at stand-by period, the pins are normally pulled low).

Measurements at some pins

I tried to perform a measurement independently (just the output of the regulator, disconnected from other components) and the spikes were still there, so it is probable that the issue does not caused from the entire system.
I tried several regulators (other types of modules) and this phenomenon seems to be identical across these modules.
As I tried to research the issue, I could not find a case that exactly matched what was described, although I think it must be a common issue.

My main question: What does this phenomenon called and how can it be eliminated? Is this transient voltage (that is the closest I could find)? Normally it would not be an issue (this is the first time I realize it), but now I would like to drive a DC motor using a H-Bridge and the noise at the pins are just like a PWM signal, thus it would unwittingly drive the motor.
Thank you in advance!

  • \$\begingroup\$ Does this only happen when you disconnect the mains connection from the 24 V Meanwell supply? Or also when you leave the 24 V on and disconnect both LM2596 modules? My guess is that when you disconnect the mains, the capacitors in the Meanwell supply are discharged slowly, making the 24 V supply also discharge slowly and that can cause weird effects. I would monitor the 5 V and 3.3 V supplies to see what happens. If (one of) those supplies drops too slowly then maybe the STM micro can be reset (with an additional circuit). \$\endgroup\$ Sep 23, 2021 at 7:53
  • \$\begingroup\$ I would also consider creating the 3.3 V from that 5 V using a linear regulator (assuming the 3.3 V doesn't need much current so I can use an LDO). Then when the 5 V drops in voltage, the 3.3 V must follow. Now you can have a situation where there's 3.3 V but no 5 V (or the reverese) and that could cause issues. I would want to avoid situations like that. \$\endgroup\$ Sep 23, 2021 at 7:54
  • \$\begingroup\$ Could you provide the schematics of your system ? \$\endgroup\$
    – Blup1980
    Sep 23, 2021 at 8:13
  • \$\begingroup\$ Does it have a brownout detection? \$\endgroup\$ Sep 23, 2021 at 11:33

2 Answers 2


When you disconnect from the main, the voltage after the regulation does not immediately, and I would say "magically", jump from 3.3V or 5V to 0V. You have some capacitance on your 3.3 or 5V nets. It is either parasitic from the PCB or from external components : The decoupling capacitors that you should have all over the place on your board.

Because your board is drawing finite current, you need some time to discharge all theses caps.

How to solve the issue ? Most (all?) MCU has a brownout detection circuit that can be enabled. Its purpose is to detect when the input voltage of the MCU is becoming too low and put it in a reset state. That way it can't continue to run and do strange things due to under voltage powering.

Just enable it.

But you also may have to put additional pull-up or pull-down resistor on the output pins of your MCU. When the brown-out circuit put the MCU in reset, all the pins are set to high impedance mode (input mode). If some of theses pins control the 555, you should make sure that when configured as inputs they do not allow the 555 to run. Usually a well place pull-up or pull-down resistor should be enough.

As @Bimpelrekkie said: If you are using multiple power voltages, make sure that all the chip are happy if one voltage falls when another is still on.


You really need to get an oscilloscope. Saleae logic analyzers are notoriously overpriced, you could have gotten a different logic analyzer and an oscilloscope for the same price :) The problem with the logic analyzer is that you can't see the voltage. It may only be 1V but it will show up the same as 3.3 or 5V and that can be very confusing. You also want to make sure there is no voltage spike coming from the power supply when you turn it off (I've seen that on cheap power supplies). You can get very cheap oscilloscopes these days, even the crappy ones will be better for this purpose than any logic analyzer.


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.