Power supply noise compensation

Thread Starter

kramzar

Joined Mar 7, 2022
35
Hi,

I have problem with my custom PCB design, where i have 2 power supplies.
One is a 230/12V AC/DC converter that i use to power a relay and a measurment op-amp (MP-LD05-23B12R2)
and the other one is a 3.3V switching power supply to power an esp32. (AP1509)

Here is the circuit:power schematic.PNG

I am running into the issue that the 3.3V switcher causes a lot of noise and power swing on the 12V,
And also that noise from the 12V relay switching, causes the noise to translate to the 3.3V line

If i disconect the 3.3V AP1509, the 12V power supply works very well, with only 40mV voltage variation due to noise.
But when i connect the 3.3V switcher back to the 12V it causes up to 340mV voltage swing due to noise, which is too much, since that translates to 340mV change on my op-amp that measures analog voltage with 60mV precision.

power_supply_swing.PNG

I have also measured the period of the voltage spikes above and found out its 6.66us (ignore the 7.9us in the above picture) , which translates to 150kHz, which is what the AP1509 switcher operates on, comfirming my theory.

The 3.3V psu only draws an extra 40mA from the 12V psu.

What can i do to filter the noise coming from the ap1509 and what can i do to eliminate the voltage swings and noise that also comes from the 12V line as a result of the relays turning on and off during opearation? (this causes the noise to translate to the 3.3V line, which sometimes freezes my esp32).

I have already tried adding and RC, LC filters and a bigger 3400uF capacitor, but that did not help the situation at all.
 

StefanZe

Joined Nov 6, 2019
191
Hi,
Add a 10µF to 100µF ceramic capacitor next to your C19. Both should be very close to the AP1509.
Are you building this on a PCB or is it on a breadboard?

