EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: NicolasV on August 18, 2023, 08:28:06 pm

Title: Raspberry Pi and floating GND
Post by: NicolasV on August 18, 2023, 08:28:06 pm
Hello everyone. This is a theoretical question.
When my Raspberry Pi is ungrounded, I can reset it by touching RUN with a screwdriver. That doesn't happen if GND from the R-Pi is connected to mains earth (directly or through a capacitor). My question is: is it related to the high impedance (long) path from me (the 50hz antenna) to mains ground, then making the noise level at the RUN pin high enough?

(http://NoisePath)
Title: Re: Raspberry Pi and floating GND
Post by: langwadt on August 18, 2023, 08:33:51 pm
Hello everyone. This is a theoretical question.
When my Raspberry Pi is ungrounded, I can reset it by touching RUN with a screwdriver. That doesn't happen if GND from the R-Pi is connected to mains earth (directly or through a capacitor). My question is: is it related to the high impedance (long) path from me (the 50hz antenna) to mains ground, then making the noise level at the RUN pin high enough?

(http://NoisePath)

try measuring the voltage from the RPi ground to earth, it is likely that it floats at half mains voltage when not grounded because of filters in the power supply
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 18, 2023, 09:23:39 pm
This particular power supply is not grounded. The same behavior occurs with a portable USB charger, but this time I assume the path is through the HDMI, the monitor PSU (also floating), and some capacitive coupling to ground.
Using a battery pack for a 7-inch monitor and the PI, none of that happens: It does not reset when touching RUN.
Title: Re: Raspberry Pi and floating GND
Post by: langwadt on August 18, 2023, 09:34:02 pm
This particular power supply is not grounded. The same behavior occurs with a portable USB charger, but this time I assume the path is through the HDMI, the monitor PSU (also floating), and some capacitive coupling to ground.
Using a battery pack for a 7-inch monitor and the PI, none of that happens: It does not reset when touching RUN.

when the power supply is not grounded everything tends to float at half the mains voltage because of the capacitors in the mains filter in the supply

 
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 18, 2023, 10:00:18 pm
80V between R-Pi GND and mains earth (220V ac here). When I said floating I meant no third pin on the ac plug (ground) and no common mode filter inside (no CY capacitors to ground). But there may be parasitic capacitors that do the same effect.
If so, how does this affect the sensitivity of the RUN pin?
Title: Re: Raspberry Pi and floating GND
Post by: langwadt on August 19, 2023, 12:01:42 am
80V between R-Pi GND and mains earth (220V ac here). When I said floating I meant no third pin on the ac plug (ground) and no common mode filter inside (no CY capacitors to ground). But there may be parasitic capacitors that do the same effect.
If so, how does this affect the sensitivity of the RUN pin?

the pi is floating at 80V and you are a big capacitor at ~0V so the pin gets pulled low until the 80V is discharged
Title: Re: Raspberry Pi and floating GND
Post by: wasedadoc on August 19, 2023, 06:29:07 am
80V between R-Pi GND and mains earth (220V ac here). When I said floating I meant no third pin on the ac plug (ground) and no common mode filter inside (no CY capacitors to ground). But there may be parasitic capacitors that do the same effect.
If so, how does this affect the sensitivity of the RUN pin?

the pi is floating at 80V and you are a big capacitor at ~0V so the pin gets pulled low until the 80V is discharged
Please explain how 80 Volts AC gets discharged.
Title: Re: Raspberry Pi and floating GND
Post by: EEEnthusiast on August 19, 2023, 08:05:37 am
The 50Hz picked up by your body gets rectified by the clamping diode at the input pin of the RPI and this creates a high enough voltage to Reset the device.
When the circuit is grounded, there is not enough difference between your body and the RPI input pin to be able to reset it. Just like how birds can sit on a live wire, without getting shocked as both are at the same potential.
Title: Re: Raspberry Pi and floating GND
Post by: Ian.M on August 19, 2023, 09:43:43 am
Oh for **** sake!  Unless you are in close proximity to a large area 'hot' live conductor, capacitance to ground will dominate and the line frequency AC voltage on your body will be low, at most a few volts.  As the O.P. notes, the Pi does *NOT* reset when Reset is touched if its 0V is grounded to mains earth. This is not surprising when you consider the potential divider formed by your skin rĂ©sistance, and the Pi's 10K Reset pullup, which is effectively in parallel with a 100nF deglitching  capacitor, (component values from Pi 2, may differ on later models).

The Y capacitor commonly found in most SMPSUs, from secondary side 0V to primary side DC bus negative, (which is there to provide a return path for the HF leakage current through the transformer's interwinding capacitance, of the switching frequency and its harmonics, to meet EMI emissions requirements), unfortunately provides a leakage path for the line frequency waveform on the DC bus negative (which is negative going half wave rectified mains), resulting in an AC RMS voltage of about 55% of the mains voltage on the secondary side 0V if it has no DC or capacitive path to ground.  If your multimeter isn't true RMS, or there is significant capacitance to ground, you wont get 55% - a peak or average reading multimeter calibrated to give the RMS of a sinewave will not be accurate on the non-sinusoidal waveform, and capacitance to ground will drag the open circuit voltage down.

This leakage current is limited by international safety standards to max. 0.75mA per device, but typically, demanding on choice of the Y capacitor value, is an order of magnitude lower.

Lets assume that the actual combined leakage current of the PSU + monitor is about 0.2mA, and the Pi is floating.  If you provide a path to ground (DC or capacitive) by touching the reset pin, that will fully charge or discharge the reset deglitching capacitor in a millisecond or so, and is enough to develop nearly 3V (peak) across the reset pullup.  When the common mode leakage voltage swings negative, the reset inputs internal protection diodes clamp it a bit above the 3.3V rail, but when it swings positive, reset gets pulled low for several miliseconds, resetting the Pi.  Due to the tens or hundreds of volts driving the leakage current, even with the potential divider effect of your skin resistance with the Pi's internal reset circuit, there is enough voltage swing to reset the Pi.

Note that strong EMI, e.g. from a mobile phone nearby being polled by the cellular network, if picked up by wiring or a metal object that is approximately an odd number of quarter waves long (at the cellular network frequency), connected to reset,  can overwhelm the filtering effect on the deglitching capacitor, be rectified in the reset input's internal protection diodes and also reset the Pi, whether or not its grounded. 
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on August 19, 2023, 12:22:27 pm
80V between R-Pi GND and mains earth (220V ac here). When I said floating I meant no third pin on the ac plug (ground) and no common mode filter inside (no CY capacitors to ground). But there may be parasitic capacitors that do the same effect.
If so, how does this affect the sensitivity of the RUN pin?

the pi is floating at 80V and you are a big capacitor at ~0V so the pin gets pulled low until the 80V is discharged
Please explain how 80 Volts AC gets discharged.

It doesn't. It's not AC by the time it reaches the smoothing capacitors in the power supply, it's rectified AC, or DC as we like to call it.
Title: Re: Raspberry Pi and floating GND
Post by: wasedadoc on August 19, 2023, 02:23:16 pm
80V between R-Pi GND and mains earth (220V ac here). When I said floating I meant no third pin on the ac plug (ground) and no common mode filter inside (no CY capacitors to ground). But there may be parasitic capacitors that do the same effect.
If so, how does this affect the sensitivity of the RUN pin?

the pi is floating at 80V and you are a big capacitor at ~0V so the pin gets pulled low until the 80V is discharged
Please explain how 80 Volts AC gets discharged.

It doesn't. It's not AC by the time it reaches the smoothing capacitors in the power supply, it's rectified AC, or DC as we like to call it.
It is only "dc" across the smoothing capacitor(s).  Each end of those capacitors is at an alternating voltage with respect to actual ground.
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on August 19, 2023, 09:00:48 pm
80V between R-Pi GND and mains earth (220V ac here). When I said floating I meant no third pin on the ac plug (ground) and no common mode filter inside (no CY capacitors to ground). But there may be parasitic capacitors that do the same effect.
If so, how does this affect the sensitivity of the RUN pin?

the pi is floating at 80V and you are a big capacitor at ~0V so the pin gets pulled low until the 80V is discharged
Please explain how 80 Volts AC gets discharged.

It doesn't. It's not AC by the time it reaches the smoothing capacitors in the power supply, it's rectified AC, or DC as we like to call it.
It is only "dc" across the smoothing capacitor(s).  Each end of those capacitors is at an alternating voltage with respect to actual ground.

Pulsing DC is still DC. You say yourself that it's DC across the smoothing capacitors. That's the same thing as I'm saying. A varying voltage is not an alternating one, BTW.
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 20, 2023, 10:52:46 am
It doesn't. It's not AC by the time it reaches the smoothing capacitors in the power supply, it's rectified AC, or DC as we like to call it.

There is no clean DC or clean AC. Any signal consists of DC and AC components. The question is which component is dominant. If dominant component is DC, we're talking that this is DC voltage. If dominant component is AC we're talking that this is AC voltage.
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 20, 2023, 07:53:24 pm
More data:

R-Pi GND floating and powered by a portable charger.

HDMI 7-inch display powered by a cheap 2-prong SM-PSU: ~74V rms in every single pin of the R-Pi. Very easy to reset.
Display powered by an original Samsung charger: ~13.7V rms. Really hard to reset
Display powered by the laptop (unplugged). only ESD could reset it.

Since ESD could be an issue, I recorded this video using an anti static wrist strap

https://youtu.be/YMGW5Xe23o8
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 20, 2023, 10:33:13 pm
HDMI 7-inch display powered by a cheap 2-prong SM-PSU: ~74V rms in every single pin of the R-Pi. Very easy to reset.
Display powered by an original Samsung charger: ~13.7V rms. Really hard to reset

I can say it's not only easy to reset, but also easy to damage your RPI or display or even oscilloscope...  ;)

It looks like your mains socket missing GND line, and it leads to such issue. In this case you can also notice painful electric shocks if you touch the wires with your hand.

If device has GND terminal on it's mains socket, then in most cases it has capacitors between mains line and neutral and GND terminals. When there is no GND in your mains socket, these capacitors works as voltage divider on capacitors. So, you can get about a half mains voltage potential on such device enclosure and GND pins... The current will be limited with capacitors, but high voltage still can make damage...
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 20, 2023, 10:44:27 pm
HDMI 7-inch display powered by a cheap 2-prong SM-PSU: ~74V rms in every single pin of the R-Pi. Very easy to reset.
Display powered by an original Samsung charger: ~13.7V rms. Really hard to reset

I can say it's not only easy to reset, but also easy to damage your RPI or display or even oscilloscope...  ;)

It looks like your mains socket missing GND line, and it leads to such issue. In this case you can also notice painful electric shocks if you touch the wires with your hand.

The mains socket is fine. This cheap switch mode power supply has no earth connection and high ac leakage.
There were risks -specially the ESD test- , and it shows how obsessed I was to understand how it works.
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on August 21, 2023, 12:01:56 am
It doesn't. It's not AC by the time it reaches the smoothing capacitors in the power supply, it's rectified AC, or DC as we like to call it.

There is no clean DC or clean AC. Any signal consists of DC and AC components. The question is which component is dominant. If dominant component is DC, we're talking that this is DC voltage. If dominant component is AC we're talking that this is AC voltage.

You're talking about noise, and yes every signal be it AC or DC contains some noise. AC is something else.
 
Alternating Current (AC) is a type of electrical current, in which the direction of the flow of electrons switches back and forth at regular intervals or cycles.
Direct current (DC) is an electric current that is uni-directional, so the flow of charge is always in the same direction
Noise is the random, unwanted variation or fluctuation that interferes with the signal. This is present in every signal.
 
If the positive and negative don't swap places, that is DC no matter how much noise there is. Yes, even if you can isolate that noise by using the setting on your oscilloscope that converts the noise to one that has the appearance of an AC waveform, and yes even if there is more noise than signal.
 
Any signal is composed of either AC or DC plus noise, a signal to noise ratio (which is what you're talking about) higher than 1:1 (greater than 0 dB) indicates more signal than noise. It doesn't mean a DC signal becomes AC.
Title: Re: Raspberry Pi and floating GND
Post by: Terry Bites on August 21, 2023, 10:21:04 am
Your coupling 50 or 60Hz fields from your lab power into the floating switch input.
Its just become a touch switch.
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 21, 2023, 08:55:35 pm
You're talking about noise, and yes every signal be it AC or DC contains some noise. AC is something else.
 
Alternating Current (AC) is a type of electrical current, in which the direction of the flow of electrons switches back and forth at regular intervals or cycles.
Direct current (DC) is an electric current that is uni-directional, so the flow of charge is always in the same direction

No. Any signal consists of many AC signal and DC signal is a kind of AC signal. DC signal is actually AC signal with very slow change. Actually DC is AC with frequency = 0 Hz.

If dominant component in signal is AC (frequency > 0 Hz) it doesn't means that this signal doesn't have DC (frequency == 0 Hz). The signal always consiststs both components AC and DC. DC component is simply voltage offset for AC component. It can be very small and have different combinations, but both are always present. If dominant component is DC, then AC component is simply ripple for DC component.

If the positive and negative don't swap places, that is DC no matter how much noise there is.

No, if polarity is constant and don't change, it is still AC with frequency = 0 Hz, and such AC signal with frequency = 0 Hz is named DC...  :)

Noise is different story. Noise is random signal fluctuations. But we're talking about AC components which are not random, on the contrary it is constant power. For example, 50 Hz ripple on DC output is not noise, it is AC sine with constant power. In other words DC output has dominant component which can be measured as DC offset and AC component which can be measured as AC ripple.

For example if your PSU has DC offset 5V and 220 V ripple on it's output, it doesn't means that this signal doesn't have DC.  It still has DC offset even if it's voltage swing is many times higher than DC offset...

If you don't believe that DC signal is actually AC signal, you can imagine a simple experiment. Let's put 50 Hz sine into coax cable. Wave propagation speed in coax cable is about 200'000'000 meters per second. Now if you run along the cable at the same speed, then you will notice that AC voltage in the cable turns into DC voltage. This is because DC voltage is actually AC voltage which is frozen in time for inertial system where measurement is taken. But this DC still stays AC for other inertial systems :)
Title: Re: Raspberry Pi and floating GND
Post by: wasedadoc on August 21, 2023, 10:11:10 pm
AC means alternating current. If the current that is actually flowing or would flow if an appropriate resistor were placed between the two relevant points of potential difference is not changing direction from time to time, then it is not AC.  And vice versa,
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 21, 2023, 10:46:16 pm
I'm about to model the situation. I am wondering if I am on the right track or am making a component salad.
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 21, 2023, 10:58:19 pm
AC means alternating current. If the current that is actually flowing or would flow if an appropriate resistor were placed between the two relevant points of potential difference is not changing direction from time to time, then it is not AC.  And vice versa,

Then there is logical question - where is border limit at which you can make sure that this is AC or not AC?
For example if current change direction once per 1000000 years, is it AC or not?  :)
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on August 21, 2023, 11:01:14 pm
if polarity is constant and don't change, it is still AC with frequency = 0 Hz

No. You're wrong when you say this. The Alternating part of Alternating current refers to polarity, + changes to - and vise versa.

The polarity of the current alternates and so it is alternating current. That's what the words mean.

If the polarity stays the same, it's DC. Whether it is pulsing DC that pulses at a frequency, DC that has a lot of noise, or the most stable DC possible, they are all DC.
 
I know this is the beginners subforum, but really...
Title: Re: Raspberry Pi and floating GND
Post by: Ian.M on August 21, 2023, 11:09:37 pm
Component salad!  The Y capacitor leakage isn't from a sinusoidal source, and of course, there is a Y capacitor in series with it.
Replace V3 with a behavioural voltage source (bv) with equation:
Code: [Select]
V=sqrt(2)*220*min(0,sin(2*pi*50*time))
to model the negative side of the primary DC bus, and add a 4.7nF capacitor in series between it and the rest of the circuit.

Edit: negative side DC bus voltage equation corrected - my original was negative going full wave rectified and its now negative going HALF wave rectified, as it should be!
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on August 21, 2023, 11:12:41 pm
AC means alternating current. If the current that is actually flowing or would flow if an appropriate resistor were placed between the two relevant points of potential difference is not changing direction from time to time, then it is not AC.  And vice versa,

Then there is logical question - where is border limit at which you can make sure that this is AC or not AC?
For example if current change direction once per 1000000 years, is it AC or not?  :)

Border limit? Are you just making up your own terms now?
 
I'm sure you're not serious. The posts above mention 220V mains AC being turned into a DC current for powering a raspberry pi using a power supply that has no earth pin.

That is 50hz in the UK and 60hz in the US. As it is alternating current, that means that every 100th of a second + and - swap places, which is the definition of alternating current, alternating polarity.

When rectified, so that the polarity of the current no longer alternates, it was suggested above that this might make a floating potential of 80V, thus causing the issues the OP described.

Someone else misunderstood how power supplies work and said that 220V AC couldn't make a floating potential, to which I replied that by the time it reached the smoothing caps, it wasn't AC any more, it was DC. A long discussion happened about the true nature of AD/DC, one that has moved well beyond anything relevant to the conversation.

To disprove that DC is DC, you're now trying to claim that a signal that is stable for 100,000 years can be AC...
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 21, 2023, 11:22:56 pm
No. You're wrong when you say this. The Alternating part of Alternating current refers to polarity, + changes to - and vise versa.

No, I'm not. The DC is current which is changed, but the frequency of that change at measurement point is just 0 Hz. It means that you can see frozen phase of that AC signal at measurement point. This is why you see constant value, just because it's altering frequency is 0 Hz.

As you probably know, AC signal can be represented as a sum of sine components with different frequencies. Such operation is known as Fourier transform, it transfers signal from time domain to frequency domain. In such way you can compare AC and DC signal in frequency domain. If you do it, you will find, that both DC and AC signals is represented by sine component. The difference is that DC has sine frequency 0 Hz and AC signal has sine frequency > 0 Hz.

If the polarity stays the same, it's DC. Whether it is pulsing DC that pulses at a frequency, DC that has a lot of noise, or the most stable DC possible, they are all DC.

Let's take sine waveform which has amplitude 100 V and DC offset 100 V. It never crosses zero, so it never changes polarity and never change current direction. But it still changes in time by sine law. There is no noise at all, just a clean sine.

This is AC current. But in your terminology such sine waveform signal is DC. Do you understand it?

Border limit? Are you just making up your own terms now?

No, I don't making up my own terms.
We need some condition in order to determine if we can assume that current is DC or not. Isn't it?
That's what my questing is - how long DC current should stay unchanged in order to make sure that we can name it DC?
 
That is 50hz in the UK and 60hz in the US. As it is alternating current, that means that every 100th of a second + and - swap places, which is the definition of alternating current, alternating polarity.

Let's take sine waveform current with amplitude 100 V and offset 100 V. This sine current never changes polarity and never changes flow direction. Such sine waveform never swaps + and - places. How do you think, is this sine waveform current AC or not?

To disprove that DC is DC, you're now trying to claim that a signal that is stable for 100,000 years can be AC...

I don't disprove that DC is DC. I just wanted to note that DC is just simplified abstraction which doesn't exists in real world. In real world all currents are AC.
Title: Re: Raspberry Pi and floating GND
Post by: wasedadoc on August 22, 2023, 12:19:04 pm
Let's take sine waveform which has amplitude 100 V and DC offset 100 V. It never crosses zero, so it never changes polarity and never change current direction. But it still changes in time by sine law. There is no noise at all, just a clean sine.

This is AC current. But in your terminology such sine waveform signal is DC. Do you understand it?
@radiolistener.
No it is not AC.  It is varying DC.  As you wrote yourself, the current never changes direction.  Ergo, it is not alternating.

Consider a simple power supply. A tranformer with AC mains on the primary.  The secondary has a half wave rectifier (ie single diode), a smoothing capacitor and a resistior load across the capacitor.

1.  The voltage across the transformer secondary is alternating. It is AC.

2.  The current through the secondary does not alternate.  It varies between zero and some peak value.  It never changes direction.  It is DC.

3.  The voltage across the capacitor does not alternate.  It changes slightly around some mean non-zero voltage.  It is DC.

4.  The current in the capacitor does alternate.  Current in when the diode conducts and current out when the diode does not conduct. It is AC.

5.  The voltage across the resistor does not alternate.  Same as the voltage across the capacitor. It is DC.

6.  The current though the resistor does not alternate.  Always flows inthe same direction. It is DC.
Title: Re: Raspberry Pi and floating GND
Post by: Ian.M on August 22, 2023, 12:23:54 pm
Zero current doesn't have a direction. 
However this is very O.T. for the O.P's question, so it would be polite to take it elsewhere . . .
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 22, 2023, 05:45:55 pm
No it is not AC.  It is varying DC.  As you wrote yourself, the current never changes direction.  Ergo, it is not alternating.

No, it is AC+DC. There is no change polarity and no change current direction because it has DC offset. If you remove DC offset with capacitor you will get clean AC.

In order to measure AC voltage we're needs to know its zero level. Then we needs to measure AC voltage relative to that zero level (average value). The polarity and current direction changes relative to AC zero value. You can do it by adding capacitor in series, it will reduce DC component.

In my example zero level is 100 V, the same as amplitude, so there is no polarity/direction change between two wires. But you're needs to measure AC relative to it's average value, not between two wires. And if you measure it relative to average value, you will found that it changes polarity and direction (relative to average value), so this is AC   ;)


