Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Gzip exceptions, but only on hot or rainy days (alexyorke.github.io)
232 points by polygot on Nov 12, 2022 | hide | past | favorite | 149 comments



> A quick check with a $10.00 outlet tester confirmed that there was a grounding issue. The tester confirmed that there was no ground.

> send in an electrician this time. They asked lots of questions, and then recommended that my air conditioner stay on a different outlet because there were two circuits. I tried this for a few days, but the issues still reappeared.

Either something is missing or both the author and the electrician are absolutely insane. There is a grounding issue, which could mean anything from a broken outlet to incompetent wiring throughout the house, and they aren't thinking about fixing it immediately? Let's try a workaround for a few days? I have no words.


I suspect both; I mean who worries about gzip when their touchpad is 'spicy'!


MacBooks and iPads had the "spicy case" issue for quite a long time. In certain countries, the Apple power supply comes with two adapters for plugging it into the wall - one with two contacts, and one with three contacts. Only the one with three contacts is grounded.

When using the ungrounded adapter, the entire case of my 2011 MacBook Air and the iPad 2 got slightly "spicy", although it felt more as if the case suddenly changed texture and was more wavy (probalby an artifact of europes 50Hz mains frequency).

The strangest thing was turning on my touch controlled desk light while working on the laptop. If I touched the light and the laptop at the same time, the light shocked me quite noticeably.


I noticed this when I was playing guitar and using my laptop at the same time. The strings and bridge on an electric guitar are grounded. When I had my arm touching the bridge and I put my hand on the MacBook's case, I would get a mild shock.

I measured the voltage difference and, if I recall correctly, it was something like 20V. I started using the 3-prong adapter and haven't had any more issues.


You should absolutely make a habit of not touching anything else as long as any part of your body touches the strings, bridge, tuners or other conductive parts of the guitar. This includes not touching the mic grill with your lips. This is why singing guitarists should keep a foam mic cover handy. It's also the reason keeping your spring cavity closed (if you have one) is a good idea.

In many places electrical wiring in homes is just two wires and what wiring monstrosities await you in shabby clubs and shady rehearsal spaces is just beyond belief. Be safe.


If the voltage was high enough to be dangerous, would a foam mic cover protect you?


First of all, it's not just the voltage that is dangerous. Though, higher voltage means the arc is more probable, of course. A foam cover is a poor insulator, but at least it helps keeping the minimal distance from the conductive microphone grill. In this case we're talking mostly about avoiding unpleasant shocks, not some life-endangering situations.


I've noticed "textured screen when charging" on a range of mobile devices which I've nearly always been able to correlate with cheap USB chargers. Other family members seem oblivious, though to me it's clear as night and day.


it's because of the current that is leaked by the class y capacitor connecting primary and secondary of the power supply to suppress EMI. this will mean there's something like 50 - 100v potential to earth on your macbook, but at a very low (non dangerous) current. that's why you get zapped or feel a tingle. if you have the earth connection, that power will be sunk through the earth lead, but otherwise a metal case will generally be connected to the DC ground (and also earth if present on the plug), which will have this low current AC voltage present.


> MacBooks and iPads had the "spicy case" issue for quite a long time. In certain countries, the Apple power supply comes with two adapters for plugging it into the wall - one with two contacts, and one with three contacts. Only the one with three contacts is grounded.

Thanks a lot for you comment. I had noticed that myself with two old Mac Book Airs.. Actually, that's how I knew if plugs were grounded or not: I could immediately tell.

But, over the years, I always wondered if there were any electrical issue (in several houses) or if it was normal.


It's not "normal" but it may be common. The MacBook should be fine on two wires; but something else may not be, causing it to be spicy.


They are spicey everywhere though, even in cardiac protected areas that are checked regularly by electricians. New builds, rebuilds etc.

This isn’t a building wiring issue.


I really wish the North American adapter’s direct-to-wall connector (the one that’s not a cable) came in an optional 3-prong configuration. As it is, I have to bring an extra cord around with me any time I bring my laptop somewhere, simply to ensure it’s grounded. (I used to get those shocks from it too, until I did, and I really don’t want to go back to them, let alone know what they’re doing to the electronics.)


Try aftermarket? https://smile.amazon.com/Grounded-Duckhead-Apple-Mac-Adapter...

Shouldn't be able to hurt you THAT much ...


I noticed the same issue. But does the ground connection of the wall plug side of the transformer actually make a difference? I'm not good with electrics but I always thought the other side of a transformer is electrically isolated and the sides don't share a ground.


I think some AC to DC transformers bond the AC neutral and the DC negative.


Hm interesting. I'm in europe on 50 Hz, none of my apple power adapters are grounded, not even the mac mini power cord is, and i've never noticed any issue.

However the electrical wiring for my apartment is only about 20 years old...


Apple might also have improved this for newer devices. I remember it being a problem for devices from around 2011 to 2014.

Edit: MertsA added some more info below: https://news.ycombinator.com/item?id=33572585


2021 MBP 14 has this issue for me with the stock charging brick (NZ - which has 3-pin sockets): but Apple don't ship the stock charging brick with an extra extension to the socket, so the transformer/brick plugs (via a corner adapter) directly into the socket, which isn't grounded.

If I replace the direct corner adapter of the brick with an older (from a 2015 MBP 15) extension which is grounded, i.e. you can't then literally plug the charging brick directly into the power socket, there's an "extension" chord in between (and not just a generic one, this is Apple specific for the connector to the brick), the issue goes away.


Definitely still occurred on my 2017 macbook pro.


