Resistor and capacitor order dependent noise in the output signal (measured with a handheld oscilloscope) of an RC circuit

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
Hi.
I have an RC circuit 1kOhm and 22uF that generates a sine wave from a PWM signal generated by a battery powered STM32F103C8T6 (Blue Pill). I take all measurements with a handheld oscilloscope (battery powered). The PWM frequency is 10kHz.
I noticed that the connection order affects my measurements when I connect the capacitor first and then the resistor, in this case there is some additional noise. But what's the cause of this noise? I know that in the case when the black wire of a probe is connected to the GND pin of the microcontroller, there's no noise, but the current path looks to me the same in both cases.

I'd appreciate it if you could explain this to me.

Below are the two cases, the first is RC order, then CR:

RC_order.jpgCR_order.jpg
 

joeyd999

Joined Jun 6, 2011
6,204
Deleted my first answer. Incorrect analysis.

In the 2nd pic, you are definitely measuring at the wrong nodes.

In any case, RC is low pass, CR is high pass.
 

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
Deleted my first answer. Incorrect analysis.

In the 2nd pic, you are definitely measuring at the wrong nodes.

In any case, RC is low pass, CR is high pass.
In both cases, I measure the output voltage across the capacitor; by RC and CR, I mean the order of the resistor and capacitor coming after the signal line.
 

crutschow

Joined Mar 14, 2008
38,316
Do you mean connect one of the probe wires to the ground of the circuit and leave the other one floating?
No, I mean connect both the oscilloscope probe and ground connections to the circuit ground, to see if any of the observed noise is from a ground loop between the circuit and your oscilloscope.
 

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
No, I mean connect both the oscilloscope probe and ground connections to the circuit ground, to see if any of the observed noise is from a ground loop between the circuit and your oscilloscope.
Maybe I don't understand it correctly, but there's no ground loop there, since there isn't any third (earth ground) connection. Should I connect both the oscilloscope probe and the ground clip to the ground of the circuit so that it works as an antenna and I can check the noise level or I need to measure it between two different ground pins on the circuit?
 

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
For correct measures ground clip(s) should be always connected to ground.
Voltage between two ungrounded nodes should be measured by two probes
(using two channels), with appropriate oscilloscope mathematic.
Yes, but in this case both devices are isolated from the ground (earth ground), so there will be no situation where I can short any section of the circuit and this will affect the measurement result. Therefore, it will be enough to measure the voltage with only two points.
 

Danko

Joined Nov 22, 2017
2,136
Yes, but in this case both devices are isolated from the ground (earth ground), so there will be no situation where I can short any section of the circuit and this will affect the measurement result. Therefore, it will be enough to measure the voltage with only two points.
In electronics, usually ground = common wire of circuit (do not mess it with "Earth ground").
In your case common wire is minus of power supply.
When probe clip is not connected to ground (to common wire), then probe cable
and oscilloscope itself work as very good antenna and you will see on screen
all electromagnetic noise, which is present in space of room.
It is why probe clip(s) always should be grounded (connected to common wire).
ADDED:
So, @crutschow asked you to connect probe and its clip to common wire of your circuit.
 
Last edited:

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
In electronics, usually ground = common wire of circuit (do not mess it with "Earth ground").
In your case common wire is minus of power supply.
When probe clip is not connected to ground (to common wire), then probe cable
and oscilloscope itself work as very good antenna and you will see on screen
all electromagnetic noise, which is present in space of room.
It is why probe clip(s) always should be grounded (connected to common wire).
ADDED:
So, @crutschow asked you to connect probe and its clip to common wire of your circuit.
I don't see any difference between connecting the ground clip to the ground pin and just after the resistor. If in the second case it works as an antenna, why it isn't when it is connected to a ground?
I have an assumption that when we connect the ground clip to the point just after the resistor all the electromagnetic noise if it comes from the ground applies both to itself + the resistor + the ground clip so this creates a different voltage distribution across the oscilloscope in the opposite case when we connect directly to the ground. Could this be true?
I'd like to know a little more (but not too much) about how this noise appears there on the oscilloscope when we don't connect it directly to the ground, maybe using some simple model of a circuit or something like that.
 

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
I connected both the probe and the clip to the ground pin. There is some noise but it isn't of a high level:
1723113888633.png