2.  The current through the secondary does not alternate.  It varies between zero and some peak value.  It never changes direction.  It is DC.

No, the current on the secondary coil of transformer is clean AC.

Probably you mean voltage on rectifier output, but it also not DC, this is AC + DC and you can turn it into clean AC by adding capacitor in series.

3.  The voltage across the capacitor does not alternate.  It changes slightly around some mean non-zero voltage.  It is DC.

No, it is not DC, it still AC+DC. The capacitor in parallel just reduce amplitude of AC component (it works as filter), but AC still here.

4.  The current in the capacitor does alternate.  Current in when the diode conducts and current out when the diode does not conduct. It is AC.

5.  The voltage across the resistor does not alternate.  Same as the voltage across the capacitor. It is DC.

6.  The current though the resistor does not alternate.  Always flows inthe same direction. It is DC.

there is no DC in real world, because DC needs to be constant for infinite time, it cannot in real world. We name it as DC just to notice that this AC frequency is so small that we cannot take its frequency into account.  In addition there is always present some AC ripple, so its always AC+DC
Title: Re: Raspberry Pi and floating GND
Post by: wasedadoc on August 22, 2023, 06:15:06 pm
No it is not AC.  It is varying DC.  As you wrote yourself, the current never changes direction.  Ergo, it is not alternating.