Still occurs with my 2021 M1 MBP


I paid attention a little and there is a spark when i plug the laptop charger in. 2018 mbpro. With the short plug in the charger, not the long power cord.

No other symptoms though.


I thought one of the two wires should be equal to ground?


That’s how it could be done in theory but it’s never because you would kill people.

Instead one wire is neutral, one is phase, and the third, optional, is ground.


Can you supply a good "this is how it actually works" reference for European electricity?

In the US there is one neutral and one hot line. Then there is the ground that is grounded at the box preferably. You can sometimes have a 240 line split to feed two 120 outlets where the hot lines from each are at a 240 difference to each other. If one line has a large load relative to the other, the neutral won't be that close to ground. Is that was is happening with these laptops?


>If one line has a large load relative to the other, the neutral won't be that close to ground.

Shouldn't it still be pretty close voltage wise? If we hold the neutral is always at 0v at the panel, since that's where it's tied to ground, the voltage on the neutral between the panel and the outlet should still be pretty low because copper wire has a pretty low resistance (by V=IR). I'd have to break out my calculator (and look up the actual standard values of copper wire resistance), but I'd guess even >20V would be quite unusual without some other fault...


At dc for sure, at 60hz perhaps imaginary impedance could create "spicy case". I only thought about it because I used to use a welding cable adapter for my dryer port that had a "bootleg ground" and the internet warned me a shock from the case could be a result.


Why would it kill people?


https://portablepowerguides.com/ground-to-neutral-both/

Because it can cause power to go unexpected ways.

All the "power safety" stuff does nothing if everything is correct and perfect, but if it fails, and ground and neutral are bonded anywhere EXCEPT at the panel, you can get power flowing through you.


And shouldn’t there be exactly one grounding point per building and definitely not one outlet randomly grounded to a pipe? Not an electrician but I’m pretty sure that’s a major code violation and safety hazard.


> definitely not one outlet randomly grounded to a pipe?

That's how it used to be done! Remember a lot of houses were built before electricity and it's been retrofitted over time.


A water pipe is bare copper straight to the ground.

It makes perfect sense if you think about it.

Pretty sure that is how it is done in my much newer than electricity build.


Old copper water pipes, yes. Obviously you can’t ground using a PEX pipe.


Wouldn't it also need a continuous copper pipe until it meets the ground? A pipe being made of copper or iron doesn't mean it's not connected to a plastic pipe or adapter upstream; and I've seen plumbers using a rubbery-looking tape between the threads when screwing two metal pipes together, which might not be conductive.


I just fixed this situation in a house from the 70s. Cable coax lines grounded to a metal hose bib ... which, in the crawl space, switches to PEX about a foot away from the bib.

Cable guy installing high speed internet was all "nope!". I think the previous owners just had crap internet and didn't ever get into why.


The coax shield must be broken somewhere between you and the service provider. "Grounding" a coax to PEX should never make a difference in any way.


I think part of his worry was lightning strike busting their equipment. Unsure about the rest.


> Wouldn't it also need a continuous copper pipe until it meets the ground? A pipe being made of copper or iron doesn't mean it's not connected to a plastic pipe or adapter upstream

Right.

> I've seen plumbers using a rubbery-looking tape between the threads when screwing two metal pipes together, which might not be conductive

Probably PTFE (teflon) tape.

The thing to do with oldschool copper pipes though was to braze them together, which is conductive.


I think the continuous water still maintains a ground path even in pex


Water is actually not very conductive at all which is why you need to install ground links if you break into an existing grounded pipe.

And the purpose of grounding the pipe isn't to use the pipe as a ground (some very old electrical setups may have done this), it is to prevent the pipe from getting energized by a wire or something resting against it. If the pipe is properly grounded, that'll short out a breaker.


Pipe is a great ground, if done properly. Nice big hunk of metal thoroughly embedded into the ground is all a ground plate is.


The problem with “if done properly” is that you actually have to go and check. If you just “hope that it is done properly” you can have a lot of surprises, like lights going out when the sink gets full of water. Or spicy dishwashers.

If you don’t know whether it’s properly done, it’s much more efficient to throw a ground cable from the nearest service junction than it is to “hope” and then have to fix things later.


It’s not about whether or not pipe is a good ground. The electrical grounding for a building needs to be like a tree. No ground loops and exactly one grounding point. Arbitrarily adding grounds, especially through water pipes can do things like making all of the piping and water in the house hot if there is a fault somewhere and it definitely seems like that’s the case here.

The whole idea is that the ground wire is the least resistance path for stray current to go to. When you have separate ground paths there can be a dangerous potential between ground wires and the least resistance path for stray current can again be you.


There's a difference between the electrical return path (aka neutral) and protective earth (aka ground). Earth is purely for safety: you earth the metal chassis of appliances so that if for some reason they get shorted to hot, the current has a low impedance path to earth and your breaker will pop. It's perfectly acceptable to have an independent earth at every single outlet, as long as you're earthing to an acceptable source (which, AFAIK, means driving an earthing rod into the ground, because pipes aren't legal in the NEC anymore).


The "single ground point" is some sort of weird misconception of how ground systems work that became an urban legend. I think it comes from the fact subpanels used to be allowed to bound the neutral and ground and that putting a ground rod there created another return path for current from the neutral.


You can have multiple ground points per building as long as the ground points are bonded to each other.

You can only have a SINGLE tie between neutral and ground.

What we don't know here is if the piping is tied to a grounding rod, or if there is a grounding rod or if the piping is the ground point.