Then I measured a signal between two GND pins on the circuit. This noise is more similar to what appears when we don't connect the ground clip to the ground of the circuit:
1723116395922.png
 

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
I also measured the signal pin of the circuit:
SignalPin_Measurement.jpg

Seems it makes more sense now that having the resistor just after the signal line prevents the noise from "going further" to the oscilloscope probe. Therefore, the output signal is cleaner when we measure the capacitor placed just after the resistor and connected to the ground.
 

joeyd999

Joined Jun 6, 2011
6,204
Therefore, the output signal is cleaner when we measure the capacitor placed just after the resistor and connected to the ground.
There really is no option: you require a low pass to convert PWM to DC. R followed by C is what makes this happen. C followed by R is a high pass, and will block the DC signal you're trying to extract.
 

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
There really is no option: you require a low pass to convert PWM to DC. R followed by C is what makes this happen. C followed by R is a high pass, and will block the DC signal you're trying to extract.
I use the output voltage from the capacitor just like it is done for low-pass filtering. Theoretically the order here shouldn't matter.
 

WBahn

Joined Mar 31, 2012
32,702
Hi.
I have an RC circuit 1kOhm and 22uF that generates a sine wave from a PWM signal generated by a battery powered STM32F103C8T6 (Blue Pill). I take all measurements with a handheld oscilloscope (battery powered). The PWM frequency is 10kHz.
I noticed that the connection order affects my measurements when I connect the capacitor first and then the resistor, in this case there is some additional noise. But what's the cause of this noise? I know that in the case when the black wire of a probe is connected to the GND pin of the microcontroller, there's no noise, but the current path looks to me the same in both cases.

I'd appreciate it if you could explain this to me.

Below are the two cases, the first is RC order, then CR:

View attachment 328738View attachment 328739
There are several possibilities that can be contributing, and what you are seeing might be real, or it might be a measurement artifact.

Since your scope is battery-powered, then it should be insensitive to which node is considered "ground" in the circuit being measured -- as long as you are only making this single, two-point connection to the circuit.

But your probe tip and ground still form a loop that wants to act like an antenna, and so which point it is referenced to in the circuit can influence how sensitive that antenna is to noise relative to that point. Also, the size and orientation of your loop can play a role in how well it picks up noise.

Here's some simple things to try.

Put your resistor and capacitor parallel to each other on the breadboard such that you can swap their ordering by changing the positioning of small jumpers. Next, connect your scope probe tip and ground across the capacitor and tape them down, making the loop formed by the ground lead wire and the probe tip as small and as fixed as possible. Now take your measurements for both configurations and see how they compare.

Another thing that might be worth looking at is to put a lead into your breadboard so that the MCU output pin, the junction of the R and C, and the ground side of the components are all close together and near this lead. Then connect both the probe tip and the probe ground to this lead. Now look at the noise with this lead floating, and with it connected to each of the three test points by as short a jumper lead as possible, and see how they all compare.
 

Thread Starter

OlegZhukovsky

Joined Aug 6, 2024
10
There are several possibilities that can be contributing, and what you are seeing might be real, or it might be a measurement artifact.

Since your scope is battery-powered, then it should be insensitive to which node is considered "ground" in the circuit being measured -- as long as you are only making this single, two-point connection to the circuit.

But your probe tip and ground still form a loop that wants to act like an antenna, and so which point it is referenced to in the circuit can influence how sensitive that antenna is to noise relative to that point. Also, the size and orientation of your loop can play a role in how well it picks up noise.

Here's some simple things to try.