No, it is AC+DC. It is not change polarity and direction because there is DC offset. If you remove DC offset with capacitor you will get clean AC.

In order to measure AC voltage we're needs to know its zero level. Then we needs to measure AC voltage relative to that zero level (average value). The polarity and current direction changes relative to AC zero value.

In my example zero level is 100 V, the same as amplitude, so there is no polarity/direction change. But you're needs to measure AC relative to it's average value, not relative to it's DC offset.  ;)


2.  The current through the secondary does not alternate.  It varies between zero and some peak value.  It never changes direction.  It is DC.

No, the current on the secondary coil of transformer is clean AC.

Probably you you mean voltage on rectifier output, but it also not DC, this is still AC + DC and you can turn into clean DC by adding capacitor in series.

3.  The voltage across the capacitor does not alternate.  It changes slightly around some mean non-zero voltage.  It is DC.

No, it is not DC, it still AC+DC. The capacitor in parallel just reduce AC component, but it still here.

4.  The current in the capacitor does alternate.  Current in when the diode conducts and current out when the diode does not conduct. It is AC.

5.  The voltage across the resistor does not alternate.  Same as the voltage across the capacitor. It is DC.

6.  The current though the resistor does not alternate.  Always flows inthe same direction. It is DC.

there is no DC in real world, because DC needs to be constant for infinite time, it cannot in real world. We name it as DC just to notice that this AC frequency is so small that we cannot take its frequency into account.  In addition there is always present some AC ripple, so its always AC+DC
Virtually all of @radiolistener's reply is so incorrect it is clear that his understanding is seriously flawed.  I'll give three examples.