I expect it's the landlord instructing the electrician to do a half-assed job to keep the cost down.


Except multiple visits are expensive, and no one wants the place to burn down.


Some old house, wired not understanding ac, mixed up the return and ground. Stuff works, but...


Seems like a completely slapdash piece of work really:

> They asked lots of questions, and then recommended that my air conditioner stay on a different outlet because there were two circuits.

An AC has sufficient power draw that you'd normally put it on its own, exclusive, circuit. Like a drier or washing machine. Not on whatever random outlet is nearby.


Probably talking about a window unit there.


And even then if you've been anywhere with "fun" power you've noticed the lights dim when any beast of a machine turned on.

The US grid has gotten better, and machines have too, but lights used to dim all the time.


This is not necessarily true depending on code. Some builds do not have grounded outlets as long as a GFCI is installed at the distribution.

It’s weird and unnatural, but there’s nothing inherently wrong.


Saying there's "nothing wrong" when there are obvious, serious hardware issues and a UPS that won't stop beeping is like saying "well there's no law that my tires can't be bald, so I'll keep driving because there's nothing wrong"


I do not think the situation is the same. I believe GFCI gives excellent protection against shock even if the ground is faulty and the neutral is floating with respect to earth. (Nevertheless, I still want my home to have properly grounded three-pin sockets, even if it is implausible that it will ever make a difference.)

I hope an expert can chime in, but I suspect a 'spicy' trackpad would trigger GFCI.


GFCI at the breaker should have the ground tied to neutral, and still have grounds on the outlets (tied back to the GFCI at the breaker). Current through the ground pins will trip the GFCI, rendering the system safe. Since the ground pin should be bonded to any exposed metal (e.g. aluminum laptop case) a fault leading to a "spicy touchpad" should instead shut off the entire circuit at the breaker.

Just slapping a GFCI in without that bonding won't do anything though. The ground would be floating, and thus wouldn't ever trip the GFCI. There would be no path through the GFCI for the fault current to take, making the system just as dangerous as having an ungrounded conductive case.

A "double insulated" system has non-conductive material for the case of the electrical device and only needs a two-pin polarized plug. A fault of live to case won't cause danger, because the case is an insulator. A fault of live to neutral will just blow the device's internal fuse (or trip the breaker if the device has no fuse, but the breaker is just to protect the romex wiring in the walls so the device could well be on fire by that time).


> The ground would be floating, and thus wouldn't ever trip the GFCI. There would be no path through the GFCI for the fault current to take, making the system just as dangerous as having an ungrounded conductive case.

GFCI works by detecting an imbalance of current on the intended path - i.e. between live and neutral. For an ungrounded conductive case to create a electrocution risk, there must be an alternative pathway through the user's body and a potential difference to create a current on that pathway. Whenever these conditions occur, there will be a live-neutral imbalance which will trip the GFCI before any harm is done. In contrast, with an ungrounded conductive case and no GFCI, if a fault creates a situation where electrocution is possible, the only thing that could protect the victim is the circuit breaker, but the breaker must allow sufficient current for normal use, which is well above the threshold for lethality.


I highly, highly recommend you read up on electrical theory. When you're done go de-energize a system, disconnect the ground on a GFCI outlet, then connect the live of that GFCI to whatever piece of random material you have. Or lay it on the ground directly. When you re-energize the system, the GFCI will trip or it is bad.

If a GFCI was dependent on a device being grounded it'd be no better than a regular 3 prong outlet. We'd also have to ban 2-prong devices, which are probably most devices in a US home at this point.


> I highly, highly recommend you read up on electrical theory.

Do you have any suggestions on books, tutorials or similar?


https://www.angi.com/articles/does-replacing-ungrounded-outl...

GFCI specifically works by measuring the current out = current in.

To be shocked, current out ≠ current in.


There is actually a weird way to work around that. If you stand on an insulated sheet (like a clean plastic cutting board) you wouldn't have a path to ground. If you cut open one current carrying conductor of the cord and put yourself in-series a GFCI wouldn't trip in that case. Current would still flow through the device. Enough to hurt you, but probably not enough to turn it on for most devices like a lamp.

As you can guess, such an accident is nearly impossible even in the case of someone cutting through a cord accidentally.


Indeed - and an electric chair will kill even if it is both properly grounded and plugged into a GFCI socket capable of handling the current (aside: do electric chairs have UL certification? I doubt it, but the states in which it is still nominally an option presumably want the operators to be safe.)

If you are put / put yourself into the normal current path (such as while working on the innards of plugged-in and switched-on equipment), you are just the load (or part of it), and neither GFCI nor previous protection schemes will help you.


Similarly arc fault detectors try to detect arc faults which a GFCI won’t “see”.


A GFCI device does not care about the presence of a ground current -- at least not directly. GFCI measures a current imbalance between hot and neutral; if there is such an imbalance, it disconnects the circuit (i.e. it trips).

It's true that any such imbalance is most likely to flow through the ground of the GFCI's own Romex cable and for that reason it's best for GFCI circuits to be grounded. But an ungrounded GFCI will also trip if its hot current finds another path through ground, such as through a water pipe, because that current will not be returning through the GFCI's neutral and it will thus create an imbalance.


It's not just a spicy track pad, it's monitor issues and (the whole premise of the post) data corruption issues


My apologies: I completely agree that there was definitely something wrong with OP's situation. I misunderstood your response, and thought you were objecting to KMnO4's claim that you can have a safe two-wire (no ground wire) scenario if you use GFCI.


