# Noise spikes caused by external AC switching

I have built a circuit that measures time between two 5V pulses. It works good but I'm having problems with voltage spikes that comes from the AC mains. And it triggers the interrupt pin on the PIC.

When turning on/off another power supply on my test bench I get a voltage spike around 5V on the DC side of my AC/DC. I'm using a TracoPower TMP 7105 switch mode supply and there is a built in filter in the device socket.

How should I avoid false readings on the interrupt pin? Filter the signal? Or try fixing the noise somewhere else?

EDIT #1: I understand that I may have explained some things to badly. I have tried to run the circuit with a battery and the noise disappears, sadly is that not a possible solution.

Here is some captured waveforms with only a 100 Ohms 6W resistor as a circuit.

• The complexity of solution depends upon your requirement of the circuit. Please specify in detail, what is your specification of pulse of 5V what is the frequency, on time/duty cycle, source of that pulse, etc. Oct 17 '18 at 9:48
• What 5V spike, if the supply voltage is 5V? Oct 17 '18 at 10:07

Add a 10nF and a 10 or 100k resistor on your sense line.

simulate this circuit – Schematic created using CircuitLab

depending of how long is your pulse signal, you might want to adjust the values.

Make sure you have common ground between what you sense and your circuit, if you use long cables, twist the pair and use shielded cables.

• I will try that! But will the filter dampen the signal a bit? Oct 17 '18 at 12:43
• Yes it will, that is why you need to calculate/try correct R and C values and also consider your resistor tied to the ground. If you give you pulse time it can give some idea. Oct 17 '18 at 12:45