The first is the statement "No, the current on the secondary coil of transformer is clean AC."  The current in the secondary flows through the diode.  The function of the diode is to let cuurent flow in only one direction. Certainly neither AC nor "clean AC" whatever "clean" is supposed to mean.

Second is the statement: "Probably you you(sic) mean voltage on rectifier output, but it also not DC, this is still AC + DC and you can turn into clean DC by adding capacitor in series."  A series capacitor blocks DC.  After the capacitor is AC not "clean DC".

Third is the statement: "DC needs to be constant for infinite time". Wrong on two counts.  It does not need to be constant.  It does not need to be infinite time.  Connect a resistor across a battery.  Direct current flows.  It does not change direction.  The current  is not constant -  it reduces as the battery discharges and its voltage falls.  Eventually - but long before infinite time has elapsed - the battery voltage falls to zero and no current flows.  is there anyone else in the world who says the current is not DC?
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 22, 2023, 10:37:15 pm
Virtually all of @radiolistener's reply is so incorrect it is clear that his understanding is seriously flawed.  I'll give three examples.

I just tried to help you to understand that your understanding of AC and DC is seriously flawed.

The first is the statement "No, the current on the secondary coil of transformer is clean AC."  The current in the secondary flows through the diode.  The function of the diode is to let cuurent flow in only one direction. Certainly neither AC nor "clean AC" whatever "clean" is supposed to mean.