Oof. A missing equipment ground (the third pin on your outlet or its wiring) will not cause these issues. In fact, it’s legal to have an ungrounded three pin outlet in a retrofit situation as long as it’s GFCI protected and labeled.

I bet there’s a missing or poor neutral. If your neutral wiring has problems, then you are operating at anywhere between 0 and 240 VAC depending on what else is going on, e.g. whether the AC is running or the lights are on. Additionally, if you do have any sort of ground and that ground is (improperly) tied to neutral in more than one place, then you may have substantial current flow through “ground”, i.e. the actual Earth, your pipes, your steel building structure, your body, etc.

Get a true RMS voltmeter, (safely!) connect between hot and neutral, and switch lights and AC on and off. Repeat with the meter between neutral and ground.

And consider replacing the circuit breaker on the circuit you’re using with a GFCI breaker. Several common screwups will cause it to trip.


A bad neutral isn't going to trigger a brownout that reproduces reliably in some random gzip code when you're booting fully into Windows, on a modern CPU with fine grained frequency/voltage scaling, on a battery-powered laptop, powered by a switched-mode power supply with tons of capacitance in every single layer on the way to the CPU.

The most plausible explanation I can think of would be if the return current is flowing through the monitor and EMI from that is disturbing things, but 60Hz might as well be DC to modern signal rates, so that's tantamount to blaming witchcraft.


That is exactly what bad neutrals do (produce brown-outs). They produce brown-outs because the potential between the "hot" side and neutral is < 120 V, because the neutral is > 0 V.


Yes, it'll produce a brownout at the outlet, but it's highly unlikely that this will manifest as a brownout at any of the component voltages, because there are so many layers of filtering. That <120V goes through a switched-mode power supply which converts that down to 20ish V, which goes to a battery charger IC which charges the battery, which outputs a variable voltage that goes through multiple more layers of monitored DC/DC conversion to generate the power rails. Every one of these steps has circuitry that will panic and send a signal to the main PMIC if it sees a voltage that is out of spec.


My guess would be that the issue was not brownouts, but noise (which could even have peaks well above 230V). The air conditioner has a motor, and motors can be electrically noisy; it should have filtering, but with a broken neutral, that filtering might not have been as effective. Grounding the outlet with the computer (the solution at the end) would have allowed the filters at the computer and monitor power supply to filter out the noise (AFAIK these filters work mostly by shorting high-frequency components of the waveform to the other wire and/or to ground, so they need a good neutral and/or ground to work).

But yeah, these sorts of "bad wiring" situations can have baffling effects. I would love to see someone in one these situations actually manage to get a logic analyzer trace or similar to show what's actually going on with the power supply, together with an investigation (and fix) of its real cause.


Anyway, disgraceful that the electrician failed to diagnose Al or any of it on the first visit.


Most residential power is dirty to some extent, and AC/DC converters are supposed to be able to cope with a wide range of input distortions. For the problem to have worked its way through all of the safety components in both the laptops power brick and its internal electronics means that the distortions must have been particularly high amplitude, and at frequencies that couldn't be easily filtered out (very high, very low, or both).

Electricians that aren't particularly well trained, or particularly experienced are probably not going to be able to diagnose this kind of problem.

This is really a problem for an electrical engineer.

Unfortunately, in most jurisdictions, engineers aren't allowed to perform these kinds of repairs because they don't necessarily have the certifications to perform work on live wires.

Most electricians can only trace wires and identify visible faults, and replace things that aren't up to building codes.


You can buy a $10 tester[0] that will detect open grounds, open neutrals, and any other wiring fault you'd care to think of. It doesn't take an experienced electrician to use; you plug it in, and see which lights turn on.

What I think is more likely in this case is the A/C turning off. All electric motors induce a current whose direction is opposed to the originally applied current (Lenz's Law). This is called back-EMF or counter-EMF. It's also proportional to the rate of change of the magnetic flux. You can see this when you turn on a motor like a vacuum cleaner, and observe the lights briefly dim. The same thing happens when a motor turns off. Additionally, things like vacuum cleaners or fans have relatively little resistance to them, so when they turn off they can coast down - small rate of change, small impact to voltage levels. An A/C or refrigerator compressor presents a relatively large resistance to its driving motor, so when it shuts off, it shuts off HARD. Big rate of change, big induced voltage spike. I don't know about a small motor like you'd see in a household, but large industrial motors can generate hundreds of volts when turned off. This is usually handled with a circuit called a snubber, but it doesn't generally matter in residential applications so it's rare to be included, as a cost savings measure.

[0]: https://www.kleintools.com/catalog/electrical-testers/recept...


The author appears to be in Vancouver BC Canada.

In US/Canada, power supply is done via 240V split phase. Therefore, a broken neutral between service and home would have lead to a 120V outlet getting anywhere between 0 and 240V AC. That sure would have lead to something a lot less pleasant than just gzip errors.


Therefore, a broken neutral between service and home would have lead to a 120V outlet getting anywhere between 0 and 240V AC.

That is true, although loads are normally balanced between the two phases so that the extremes don't often appear, and the neutral could just be intermittent instead of fully broken. But a heavy load (such as the air conditioner in the article) would definitely cause the voltage to swing to one extreme.


To my understanding a ground isn't necessary for equipment to operate at all, however it sinks the EMI, reducing floating neutral voltage and noise.

PC equipment such as voltage regulators put out a lot of noise. The neutral is not bonded to the metal chassis when a ground is not present, meaning the difference in potential in the chassis cannot be synced with ground, causing various crazy issues. It's why cases still are overwhelmingly metal, steel mostly.


Ground is (ideally) a just in case safety measure. It catches voltage transients, shorts, etc. and routes them safely to ground via a (normally) non-current carrying conductor. This is also useful for EMI protection.

The neutral should also be bonded to ground at the panel in residential installations.

It used to be there was no ground, and neutral carried the ‘return’ load and was also used for equipment grounding and the like. It’s not as terrible an option as you’d think, if everything else is done correctly.

However, this can be dangerous as certain types of wiring setups (generally incorrect and non-code compliant) can produce voltages on other neutrals in the circuit, and if that is being used to ground a metal case (which there is no other alternative), zap to anyone who touches it.

Especially if someone wired something backwards and you get a hot neutral (aka now hot metal case). Especially if the badly wired thing is something sporadic, like a rarely used light switch or outlet. It turns it into a ticking time bomb.

It’s a somewhat common DIY error to create floating grounds (and floating neutrals), and a floating ground can still cause this even with modern wiring with the right kind of screw up.

It’s one of the most dangerous types of wiring problems.

I’ve run across it in two different houses I moved into after the fact. Also damaged conductors causing heat and sparking. Also damaged outlets that on closer inspection exposed current carrying parts of the sockets due to cracked and broken plastic.

It’s a jungle out there!


> Oof. A missing equipment ground (the third pin on your outlet or its wiring) will not cause these issues. In fact, it’s legal to have an ungrounded three pin outlet in a retrofit situation as long as it’s GFCI protected and labeled.

I’m pretty sure that this is location specific and I don’t think this was pass where I am. Even outlets which aren’t RCD protected get a fail now.


You must be somewhere that calls them GFCIs RCDs. :)

