Bench modeSteps, parts, and safety only. Big type for a phone at the bench.
Phase 1: First contactExplainer10 min

Why the hum?

Where 60 Hz comes from, how it gets into you, why a notch filter is the wrong first answer, and the ordered list of things that actually fix it.

AssumesProject B: One channel of youSpineAnalog / mixed-signal hardware

You are skimming: the title, the first figure, and the short version. Switch to Read in the header for the full page, or Deep to open every deep dive.

The first thing your EEG showed you was 60 hertz. Every wire in the walls carries alternating current at that frequency, and every wire is one plate of a capacitor whose other plate is you. A tiny current flows through that capacitor into your body, and your body, being a resistor, turns it into a voltage: the hum. Here is how it gets in, why filtering it out afterward is a bad first move, and the list of fixes in the order they work.

Hum, and what to do about itSimulated signal
This interactive needs JavaScript. If you are reading a printout, the caption describes what it shows.
Figure 1. The simulated channel with the hum turned up. Try the fixes in the order the page suggests and watch which ones matter.
Try this
  1. Set Mains hum to 3. The trace is a solid band.
  2. Turn on the notch. The band mostly vanishes. Now press Blink and Clench jaw and look at the ringing after each.
  3. Turn the notch off and set the low-pass to 30 Hz instead. Compare.

How it gets in

Two paths. Capacitive coupling is the main one: the wall wiring, the lamp cord, the laptop charger are all at 120 volts alternating, and the air gap between them and your body is a capacitor of a few picofarads. At 60 Hz that capacitor passes a fraction of a microamp, which through your body’s impedance to wherever it exits makes millivolts. Magnetic coupling is smaller: a loop of wire (your two electrode leads running apart from each other and rejoining at the amplifier) is an antenna for the changing magnetic field around any current-carrying cable.

Both paths deliver a signal that is nearly the same at every point on your body: common mode, the thing the last explainer was about.

Predict before you look

Your trace is mostly 60 Hz. Which single change is most likely to fix most of it?

Unplug the laptop. If the Arduino’s ground is connected through the laptop to the wall, your amplifier’s reference is tied to the mains ground and every stray current in the building has a path through your electrodes. It is also the safety rule. Do it first, every time.

Why the notch is the wrong first answer

A removes a narrow band around 60 Hz. It works, in the sense that the trace looks better. Three problems. It also removes any brain activity near 60 Hz, which for EEG is minor but for EMG and spikes is real signal. It rings: a sharp event like a blink or an electrode pop excites the notch and it oscillates at 60 Hz for a while afterward, which you saw in the figure. And it hides the problem. A trace with a large 60 Hz component that has been notched out still has a saturated amplifier, a bad electrode, or a ground loop behind it, and you have stopped being able to see the symptom.

Fix hum at the source. Use the notch last, if at all, and know that you did.

The list, in order

  1. Batteries, and unplug the laptop. Removes the conductive path to the mains ground. Fixes most of it, most of the time.
  2. The DRL electrode, with fresh paste. Actively cancels the common-mode voltage. Another 30 to 40 dB.
  3. Fresh paste on every electrode; check for a half-lifted cup. Equalizes impedances so common mode does not become differential.
  4. Short leads, run together, twisted if possible. Shrinks the loop area for magnetic pickup and keeps capacitive pickup equal on both leads.
  5. Distance. Move a metre from the power strip, the fluorescent light, the monitor’s power brick. Coupling falls off fast with distance.
  6. Bypass capacitors at every chip and a low-pass before the ADC. Keeps the amplifier from also picking up radio and from aliasing 60 Hz harmonics.
  7. Shielded cable, shield to ground at the amplifier end only. For when the above is not enough, usually because the leads are long.
  8. A notch filter, in software, after the fact, labelled as such.
Deep dive Why 60 Hz and not something else, and what the harmonics are 3 min

North American mains is 60 Hz; most of the rest of the world is 50. Anything nonlinear, such as a switching power supply, a dimmer, or an LED driver, distorts the sine and produces harmonics at 120, 180, 240 Hz and beyond. Switching supplies also produce their own frequencies, from tens of kilohertz up. Those are above your low-pass, but if there is no anti-alias filter before the ADC, they alias down into the EEG band as something that is not 60 Hz and is very hard to identify. That is the low-pass’s other job.

Deep dive Ground loops 3 min

Two pieces of equipment, each with its own path to ground, connected to each other by a cable, form a loop. Any changing magnetic field through the loop, or any difference between the two ground potentials, drives a current around it, and that current flows through the cable’s ground wire and becomes a voltage on your signal. The classic case is an amplifier grounded to a scope and a laptop that are plugged into different outlets. The cure is one ground, one path, which batteries give you for free.

Recall
By what physical mechanism does 60 Hz mainly get into your body?
Capacitive coupling: wall wiring at 120 V AC and your body form a capacitor of a few picofarads through the air, passing a small current that your body's impedance turns into millivolts of common-mode voltage.
Recall
Give three reasons a notch filter is the wrong first response to hum.
It removes real signal near 60 Hz (bad for EMG and spikes); it rings after sharp events like blinks; and it hides a problem (bad electrode, ground loop, saturation) that should be fixed at the source.
Recall
What are the first two items on the hum-fixing list?
Batteries with the laptop unplugged (no conductive path to mains ground), then a DRL electrode with fresh paste.
Explain it to your roommate

Explain what this page was about to your roommate in three sentences. No jargon they would not know.