The first your mistake here is the following. Probably it will be shocking for you, but the current on a secondary coil flows back and forth even if secondary coil is open and is not connected to anything. This is because wave propagation speed is limited and secondary coil wire has some length, so the current induced from primary coil will flow in the wire even if circuit is broken. It will flow to the opened end of wire, then reflected back and flow in reverse direction... The secondary coil of transformer always has AC current and it doesn't matter what load is connected to the coil.

The second your mistake here is that diode-bridge rectifier works on single half-period of sine. Actually diode bridge rectifier works on both half periods of sine. It means that it consumes current when it flows in both directions.

And even if we take single diode instead of diode bridge rectifier, it blocks current consumption for one half-period from secondary coil to the load, but the secondary coil still has AC current.

As you can see, there is clean AC current on secondary coil of transformer. And it cannot be DC because it has sine waveform. The transformer cannot produce DC voltage on the secondary coil. It's just impossible.


Second is the statement: "Probably you you(sic) mean voltage on rectifier output, but it also not DC, this is still AC + DC and you can turn into clean DC by adding capacitor in series."  A series capacitor blocks DC.  After the capacitor is AC not "clean DC".

What you're talking about? Here is what I said exactly:
Quote
this is AC + DC and you can turn it into clean AC by adding capacitor in series.