This particular rule in the NEC (the code for most US jurisdictions) only allows this as a retrofit:

https://www.electricallicenserenewal.com/Electrical-Continui...


Not going to lie, that's above me. But is that allowing outlets that aren't grounded? If so, yikes.

I'm in New Zealand and if you are touching your electrics when getting work done, you need to be installing RDCs on the circuit.

You can do all sorts of stupid things when you have an RCD on a circuit, and while I'm sure you could still get electrocuted, you'd have to try quite hard.

https://www.nhpnz.co.nz/en/News/Stay-safe-with-compliant-RCD...


GFCI is American for RCD, more or less. Except that our GFCIs are almost always 5mA, whereas yours seem to mostly be 30mA. And ours don’t generally live on DIN rails.

The rule here is that, if you replace an old ungrounded outlet, you ought to find a way to ground it and, if you can’t, you must add a GFCI.

(Sadly this often can’t be done in the breaker box, so it means a GFCI in the receptacle. The issue with adding GFCIs in the breaker box is that a lot of old knob and tube installations didn’t match up neutrals with their corresponding hots, so individual circuits don’t have circuit-specific neutrals to run through the GFCI.)

American GFCI breakers generally look like this:

https://www.homedepot.com/p/Square-D-Homeline-20-Amp-Single-...


The author appears to be in Vancouver BC Canada.

In US/Canada, it is safe and code compliant to have floating ground in a GFCI protected outlet. The GFCI provides the safety benefit that ground is supposed to provide. Obviously having both GFCI and ground is better, but having only the former is allowed. Occasionally, ground serves additional purposes beyond safety, but that doesn’t apply for a computer power supply.

Additionally, in US/Canada, it is unsafe (and against code) to wire a new outlet directly to water pipe. Ground-neutral bond is required at the main service panel because the “ground” (soil, water pipe, etc) isn’t a good enough electricity ground. The ground wire in the outlet must be wired to the main panel (directly, or through subpanels), where 3 things are connected together: neutral bus, ground bus, and the “ground” (soil, water pipe, etc).

All in all, the author didn’t find the root cause of the problem. And in trying to fix the problem, the author introduced more bugs.


It probably depends on local codes, but:

>and the outlet was correctly grounded using my water heater as ground, according to my outlet tester.

I don't think that grounding to a water heater (please read as to water plumbing) is correct.


Grounding to a cold-water pipe is pretty common in the US, and is allowed under certain narrow circumstances by the national code (subject, of course, to being disallowed by local codes.). Specifically:

NFPA 70

250.52(A) Electrodes Permitted for Grounding.

(1) Metal Underground Water Pipe. A metal underground water pipe in direct contact with the earth for 3.0 m (10 ft) or more (including any metal well casing bonded to the pipe) and electrically continuous (or made electrically continuous by bonding around insulating joints or insulating pipe) to the points of connection of the grounding electrode conductor and the bonding conductor(s) or jumper(s), if installed.


Even more so, it's usually mandatory to ground your panel to incoming water line when it is metallic. But that's for the electrical panel, not a single random outlet.


Sure, but that’s about providing a ground path for the water line in case it becomes accidentally energized, not necessarily providing a ground electrode for the electrical service. In other words, you’d have to do that even if the metal water piping was not eligible to be used as a ground conductor:

NFPA 70

250.104(A)(1) General. Metal water piping system(s) installed in or attached to a building or structure shall be bonded to any of the following:

(1) Service equipment enclosure

(2) Grounded conductor at the service

(3) Grounding electrode conductor, if of sufficient size

(4) One or more grounding electrodes used, if the grounding electrode conductor or bonding jumper to the grounding electrode is of sufficient size

The bonding jumper(s) shall be installed in accordance with 250.64(A), 250.64(B), and 250.64(E). The points of attachment of the bonding jumper(s) shall be accessible. The bonding jumper(s) shall be sized in accordance with Table 250.102(C)(1) except that it shall not be required to be larger than 3/0 copper or 250 kcmil aluminum or copper-clad aluminum and except as permitted in 250.104(A)(2) and 250.104(A) (3).