To have so much noise from turning on and off the relay that the esp32 freezes with a capacitor if 1000µF sounds very strange. Are there a lot of long wires that connect the capacitor and the relays? Puting a bypass capacitor next to the relay could help this problem (don't forget the freewheeling diode).
 

DickCappels

Joined Aug 21, 2008
10,187
About the relay freezing the controller: When driving a DC motor (with brushes) a controller I was using would occasionally crash, dumping a whole pack of Polaroid film on the floor.

Investigation showed that the controller was being crashed by noise coming up to the controller’s output pin from the circuit that drove the motor. Solution: Output pin => Cable => Current limit resistor => Small Capacitor => Inductor => Motor driver.

It took a couple of days to identify how the noise was getting and devise the filter.
 

MrAl

Joined Jun 17, 2014
11,494
Hi,

I have problem with my custom PCB design, where i have 2 power supplies.
One is a 230/12V AC/DC converter that i use to power a relay and a measurment op-amp (MP-LD05-23B12R2)
and the other one is a 3.3V switching power supply to power an esp32. (AP1509)

Here is the circuit:View attachment 292481

I am running into the issue that the 3.3V switcher causes a lot of noise and power swing on the 12V,
And also that noise from the 12V relay switching, causes the noise to translate to the 3.3V line

If i disconect the 3.3V AP1509, the 12V power supply works very well, with only 40mV voltage variation due to noise.
But when i connect the 3.3V switcher back to the 12V it causes up to 340mV voltage swing due to noise, which is too much, since that translates to 340mV change on my op-amp that measures analog voltage with 60mV precision.

View attachment 292482

I have also measured the period of the voltage spikes above and found out its 6.66us (ignore the 7.9us in the above picture) , which translates to 150kHz, which is what the AP1509 switcher operates on, comfirming my theory.

The 3.3V psu only draws an extra 40mA from the 12V psu.

What can i do to filter the noise coming from the ap1509 and what can i do to eliminate the voltage swings and noise that also comes from the 12V line as a result of the relays turning on and off during opearation? (this causes the noise to translate to the 3.3V line, which sometimes freezes my esp32).

I have already tried adding and RC, LC filters and a bigger 3400uF capacitor, but that did not help the situation at all.
Hi,

Add more filter capacitance.

You are probably wondering why i said this after you already said you tried that, and rightly so.
The reason is because you can not use any ol' general purpose filter capacitors you need to use low ESR capacitors. The low ESR means there is lower impedance which can filter the variations in supply voltage much better. The ESR acts like a resistor between the internal part of the capacitor and the external terminal. When you connect a capacitor you are really connecting to the resistor not the pure cap inside. You want that resistor to be as small as possible for good filtering action. The caps that have this quality are known as low ESR capacitors. You can find them at various respectable part outlets.

Your wiring technique also plays a part in the filtering action.
To be sarcastic, you would not run a 10 foot wire from the 12v line to the filter cap, then a 1 foot wire from the 12v line to the 3.3v regulator. You would run a wire from the 12v line to the cap and then from the cap to the 3.3v regulator. That ensures that the 3.3v regulator input actually gets the full benefit of the extra capacitance.
Since the voltage difference is so extreme, 12v to 3.3v, you can also try placing a small value resistor (maybe 1 Ohm) in series with the input of the 3.3v regulator, then another filter capacitor. You may even get away with going higher on that resistor value but it depends on the output current damand of the 3.3v regulator.
The wiring would then go from the 12v line to the first cap, then from that cap to the resistor, then the resistor to the second cap, then the second cap to the 3.3v regulator.
The ground wiring follows the same pattern: 12v to cap 1, cap 1 to resistor, resistor to cap 2, cap 2 to 3.3v regulator.

If this is done right and the caps are all low ESR there is no reason this shouldn't work.
 

ElectricSpidey

Joined Dec 2, 2017
2,786
I don't know, this is probably not constructive but...running a switcher directly from a switcher just rubs me the wrong way, way too many possible issues.

If all you need from the 3.3 is 40mA I would suggest using a 3 terminal linear regulator.

If the half watt or so is a concern, just ignore this post.
 

DickCappels

Joined Aug 21, 2008
10,187
Agreeing in general with ElectricSpidey, you might do well to add a inductor or ferrite bead (depending upon the frequencies involved) between the output of the power supply and the filter capacitor on the susceptible circuit.
 

Thread Starter

kramzar

Joined Mar 7, 2022
35
Post a picture of your PCB layout with traces.
Does it have a ground plane?
What value of RC and LC filters did you try?
I tried 100uF,1000uF, 2000uF,3400uF
and 47uH, 330uH, 1uH for the coil

I also added 100nF caps prety much next to every denice on both 12 and 3.3V rails.

Also one on the capacitors on my board had a bad GND, so after i added all of that and fiexed the GND, the voltage is now nice and smoth on both rails.

The issue with the relays causing spieks still persists however.

I have added external components that are not on the pcb, so the pcb pictures would not help much. But here is a schematic of the relays and power supply schematic as i have it right now on the board with the fitlers.

RELEJI.PNG
NAP.PNG
 

Thread Starter

kramzar

Joined Mar 7, 2022
35
here is another image of the relay "spikes" after i implemented an LC filter.
The 3.3V rail is actualy pretty smooth, its just these spikes that sometiles (1/100 times) cause my esp32 to freeze
spike.PNG
 

MrAl

Joined Jun 17, 2014
11,494
I tried 100uF,1000uF, 2000uF,3400uF
and 47uH, 330uH, 1uH for the coil

I also added 100nF caps prety much next to every denice on both 12 and 3.3V rails.

Also one on the capacitors on my board had a bad GND, so after i added all of that and fiexed the GND, the voltage is now nice and smoth on both rails.

The issue with the relays causing spieks still persists however.

I have added external components that are not on the pcb, so the pcb pictures would not help much. But here is a schematic of the relays and power supply schematic as i have it right now on the board with the fitlers.

View attachment 292546
View attachment 292543
Hi,

What kind of regulator is U1 and why did you put L1 before C8 instead of between C8 and C10?

A trick that is often used with buck regulators is to put a small value inductor in series with the very output creating a new output, then put a capacitor across the new output. Do not change the feedback pickoff point keep it coming from the old output only.
Even 2uH could work and maybe 100uf or better cap.
 

ApacheKid

Joined Jan 12, 2015
1,617
Hi,

I have problem with my custom PCB design, where i have 2 power supplies.
One is a 230/12V AC/DC converter that i use to power a relay and a measurment op-amp (MP-LD05-23B12R2)
and the other one is a 3.3V switching power supply to power an esp32. (AP1509)

Here is the circuit:View attachment 292481

I am running into the issue that the 3.3V switcher causes a lot of noise and power swing on the 12V,
And also that noise from the 12V relay switching, causes the noise to translate to the 3.3V line

If i disconect the 3.3V AP1509, the 12V power supply works very well, with only 40mV voltage variation due to noise.
But when i connect the 3.3V switcher back to the 12V it causes up to 340mV voltage swing due to noise, which is too much, since that translates to 340mV change on my op-amp that measures analog voltage with 60mV precision.

View attachment 292482

I have also measured the period of the voltage spikes above and found out its 6.66us (ignore the 7.9us in the above picture) , which translates to 150kHz, which is what the AP1509 switcher operates on, comfirming my theory.

The 3.3V psu only draws an extra 40mA from the 12V psu.

What can i do to filter the noise coming from the ap1509 and what can i do to eliminate the voltage swings and noise that also comes from the 12V line as a result of the relays turning on and off during opearation? (this causes the noise to translate to the 3.3V line, which sometimes freezes my esp32).

I have already tried adding and RC, LC filters and a bigger 3400uF capacitor, but that did not help the situation at all.
I'd consider a simple regulator to get the 3.3v

Next I'd consider using an opto isolator to activate the relay circuit and never galvanically connect the two supplies in any way. This eliminate the switching supply along with all its noise and eliminates the 12v relay circuit's ability to also flood the ESP circuit with noise.
 

crutschow

Joined Mar 14, 2008
34,464
I'd consider using an opto isolator to activate the relay circuit and never galvanically connect the two supplies in any way.
Doing that is a problem here, since one supply is feeding the other.

But it likely would significantly help if the relay control common is directly connected to the 12V supply common pin 4 instead of somewhere to the GND_ISO.
 

MrAl

Joined Jun 17, 2014
11,494
It might also help to dampen the reaction of the relay coil. RF coupling could be a problem too when it comes to coils and motors.
 
Top