so please don't use false quotes.

Third is the statement: "DC needs to be constant for infinite time". Wrong on two counts.  It does not need to be constant.  It does not need to be infinite time.

If voltage is not constant, it means that it's changes in time with some frequency, so this is AC. It cannot be DC, because it has waveform with some frequency.

The DC current with sine waveform of some frequency > 0 Hz is just absurd. That's a result of your broken understanding.

Connect a resistor across a battery.  Direct current flows.  It does not change direction. 

This is also your mistake. When you connect resistor across a battery it leads to a power pulse propagation through wires from battery to resistor, when that pulse reach the resistor the part of its power will be consumed by resistor and the rest power will be reflected back to the battery and that power pulse will flow back and forth from battery to resistor and from resistor to battery. You can catch this current back and forth oscillations with a high speed oscilloscope. You will see a ringing with decreasing amplitude. With longest wires you can catch it more easily

The current  is not constant -  it reduces as the battery discharges and its voltage falls.

yes, in real world constant current is impossible. At some time battery will be discharged or circuit will be broken and current will be changed. You cannot keep constant voltage across resistor for infinite time. This is why DC doesn't exists in real world. And that is why I said that it doesn't exists.

Eventually - but long before infinite time has elapsed - the battery voltage falls to zero and no current flows.  is there anyone else in the world who says the current is not DC?