Back in the day, I remember reading instructions on how to build some sort of electrical toy (a Tesla coil? can't remember). The circuit was 120VAC powered, with a hot side and a neutral side.

The problem was that the neutral side was accessible to the user, and the plugs back then were unpolarized. So, if you plugged the "neutral" side of the plug into the "hot" side of the outlet, you would Have A Bad Day.

The workaround: only wire the "hot" side to the plug, and connect the "neutral" side via a separate wire to a nearby radiator (presumably ground). That way, plug the plug in wrong and the toy wouldn't work, rather than becoming dangerously charged.

Was it safe? Safe enough for back then...


>Was it safe? Safe enough for back then...

Yep, but back then we were much more reckless, just the other day there was a story on HN on amateur chemistry (dying or dead):

https://news.ycombinator.com/item?id=33517520

About electricity, up to not so many years ago (here in Italy up to around 1990) electrical codes were fairly "open", with no ground/earth requirement, and up to the 1970's or so it was not so uncommon to have houses with external wires, see:

https://news.ycombinator.com/item?id=29616691

How we (kids in the '60's and '70's) managed to largely survive these and all the other everyday risks (no helmet on motorbikes, no safety belts in cars, etc.) remains a mistery.

But in the case reported here that today an electrician would ground an outlet to water plumbing, it would be - well before being forbidden - unthinkable of.


> amateur chemistry

Ah, those were the days. Back in the 80s my parents bought us a chemistry set from a thrift store that was probably 20 years old already. It was actually set up to teach some practical chemistry by providing a mystery substance and a set of reagents that would help you figure out what the substance was. Ten year old me just cut to the finish line and tasted the mystery substance - it was sugar.


Are you sure it didn’t have a normal plug, with a separate clip for a reliable chassis ground? I don’t see how the half plug with a neutral wire to a radiator would be “safe”, even when compared to a neutral-connected chassis with an unpolarized plug. “The hot side is accessible to the user” is still true, just remove the wire to the radiator, now it‘s at line potential.


My grandpa’s old home only had ground pin outlets in rooms with plumbing because they only wired them up to pipes. I could imagine some wild old codes allowing that kind of thing.


A developer is surprised that improper electrical infrastructure causes systemic computer malfunctions. Surprised enough to write an article about it.

I feel like this just perfectly summarizes my early years in the tech field, back when I was a screwdriver jockey and spent my afternoons diving under desks. "Why yes, person who gets paid more than twice what I do- spilling a chai latte on your laptop keyboard does mean that it has to go away to a computer hospital for a bit, and no, I cannot magically go back in time and make a copy of all of your important files on an external hard drive for you."

To the author: no hard feelings- I love devs. But just like you might be surprised at the person struggling to write a simple be five-line bash script, sometimes the hardware-oriented folks are surprised at what doesn't occur as an obvious issue to others.


What's surprising is how subtle the failure started.


You may be surprised at shell script knowledge among devs.


Interesting, most notebooks are not connected to ground. Maybe ground connection came from peripherals (USB Hub/monitor etc.) ?

> Again, the same pattern came up: the wrist-rest was only uncomfortable when running on AC power.

Guy's getting lightly electrocuted...


That's due to a class-Y capacitor in the PSU used for EMI filtering. Honestly it's harmless and you'll even see this issue on a MBP if you don't use the three prong cord that has a ground. Normally it's so slight that you don't feel it but if you lightly rub your finger over the chassis you can sort of feel a texture to the surface that's not actually there. It's 60Hz but it feels like ridges on the surface and it disappears if you unplug it or plug it in using a grounded cord.

https://www.allaboutcircuits.com/technical-articles/safety-c...


It can be due to the cap in the laptop power supply, but here more likely case is as OP is guessing, the ground stopped being ground and the leak is somewhere else in power network. And that can be way more dangerous than just a tingle, disconnected ground means that even line directly connected to ground would not trigger any safety (especially if house is old and also don't have RCD).


I've felt that faux-texture phenomenon if I rub a finger on the stainless-steel surface of the dishwasher's door in the apartment I'm currently renting (living in a ~50-year-old flat I'm the Netherlands, though the dishwasher is almost brand-new). Would a similar cause of lack of grounding be at play here?


No clue what electrical in the Netherlands is supposed to look like but it sounds like it's a floating ground if you're sure you're feeling the same effect. Grab a voltmeter and check and if you're seeing 60-70V AC then it's probably EMI filtering. It's completely safe and doesn't present any kind of shock risk other than the fact that it's an indication that the chassis is ungrounded which means you don't have the added safety of shorting out the circuit if a live wire came loose inside and energized the chassis.

Personally I miss the days when protective earth was protective earth and you didn't have to worry about engineers doing foolish things like using it for EMI filtering or any sort of current path, even if miniscule. The safest class Y capacitor is the one that doesn't exist.


Thanks for the suggestion, I'll see if I can get my hands on a voltmeter. I too miss the days when things were engineered for safety and durability.


Until you get that looked into, I'd take extra care not to simultaneously touch the door with one hand and any possibly solid ground e.g. water pipe with the other.


Thanks for the suggestion. I realized something was amiss when I was placing a rinsed plate on the dishwasher and by accident touched the wet steel of the kitchen sink. I was lucky that it was only a small tingly shock. However, I've had trouble in convincing the landlady to fix it, since the contract stipulates that I need approval for any modifications.


Possibly, at least in my case the inside metallic parts in inside of dishwasher are directly (and by that I mean resistance is less than ohm) connected to ground.

Normally any leakage would be shorted to ground (and if too much and house has RCD, trigger protection), but if there is weak one, or none (some of the old houses even have only 2 wire install, with "ground" pin just connected to neutral)


I think it was a notebook with aluminium frame, which would make grounding appropriate.

I had a Dell XPS 15 with aluminium frame once and discovered that it was grounded when I was in a hotel abroad with no ground on the outlets and – my wrist-rest got uncomfortable.

I then quickly fudged some wire from the notebook to a radiator, though.


Guy's getting lightly electrocuted...

A new initiative, to boost productivity, from management!


lightly shocked, lightly electrocuted is like being lightly decapitated.

We actually have this issue in our 6 year old office, so not exactly old electrics. Running laptops off non-grounded plugs causes that typical "vibration" / buzzing feeling throughout the chassis of the laptop.


As in laptops that work fine in other place ? Sounds like electricians fucked something up...


Uhm I find the conclusion here quite unsatisfactory. Like I have plugged in many things without grounding and never had issues like this. It sounds to me like there were more issues that are now masked by working grounding.


Yeah, it sounds like the neutral wire wasn't at 0V either.


In the ex-USSR there was usually no grounding at all. All plugs had just 2 pins. Even if the socket is new, the wiring most often isn't.

Everything works mostly normal, except that you can have 110 (220/2 via capaciator bisection) volts with large impedance on "supposedly grounded" metal surfaces to give you minor shocks/uncomfortable feeling.


My house built in 1950s in the US is the same. Grounds were’t in style yet.

There are very few things that actually need grounded. Kitchen appliances and laundry (which are both retrofitted with grounds).


I'm confused by this. My laptop jack's have 2 pins + and -. No earth. I've taken apart power bricks, and they aren't wired to earth either, So how (on earth) would earth be impacting the laptop?

Plus if the lack of earth is showing as a problem, that suggests an issue elsewhere as all being well earth shouldn't be getting used.


That (at least in EU) is a Class II insulated device (as most low power chapters/adapters):

https://en.wikipedia.org/wiki/Appliance_classes#Class_II

But I have seen laptop chargers with earth/ground, I guess it depends.

From the overall description it seems to me more likely that for some reasons only indirectly connected to the poor grounding the AC unit introduced some kind of spurious (or stray) voltage on the neutral.

https://en.wikipedia.org/wiki/Stray_voltage


> But I have seen laptop chargers with earth/ground, I guess it depends.

All the mac chargers I've had had a grounding pin.

Whether they're actually grounded depends whether you're using the wall-wart adapter or the cable: in europe at least the cable has a grounded plug, the wall wart is just a europlug.


> All the mac chargers I've had had a grounding pin.

The MBPs I've had only came with an USB-C charger. Those come with a Europlug, which doesn't have an earth connector.


> The MBPs I've had only came with an USB-C charger.

That's not exclusive, USB-C has ground pins.

> Those come with a Europlug, which doesn't have an earth connector.

Yes, but if you remove the europlug you should see that the charger has a metallic nub onto which the adapter clips. The 140W charger has one at least, and so did the old 85W chargers. Non-earthed chargers (e.g. iphone chargers) have a plastic nub instead.

As I wrote the europlug adapter is not earthed, but the cables (with a CEE 7/7 or whatever the standard is in your country) are earthed. I'd assume the UK wall wart adapter is also earthed but I've never seen one.

You can see the earthing on the charger side of the cable, because it has two metallic strips inside the recesses, to connect to the nub.


> That's not exclusive, USB-C has ground pins.

That's a circuit ground, not an earth ground. It's not for connecting the device to an earth pin.

> if you remove the europlug you should see that the charger has a metallic nub onto which the adapter clips.

I see. I looked at mine, a 61W adapter. Interesting that they chose to use a C7/C8 connection with a separate metallic nub, instead of a C5/C6 Mickey Mouse connection.


I actually measured that Dell USB-C chargers forward grounding to the outside metal of the USB-C plug, and the laptop actually uses that grounding for its chassis.


This confused me, because there's definitely no pin for an earth ground in an USB connector. So I decided to repeat your experiment and see which pin it uses.

Turns out, it's the cable's shield that carries the earth connection.

Always cool to learn something.


That's really cool, so the connection ground is in the cable, but the earth ground is the connector itself? Is that part of the spec or just something which sometimes happens?


I don't know if it's specced. I couldn't really find anything more than the pin diagrams on Wikipedia ( https://en.m.wikipedia.org/wiki/USB-C ). Those don't mention earth ground at all.

But since both Dell and Apple are doing it, I guess it's at least an optional thing they can do.


> I'd assume the UK wall wart adapter is also earthed but I've never seen one.

https://i.imgur.com/X6uxKaq.png - UK MacBook Pro M1 wall wart


There’s a metallic ground pin but that doesn’t necessarily mean much, I’ve got an iphone adapter (from the world kit) which is the same and is ungrounded (because the old switchable power adapter has no ground nub).

You need to check the back of the plug, the nub of the charger (which is metallic) slides into a rail thing. With the cables, the rails have a metal strip to connect with the charger’s nub: https://discussions.apple.com/content/attachment/8ec896d8-54...


The only way this makes sense is, if his neutral wire wasn't at 0V either (which can happen when pulling a lot of current from insufficiently thick wire)


Frame.work laptops have properly grounded charger (over UBC-C).


Could be grounded via USB ground on AC-connected USB hub, or monitor.


I remember many years ago I had a computer where, sometimes, programs crashed when trying to launch them. They segfaulted for no apparent reason. If I rebooted the computer, they may work. It usually happened with big programs like Firefox, Thunderbird, etc. I once noticed that I didn't had to reboot the computer to make them work: just emptying the caches (/proc/sys/vm/drop_caches). In fact, the md5sum of the binaries giving troubles, before and after emptying the caches, were different: one random byte had a different value. I never knew what caused the problems, I always thought it was either an unsupported device or a faulty component, however things like memtest never reported any issue.

When I got a new computer and was about to dispose that one (finally!) somebody told me it could be related to electricity problems. I then had that computer plugged to a different outlet during its last week and, apparently, I got no issues; however, issues didn't always happen, so I never knew if that was the cause or not.


Wow, I did not expect this to hit the front page.

Lots of excellent questions. If you'd like to get notified when I write an extended version of this post with more details, sign up to my mailing list here: http://eepurl.com/idzoGv


I noticed that with my two 2012/2013 MacBook laptops overall several european countries, in different homes: that "twitchy" feeling on the metal case of the laptop when plugged without grounding.

Do all of these houses have serious electrical issues?

The house in which I live now does that to my old MacBook Airs if I convert my Macs's chargers' hybird CEE 7/7 plug (two poles + grounding) to a flat two-pole europlug (no ground).

I can reliably reproduce the issue in several houses, over several countries.

But if the plug is grounded, everything seems normal.

What's going on?

I'm here since six months, with shitloads of electrical things ongoing (including the whole swimming pool machinery). And everything appears to be working fine.

Should I be worried?

I mean: I can reliably reproduce what TFA describes. My old MacBook Airs do that all the time if there's no ground.


Floating earth ground definitely leads to tingly problems with some macbooks. My guess is some sort of capacitive discharge issue with some of the designs, but others have definitely noticed this problem.

The two prong connector was always a bad idea, but frayed wiring on the charger or bad house wiring can also cause it to float.


I've come to the conclusion that Apple and all their "amazing" engineering doesn't actually know how electricity works, because these silly issues plague their products.

The fuzzy MacBook is pretty annoying, but how about the Mac Studio, which can trip a GFCI when plugging it in (which, as far as I can tell, it almost certainly a design flaw and not a fault with my particular unit)

I expect this kind of stuff from the tat bought on eBay, where it's promptly thrown in the bin.


It looks like something was intermittently arcing and causing both the voltage fluctations and creating lots of EMI that disturbed the electronics. I agree with the others here that it doesn't seem the problem has been fully fixed, and a "lost neutral" could be the ultimate problem. Unfortunately these days it's rare to have incandescent lamps which will very clearly show a lost neutral by brightening as the voltage goes up, and a lot of electronics have universal input SMPS which will be fine with 85-250VAC.


I have a similar electrical issue at my house as well. I plug my laptop over I USB-C into my AC-DC converter, which comes with a two-prong US power cable, which is connected to a two-prong US-EU adapter, into a power strip connected to the wall (EU outlet). My laptop wrist rest is also "spicy" (most noticeable if my girlfriend touches my arm when I'm typing, we will both get shocked). So I obviously have a grounding issue but I'm at a loss because the equipment doesn't have anywhere to attach a ground rail to. Any suggestions?


I'd try using another power supply, ideally one that has a ground connection.


Reading this gave me flashbacks to the time when I tried figuring out why my laptop keyboard was typing letters by itself randomly. Turns out the always-on-usb feature of the laptop was causing some short circuiting: https://forums.lenovo.com/t5/Lenovo-P-Y-and-Z-series-Laptops...


> To rule out if it was a coding error, I tried to decompress the gzip file with bash via gzip -dc file. bash threw a strange error, “can’t seek file descriptor” when trying to read the file. This error is emitted from bash.c here.

Unless I am reading this wrong, the error would have been emitted by gzip, not bash. There is no redirection or anything here, bash is not even aware of that file.


> Aside: At this point, my laptop was bordering on unusable, even on battery power.

How would grounding an outlet affect a laptop running on battery?


Author mentions they replaced the laptop, so I guess at that point it was well and truly cooked by all the issues before.


ESD/EMI damage.


TL;DR grounding issues.

Nice read of all the debugging and resolution steps.


Grounding to the water heater? Isn’t acceptable practice to bond the ground wire to the cold water pipe?


Plumbing (at least here in Massachusetts, maybe it’s national code?) is usually grounded back to the panel which also grounds to external driven ground rods. I believe that is in case the plumbing is accidentally energized due to a loose wire it has a route to ground.


With all the plastic pipes these days?


That would be not-so-fun surprise when doing a renovation. I know lots of DIYers who like to cut out the copper segments and redo with plastic since it's easier to work with.


This has killed a few plumbers before. Not due to using it as a ground which is honestly completely safe but due to a faulty water heater that was inadvertently using the copper pipe as the neutral. The plumber turns off the water and cuts the pipe, then grabs both ends and pulls them apart and now he's got wet hands on both sides of the circuit he just cut.


DIY? The whole industry uses it and many cities use plastic pipes to deliver water as well. Simply put, you're not supposed to use water pipes for ground. That was done many years ago (prior to 1980 here).


Perhaps it is, but it's the cold water pipe which connects to the water heater, and they either slightly misunderstood or didn't want to explain in detail.


May be accepted by some people but it carries a risk of electrocution.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: