Eliminate noise in ESP32

Hi! I'm using the Esp32 MCU to generate a 40khz PWM signal and it works fine (image 1) but I have a noise in the other outputs that looks that in image 2.

Can someone give me an idea to eliminate that noise? Thanks :slight_smile:

image # 1

image #2

I'm using this PWM signal to exit the fourth transducers, to do that I'm using the CD4052 multiplexer/demultiplexer, the PWM signal go to the X input and I change the output channel using the GPIO ping 6 and 7, also I'm getting the response of the transducers and conduce them to an amplifier using the Y output of the CD4052.

For example, I send the PWM signal to the X input and is sent to the transducer 1, at the same time I'm getting the response of the transducer 2 that is in front of the transducer 1, the response of the transducer 2 its send to an amplifier, I'm doing an ultrasonic anemometer.


Which other outputs?

As my old maths teacher used to say " a graph without a scale is like. . . . another very useless thing"

Yes, sorry... I have noise in the digital outputs of the 32 , 33 and 34 GPIO.

First test is to determine if you are measuring a GPIO signal or lead noise.

Make the same measurement but but put both the scope probe at the same point of the ground connection. See what you get.

This is what I get


the blue line is the PWM signal and the red is the noise captured each GPIO pin

Did you record a trace with both the scope ground and probe at the same point?

So you are reading noise on pins that have not been programmed, correct? A power supply filtering issue?

My first guess it the scope common mode rejection. If I'm correct the trace with the probe at the ground will result in the scope displaying nearly the same "noise"


As you havent provided a schematic we are working in the dark.

However - a stab in the dark - is the PWM output connected to something? If so - and if its taking current - then you need to look at how your supplies are connected and decoupled.

You haven't given any indication of the timebase or volts/div in those graphs - typically digital noise like this is not a problem, its due to stray inductance mainly (ground bounce). Good layout and decoupling will minimize it.

Sorry, I'm new in this forum, I edited my question and left the connection plan.

your diagram does not show GPIO32.

The PWM seems to be driving a transducer - can you post a link so we can see what you are using? It would be useful to know how much current is being drawn from the port.
Also your diagram is wrong - I hope. Look at A1, A3, A4, A5.

A photo of your layout would be useful too, and a note of WHICH ESP32 board you are using - your diagram suggests its this one

I've worked with oscilloscopes for many years. The traces they show are not "perfect" images of the voltages you think you are measuring. Especially with fast changing signals.

Without more measurement I'm of the opinion there is a good chance the red "noise" trace you showed in post 5 does not exist on the ESP32. But it is a limitation of the oscilloscope and how it is connected to the circuit.

To test this theory please move the probe to the same location and the scope ground and see what the red trace shows (and add the X and Y scale factors).