DC current doesn't exists in real world. But for simplification, you can assume that AC current with frequency for example < 0.000001 Hz is DC. It's still not DC in reality, but since it's voltage change is too slow, you can approximate it as DC. Since you're don't need very high precision, such approach works for simple cases.

But such approximation AC as DC works when AC change is very slow. If you try to approximate AC current behavior with DC current model for higher frequency, you will fail, because error will be too high.
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 23, 2023, 01:04:42 am
Now I have the circuit of the PSU mentioned in the topic. You guys could continue the AC vs DC struggle on top of the schematic  ;D
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 23, 2023, 01:47:36 am
does it means that it has cold ground connected to hot ground? Or there is mistake in schematic?
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 23, 2023, 02:06:20 am
Sorry I just fixed it
Title: Re: Raspberry Pi and floating GND
Post by: radiolistener on August 23, 2023, 02:34:03 am
so it has connected cold ground with hot ground?
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 23, 2023, 03:02:06 am
Between GND of the output, cold ground I guess (I should have used another symbol), and... to avoid screwing up with the terminology/theory, the + terminal of the mains AC filter capacitor
Title: Re: Raspberry Pi and floating GND
Post by: Ian.M on August 23, 2023, 03:05:00 am
So in this one the Y capacitor goes to the positive side of the primary DC bus.  That changes the 'bv' source for your sim to:
Code: [Select]
V=sqrt(2)*220*max(0,sin(2*pi*50*time))
(changing min() to max() for positive half cycles) and of course use the actual 1nF Y capacitor value, not the 4.7nF I previously recommended.

However there is also the monitor to consider and its Y capacitor so you may want to compare the results as you step the Y capacitor between 1nF and lets say 5nF
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 30, 2023, 11:29:23 pm
So in this one the Y capacitor goes to the positive side of the primary DC bus.  That changes the 'bv' source for your sim to:
Code: [Select]
V=sqrt(2)*220*max(0,sin(2*pi*50*time))
(changing min() to max() for positive half cycles) and of course use the actual 1nF Y capacitor value, not the 4.7nF I previously recommended.

However there is also the monitor to consider and its Y capacitor so you may want to compare the results as you step the Y capacitor between 1nF and lets say 5nF

Looking at the schematic, I still don't understand something. Why half wave? Isn't it ripple of 50hz of the first stage ac->dc passing through the Y cap? (full bridge plus smoothing caps... or PI filter?)
Maybe that ripple is too small...
In the simulation, I get 120vrms instead of the measured 80vrms (using the 1nF Y cap)

... and with this new capture, I'm more puzzled

[attachimg=1]
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on August 31, 2023, 02:57:08 am
Setup

The display is powered by a portable charger.
I use an analog discovery connected to a laptop, because using the Rigol would ground the R-Pi.
The multimeter measurement between ground and GND of the R-Pi drops from ~80Vrms to the value displayed when touching RUN, using an ESD wrist wrap.

Title: Re: Raspberry Pi and floating GND
Post by: Ian.M on August 31, 2023, 09:31:34 am
I believe the (domestic) mains supply in Argentina is single phase, nominally 220V RMS with a near-ground potential Neutral conductor.    After bridge rectification, although the DC voltage across the bridge + and - terminals is full-wave, either terminal with respect to ground gives a half wave!  However, as soon as you add significant reservoir capacitance that halfwave 'smears' to a quasi-sinewave.  See attached sim.

Your real life results will be complicated by the PFC circuit in the HDMI monitor and its Y capacitor, which forms a capacitive potential divider with your PSU's high side Y capacitor, hence the lower than expected RMS 'float' voltage when the display is mains powered.

Results when you touch it are difficult to predict.  The min. 1Meg ESD strap resistance is shunted by your body's capacitance to ground (which the HBM ESD model (https://en.wikipedia.org/wiki/Human-body_model) takes as 100pF but of course it actually varies due to proximity to grounded objects).  Its probably comparable to your laptop's capacitance to ground (assuming running on batteries with no other leads connected apart from the Analog Discovery), if its sitting on your bench ESD mat.  Reduce that by putting the laptop on an expanded polystyrene block!
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on September 09, 2023, 03:44:01 pm
I made a circuit that generates a pulse, starting in phase (I think) with the AC mains, and with increasing delay. The pulse drives a full-wave MOSFET switch that connects the RUN pin to mains earth

The video shows:

https://www.youtube.com/watch?v=8UmnG118AQo (https://www.youtube.com/watch?v=8UmnG118AQo)
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on September 12, 2023, 02:08:04 pm
Now I have the circuit of the PSU mentioned in the topic. You guys could continue the AC vs DC struggle on top of the schematic  ;D

The schematic should put a very welcome full stop on that conversation. "MB10F is an ultra-thin SMD rectifier bridge stack, whose function is to convert alternating current into direct current, using the single-phase conductivity of the diode."
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on September 12, 2023, 02:38:01 pm
Now I have the circuit of the PSU mentioned in the topic. You guys could continue the AC vs DC struggle on top of the schematic  ;D

