Eliminate ringing when switching power - Page 1
Forum section: electronics / beginners

author: rve
author_rank: Newbie
timestamp: September 15, 2022, 12:48:06 pm
content: Hi,I need to switch the power (5V) of a sensor using a MCU.The sensor is currently just a bare sensor IC with a max VCC of 5.5V nothing special. Also I only connected the sensor to the power supply through a FET and I have not connected any of the sensors outputs to the MCU yet.The following solution (simple P-FET switch) works. However there is some ringing on the power supply rails (ch2, purple) and on the power supply to the sensor (ch3, blue) it is worse (about 7V). Also the output from the MCU does not look very clean (ch1, yellow) :I added an inductor before the FET. And now the ringing on the power supply rails (ch2, purple) is almost completely gone. The output from the MCU looks much better (ch1, yellow). Only, the ringing on the sensors power supply has increased (ch3, blue) to about 8.3VHow can I fix this? Should I fix this?Thanks.

author: Vovk_Z
author_rank: Super Contributor
timestamp: September 15, 2022, 04:56:04 pm
content: What is a distance of power supply line? Until it is longer than half a meter I wouldn't concern.If it is a 'long' line - then you may concern. I havent tried it but something like series RC may help. 1..10 R and 0.1 uF, possibly.

author: ledtester
author_rank: Super Contributor
timestamp: September 15, 2022, 05:10:08 pm
content: In the first schematic it looks like the ringing lasts for about a microsecond -- am I reading that right?Another idea to consider is to power the sensor directly from the GPIO pin -- if you're using a 5V microcontroller and the sensor doesn't require too much current.

author: rve
author_rank: Newbie
timestamp: September 15, 2022, 05:31:41 pm
content: Distance of the power supply line is indeed not very long.The ringing lasts for about 1uS indeed.To be honest, I only noticed the ringing because I was looking for another issue with a better scope than I'm used to.The ringing itself does not seem to cause any issues, other than perhaps putting 8V on a 5V line for 1uS.

author: Benta
author_rank: Super Contributor
timestamp: September 15, 2022, 06:26:09 pm
content: Well, you can try to decouple your way out of the problem by throwing caps at it.A better solution is slowing down the power line by controlling rise/fall times.Just a simple gate resistor might be enough.Does the semsor really need a 3 A MOSFET for the power supply?

author: DL2XY
author_rank: Regular Contributor
timestamp: September 15, 2022, 06:59:58 pm
content: Just put in a gate resistor between R4 and Q2.1k to10k schould be enough to slow down the edges.

author: floobydust
author_rank: Super Contributor
timestamp: September 15, 2022, 07:33:21 pm
content: +1I second that, you don't need to switch the mosfet in nsec and excite ringing due to parasitics.I use a gate resistor of 100Ω to a few kΩ between the mosfet gate and your pullup. Too large a value can switch too slow and stress the mosfet if the sensor current drain is high. You could observe the effect on the scope with 10k-100kΩ just to see what is going on.

author: rve
author_rank: Newbie
timestamp: September 16, 2022, 08:18:44 am
content: Thanks, adding a gate resistor indeed fixed the ringing.