Some years ago, a senior professional colleague, at the prime of his career and with a wife and family, was electrocuted when his power drill cut into a live mains cable. Electrical safety is not just a tedious PowerPoint slideshow, nor does it only apply to professional electricians.
Because electricity is, almost always, completely invisible, you cannot see or otherwise sense when a wire or metal chassis is live. On the other hand, if it is live with 5 V DC supply for a circuit board, you may not even notice when you touch it; if live with 240/110 V AC mains, you may not live long enough to shout for help.
Electricity is also too commonplace. Gone are the days of our grandparents (or their forebears) who thought that, if you did not put a plug in every socket in the house, the electricity would leak out. That may seem absurdly ignorant now, but for many of us our understanding of things electrical is little better.
Mains and more
The serious, and deadly, side of every mains-powered electrical device lies between the mains power socket and the device’s power supply, where that high voltage alternating current is turned into much lower voltage direct current to power the electronics. For a Mac, it includes the mains plug, its cable, and the power supply within the computer. For laptops and most peripherals, it includes the mains plug, the power converter, and any cable between.
The simple rule for the AC side is that you must ensure that there is no risk of your coming into contact with the live wire at any point, unless it is visibly disconnected from the mains (but see below for anti-static precautions). Don’t do anything, such as plugging your Mac into the mains supply, with water around or on your hands. Don’t use any plug, power cable, or power supply which is not completely intact and safe, and so on.
In most countries, Macs and other devices are supplied with plugs already fitted to both ends of the mains cable, and mains adaptors must comply with safety standards, and should never be used if there is any suggestion that they might be damaged or defective. Just don’t run any risks with AC mains power: at the least it could cause a fire, and at worst near-instant death.
Old CRT displays
Especially dangerous are the high-tension components inside the case of all old CRT-type displays. These can store lethal voltages for many months, although they do self-discharge over time. As you have no reason to mess with the insides of such an old display, simply don’t.
I was shocked to read an article in an otherwise excellent magazine which discussed opening up an old display and feeding it signals from a Raspberry Pi, only warning of the lethal voltages in a note at the end. The only answer is to not put yourself at any such risk: don’t open up a CRT display. Ever.
The DC side
Provided the power supply is safe, the voltages used for electronics, which range between 5 and 24 volts at low power, should be completely safe. However you should bear in mind that shorting out the power supply to a circuit board can readily damage its components. So even though you may not be at personal risk, you might end up having to pay for a replacement logic board, graphics adaptor, or hard drive. It is therefore in your interest not to put your Mac or peripherals at such risk.
Static charges
Accidental static discharge into electronic circuits is another good way of killing them and requiring expensive repairs.
If you are going to dissassemble any electronic system, particularly your Mac, you need to keep the electronics and yourself well-grounded. If you do that, there is no risk of any static charge building up, or discharging into anything sensitive.
Anti-static precautions depend on the environment in which you are working. Some synthetic carpet materials and clothing textiles are prone, particularly in dry weather, to help build large charges sufficient to shock someone who you touch. In those circumstances you should go the extra mile and wear a properly-fitted grounding strap connected to an effective local ground, and that will probably mean keeping the Mac or other equipment connected to the mains supply but with the mains socket turned off.
When it is not so dry, local materials not prone to static build-up, and you are not going to be coming into direct contact with internal electronics, you should be able to get away with grounding yourself to the chassis momentarily before performing any internal surgery.
Remember that static charges capable of causing damage can enter computers and peripherals through their ports and connected cables too. Modern buses including USB, FireWire, and Thunderbolt are more robust than were SCSI and ADB, but killing one of the ports on your Mac would not be helpful.
Electrical storms
The final danger, to your Mac, electronics, and yourself, is that posed by electrical storms – normally the least likely, unless you live somewhere like Florida with its very high occurrence of thunderstorms.
If you are in a properly lightning-protected building, then you should seek advice as to what is most appropriate, according to the protection provided. In any case, you should run any desktop systems from an uninterruptible power supply (UPS), which has good mains power filtering and a protected wired Ethernet or phone line connection.
Electrical storms are most likely to result in glitches in mains supply, which are usually accompanied by spikes and fades (‘brown outs’) as the supply voltage varies. A good UPS will condition those out, and provide your Mac and its connected systems with a more constant supply voltage, saving their power supplies. Filtered supplies are valuable for laptop systems, but mains outage is not a problem to them with their internal batteries, of course.
Nearby lightning ground strikes can result in very local ground currents and other phenomena which can damage even equipment which is protected by a UPS. If you think that there is any likelihood of nearby strikes, you are better off shutting down your Mac and all its peripherals, and disconnecting them from mains power, and conductive cable connections such as Ethernet cabling and copper Internet lines; fibre-optic lines should not pose any risk with ground currents, but optical modems can be damaged by those currents.
Direct lightning strikes are of course life-threatening, pose a high risk of fire, and can result in catastrophic damage to any electronic and electrical equipment. Disconnecting from mains power and copper phone lines might bring a small reduction in risk, but your insurance policy is likely to be your best defence, unless the building has good lightning protection.