I might be a bit old school with my ideas on power supplies, but personally if I had to convert 220V down to 5V for a pi, I'd use a step down transformer at the first point to get something like 18V then rectify that, smooth it using caps, convert it to 5V using something like a LM60440DRPKR buck converter, followed by a coil and some caps to clean up the power. You can fine tune the voltage by adjusting a resistor value in the example circuit (23.7K gets you 5.2V). The LM chip can cope with a wide range of input voltages so you don't need to be that careful with circuit design before it so long as you smooth it fairly well and the efficiency is very good, so almost no heat. Depending on your power needs, that chip can supply 4A, there are less powerful chips available. I regularly use this chip to power a raspberry pi (and screen) with no issues, although I use a very cheap 12V brick power supply which I then convert down to 5.2V, for an easy life.

Or you could check out this WeBench circuit, 2A 220V AC - 5.2VDC optoisolated for ideas.

https://webench.ti.com/appinfo/webench/scripts/SDP.cgi?ID=AF1132CC6B0C04BB
Title: Re: Raspberry Pi and floating GND
Post by: NicolasV on September 13, 2023, 09:47:10 pm
Now I have the circuit of the PSU mentioned in the topic. You guys could continue the AC vs DC struggle on top of the schematic  ;D

I might be a bit old school with my ideas on power supplies, but personally if I had to convert 220V down to 5V for a pi, I'd use a step down transformer at the first point to get something like 18V then rectify that, smooth it using caps, convert it to 5V using something like a LM60440DRPKR buck converter, followed by a coil and some caps to clean up the power. You can fine tune the voltage by adjusting a resistor value in the example circuit (23.7K gets you 5.2V). The LM chip can cope with a wide range of input voltages so you don't need to be that careful with circuit design before it so long as you smooth it fairly well and the efficiency is very good, so almost no heat. Depending on your power needs, that chip can supply 4A, there are less powerful chips available. I regularly use this chip to power a raspberry pi (and screen) with no issues, although I use a very cheap 12V brick power supply which I then convert down to 5.2V, for an easy life.

Or you could check out this WeBench circuit, 2A 220V AC - 5.2VDC optoisolated for ideas.

https://webench.ti.com/appinfo/webench/scripts/SDP.cgi?ID=AF1132CC6B0C04BB

The LM60440DRPKR looks nice. The package is a bit of a pain though.

Anyway, even using an isolation transformer, an old school transformer to unregulated DC, etc. the problem remains there (I guess I'm just adding series -parasitic- capacitors), but it can be easily solved grounding the Raspberry pi.

I was just chasing how the reset happened, and I think my last video shows so.

Edit: BTW: Using the metallic side panel of a PC case flat on the floor and connecting the R-Pi to it was enough to reduce that 50Hz leakage to half!
Title: Re: Raspberry Pi and floating GND
Post by: Microdoser on September 15, 2023, 05:13:11 pm
Now I have the circuit of the PSU mentioned in the topic. You guys could continue the AC vs DC struggle on top of the schematic  ;D

I might be a bit old school with my ideas on power supplies, but personally if I had to convert 220V down to 5V for a pi, I'd use a step down transformer at the first point to get something like 18V then rectify that, smooth it using caps, convert it to 5V using something like a LM60440DRPKR buck converter, followed by a coil and some caps to clean up the power. You can fine tune the voltage by adjusting a resistor value in the example circuit (23.7K gets you 5.2V). The LM chip can cope with a wide range of input voltages so you don't need to be that careful with circuit design before it so long as you smooth it fairly well and the efficiency is very good, so almost no heat. Depending on your power needs, that chip can supply 4A, there are less powerful chips available. I regularly use this chip to power a raspberry pi (and screen) with no issues, although I use a very cheap 12V brick power supply which I then convert down to 5.2V, for an easy life.

Or you could check out this WeBench circuit, 2A 220V AC - 5.2VDC optoisolated for ideas.

https://webench.ti.com/appinfo/webench/scripts/SDP.cgi?ID=AF1132CC6B0C04BB

The LM60440DRPKR looks nice. The package is a bit of a pain though.

Anyway, even using an isolation transformer, an old school transformer to unregulated DC, etc. the problem remains there (I guess I'm just adding series -parasitic- capacitors), but it can be easily solved grounding the Raspberry pi.

I was just chasing how the reset happened, and I think my last video shows so.

Edit: BTW: Using the metallic side panel of a PC case flat on the floor and connecting the R-Pi to it was enough to reduce that 50Hz leakage to half!

Lol, never underestimate the power of a well grounded case. I agree the package is quite small, but if you get your boards made for you and have a hot air gun, it's pretty easy to get fitted.