Put your resistor and capacitor parallel to each other on the breadboard such that you can swap their ordering by changing the positioning of small jumpers. Next, connect your scope probe tip and ground across the capacitor and tape them down, making the loop formed by the ground lead wire and the probe tip as small and as fixed as possible. Now take your measurements for both configurations and see how they compare.

Another thing that might be worth looking at is to put a lead into your breadboard so that the MCU output pin, the junction of the R and C, and the ground side of the components are all close together and near this lead. Then connect both the probe tip and the probe ground to this lead. Now look at the noise with this lead floating, and with it connected to each of the three test points by as short a jumper lead as possible, and see how they all compare.
Thanks for the answer.

1. I tried the first method to make the loop smaller. The measurement results are practically the same as before.
2. I made the circuit you suggested, if I understood you correctly. The photo below shows the capacitor-then-resistor arrangement option.
1723306053319.png

The measurements taken for the CR order are as follows :

The MCU output:
1723308777738.png
The RC junction:
1723308857015.png
The ground has an insignificant noise.

The RC order:

Here only the MCU output has significant noise:
1723309248906.png

The noise becomes less when I reduce the speed of the GPIO pin, .

Now I only have a guess that there is an augmented antenna achieved when the circuit is formed, that is the output pin + RC + the ground. Therefore, the distribution of noise-induced current along the antenna changes depending on the order of the R and C.
 

hibouair

Joined Oct 6, 2024
1
The issue you are encountering likely stems from the difference in how the signal return path (ground) is handled depending on the connection order of the resistor and capacitor in your RC circuit.

When connecting the capacitor first (in the path between the signal and ground), the capacitance can allow more high-frequency noise or other disturbances from nearby sources (e.g., your STM32, surrounding electromagnetic interference) to influence the measurement, because capacitors tend to block low frequencies while allowing high-frequency components to pass through. Any inherent noise in the system can become more noticeable when the capacitor is connected first, especially if the capacitor is positioned closer to sensitive parts of your circuit or measurement setup.

On the other hand, when the resistor is connected first, it tends to provide some damping of the high-frequency noise before it reaches the capacitor, thereby reducing the noise level observed in your signal. The resistor acts as a buffer, and since resistors limit current and do not store energy like capacitors, they can attenuate fast transients, making your circuit more stable and less susceptible to noise interference.

Why the noise happens:
  • Grounding considerations: When you mention that the noise disappears when you connect the black wire of the oscilloscope probe to the GND pin of the STM32, this suggests a grounding issue. Improper or suboptimal grounding can create ground loops or cause different parts of your circuit to operate at slightly different potentials, which may introduce noise.
  • Probe grounding: The oscilloscope probe might be picking up noise if the ground clip is not close to the point where you're measuring the signal. When you connect the capacitor first, the signal might fluctuate more, and the oscilloscope could pick up these fluctuations as noise.
  • Path impedance: The order in which you connect the components alters the impedance of the path that noise or stray signals must travel. Connecting the capacitor first might create a low-impedance path for high-frequency noise, whereas the resistor-first configuration provides higher impedance, reducing the noise.
Recommendations:
  1. Keep the oscilloscope ground wire short and connected directly to the ground pin of the STM32. This ensures a good reference potential for your measurements.
  2. Check layout and wiring: Ensure that your components are placed in such a way that minimizes the exposure of high-frequency signals to noisy environments, such as power lines, other signal wires, or the microcontroller itself.
  3. Signal integrity: Try connecting the resistor first in most configurations to help dampen the high-frequency noise before it gets amplified by the capacitor
 

MisterBill2

Joined Jan 23, 2018
27,159
Practically, it does.
Especially IN THEORY, the points that you measure the voltage between matter a great deal. The measurement must always be relative to the same point, in the two pictures that is not at all the case. In addition, the scope low-side input connection is not really isolated from "ground", but rather just "sort of separated a bit" from ground. To achieve the exchange that the TS climes to be doing, the scope common will need to stay at the circuit common connection and the R and C will need to have their positions exchanged.
 
Top