Project A: The SpikerBox
Hear action potentials from a cockroach leg on a speaker, with an amplifier you built for about twenty-five dollars in chips. The hello-world of neural engineering.
On this pageOne afternoon
A cockroach leg, detached and anesthetized, still has live nerves in it for an hour or more. Push two pins into it, connect them to an amplifier with a gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry of a few thousand and a speaker, and you hear the neurons fire: a hiss of background with sharp clicks in it, and a burst of clicks when you brush the leg’s hairs with a toothpick. Each click is one action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. Related: Membrane potentialMembrane potential The voltage across a cell's membrane, about −70 millivolts at rest, set by ion concentrations and which channels are open., Ion channelIon channel A protein pore in the membrane that lets specific ions through, often only when the voltage or a chemical tells it to open., SpikeSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide., Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing.. Glossary entry. Backyard Brains sells this as the SpikerBoxSpikerBox Backyard Brains' small battery amplifier that lets you hear action potentials from a cockroach leg on a speaker; easy to build yourself. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane., Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232.. Glossary entry. You can build it in an afternoon, and building it teaches you the entire signal chain of neural recording in its simplest form.
- Listen for a few seconds with the baseline rate low. The clicks are single spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry.
- Press Touch the leg. The burst is what mechanoreceptors do.
- Raise the noise until you can no longer pick out spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry by eye. That is the noise floorNoise floor What your instrument records when the input is shorted or connected to a perfectly quiet source; everything smaller than this is invisible to you. Related: Thermal (Johnson) noiseThermal (Johnson) noise The random voltage every resistor produces just by being warm; about 13 nanovolts per root hertz for 10 kilohms, which matters at microvolt levels. , CharacterizationCharacterization Measuring what your instrument actually does, such as its noise floor, bandwidth, and rejection, instead of assuming the datasheet. . Glossary entry problem, which Phase 2 is about.
Roughly how big is a spike as seen by a pin near the nerve, compared to the voltage across a AA battery?
About ten thousand times smaller. Extracellular spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry are typically 50 to 500 microvolts; a AA battery is 1.5 volts, or 1,500,000 microvolts. That is why the amplifier needs a gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry in the thousands before a speaker can do anything with it.
Parts
| Part | Where | Qty | Approx. |
|---|---|---|---|
| 9 V batteries, ×4, and snap connectors $9.69 for four Energizer cells plus $3.59 for three snap connectors (Amazon B0CR8RKQ5Q). Two batteries give you a ±9 V split supply. Never power anything touching skin from the wall or from a laptop USB port. | Amazon, any store | 1 | $13 |
| Alligator clip leads, ×10 | Amazon | 1 | $5 |
| Auto-ranging digital multimeter You will use this more than any other tool, so buy an auto-ranging one; the $17 TM-510 is auto-ranging. Below that price you get manual ranging, which wastes time. A true-RMS meter is about $35 and you will not need it this year. | Amazon | 1 | $17 |
| Flush cutters, wire strippers, tweezers $7.99 for the stripper and flush cutter, plus $5.99 for a three-piece ESD tweezer set (Amazon B0BNNGC3Q2). | Amazon | 1 | $14 |
| Full-size breadboard, ×2, and jumper wires Two 830-point boards, two 400-point boards, and 120 jumpers for $7.99. Adafruit's single premium board is $5.95 and its contacts grip better. | Amazon | 1 | $8 |
| INA128 instrumentation amplifier (DIP-8), ×2 A two-pack is $9.99. TI's own INA128P is $18.99 each and the part is on a discontinuance notice, so the marketplace two-packs are grey stock; they work, but if one is noisier than the datasheet that is why. The AD620 or INA118 are interchangeable for our purposes. Get the through-hole DIP version for breadboards. | Amazon | 2 | $10 |
| LM386 audio amplifier, ×10 Drives a small speaker so you can hear spikes. Sold in tens; nobody sells one. | Amazon | 1 | $6 |
| Resistor and capacitor assortment $5.69 for 600 1% metal-film resistors, plus $9.99 for a 480-piece ceramic capacitor kit (10 pF to 10 µF, Amazon B0D2GVNDHY). 1% metal-film matters for the instrumentation amplifier's balance. | Amazon | 1 | $16 |
| Sewing pins or fine steel wire for insect electrodes A pin in the cockroach leg, another as reference. Backyard Brains sells proper ones if you want them. | Any store | 1 | $2 |
| Small 8 Ω speaker Adafruit's breadboard-friendly 8 Ω 0.2 W part is $1.85. Amazon's six-packs are $5.99 if you are not ordering from Adafruit anyway. | Adafruit | 1 | $2 |
| Temperature-adjustable soldering iron kit with solder, stand, and flux $11.99 for the iron, five tips, solder, a stand, and flux, which is everything Phase 1 needs. Its temperature dial is open-loop and its tips wear fast; the Pinecil V2 at $25.99 from Pine64 holds temperature properly and will outlast your degree, and it needs a USB-C PD supply you may already own. | Amazon | 1 | $12 |
| TL072 dual op-amps, ×10 For filters, the DRL circuit, and the audio stage of the SpikerBox. A ten-pack costs the same as two singles. The OPA2134 is quieter if you want to hear the difference. | Amazon | 1 | $6 |
| Total (prices drift; treat as a ceiling) | $111 | ||
The circuit
Four stages, left to right. Every neural recording system you will ever meet has the same four.
- Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. Related: Differential measurementDifferential measurement Measuring the difference between two electrodes rather than one electrode against ground, so anything common to both cancels. , Common-mode rejection ratio (CMRR)Common-mode rejection ratio (CMRR) How much better an amplifier responds to a difference between its inputs than to a signal shared by both, in decibels; 100 dB means 100,000 times. , Input impedanceInput impedance How hard the amplifier's inputs are to push current into; it must be far higher than the electrode impedance or the signal is lost in the divider. . Glossary entry. An INA128 with a 500 Ω gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry resistor gives a gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry of about 100. Its two inputs go to the two pins in the leg through 10 kΩ series resistors. Its reference pin goes to the circuit’s mid-point ground.
- Band-pass filterBand-pass filter A high-pass and a low-pass together, keeping only a band such as 0.5 to 40 Hz. Related: FilterFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. . Glossary entry. A high-pass at about 300 Hz (0.1 µF into 4.7 kΩ) removes the slow drift and the 60 Hz hum; spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry are fast, so you lose nothing. A low-pass at about 5 kHz (3.3 kΩ into 10 nF) removes hiss above where spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry live.
- Second gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry stage. A TL072 as a non-inverting amplifier with gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry 10 (1 kΩ to ground, 9.1 kΩ feedback). Total gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry now about 1000.
- Audio amplifier. An LM386 with its default gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry of 20, through a 10 kΩ volume pot, into the speaker. The LM386 will clip on big spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry. That is fine; clipping is what makes them click.
Power: two 9 V batteries in series. The junction between them is ground. The top is +9 V, the bottom is −9 V. The INA128 and TL072 use all three. The LM386 uses +9 V and ground only.
- Build stage 1 on the breadboard. Check the pinout twice; pin 1 is at the notchNotch filter A very narrow filter that removes one frequency, usually 60 Hz mains hum; it also rings and distorts nearby content, so fix the hum at the source first. Related: FilterFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. , Common-mode signalCommon-mode signal A voltage that appears equally on both inputs of a differential amplifier, such as 60 Hz hum picked up by the whole body. . Glossary entry. Add the two 0.1 µF bypass capacitors at the chip’s supply pins.
- Test stage 1 with a known signal (a phone playing a 1 kHz tone through a 100:1 voltage divider made from 100 kΩ and 1 kΩ gives about 10 mV, which becomes about 1 V at the output).
- Add the high-pass and low-pass, then the TL072 gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry stage. Retest with the tone; it should be louder and cleaner.
- Add the LM386, the pot, and the speaker. With nothing connected to the inputs you should hear a faint hiss, and a loud buzz if you touch an input pin with a finger (you are 60 Hz). If the buzz is enormous, the high-pass is not doing its job; check the capacitor value.
- Put a cockroach in a cup in the freezer for four or five minutes, or on ice. When it stops moving, remove one rear leg at the joint with the body. Put the cockroach back somewhere warm; it will recover.
- Push one pin into the femur (the thick upper segment) and one into the tibia (the thinner lower one). Connect the pins to the two inputs with alligator leads. Turn up the volume.
- Listen. Then brush the spines on the leg with a toothpick. Then blow on it.
- Record a minute of it: the LM386 input (before the speaker) can go through a 10 µF capacitor and a 2 × 1 MΩ divider to 5 V into an Arduino analog pin, and into the Web Serial plotter. Or use the headphone input of a laptop on battery power.
Variants
Plant electrophysiology. A Venus flytrap or a Mimosa fires an action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. Related: Membrane potentialMembrane potential The voltage across a cell's membrane, about −70 millivolts at rest, set by ion concentrations and which channels are open. , Ion channelIon channel A protein pore in the membrane that lets specific ions through, often only when the voltage or a chemical tells it to open. , SpikeSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry when you touch a trigger hair. It is about 100 millivolts and lasts a second or two, so the filterFilter An operation that passes some frequencies and attenuates others; every filter also delays or distorts the timing of what it passes. Related: High-pass filterHigh-pass filter Removes slow drifts and DC offsets, passing everything above a cutoff; set it too high and you erase slow brain activity. , Low-pass filterLow-pass filter Removes fast content above a cutoff; the anti-alias filter is one, and so is the smoothing you apply to a noisy trace. , Notch filterNotch filter A very narrow filter that removes one frequency, usually 60 Hz mains hum; it also rings and distorts nearby content, so fix the hum at the source first. , Phase distortionPhase distortion Different frequencies being delayed by different amounts, which smears and shifts waveforms such as an ERP peak. . Glossary entry has to change: high-pass at 0.05 Hz (or DC-coupled) and low-pass at 10 Hz, and you look at it on the plotter rather than listen. Same amplifier. Deeply strange the first time.
Earthworm. Its giant nerve fibers give large, clean spikesSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. Related: Action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. , Spike sortingSpike sorting Deciding which spikes on an electrode came from which neuron, by clustering their waveform shapes. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry when you touch its head or tail. Anesthetize in 10 percent ethanol for a few minutes, use two pins along the body, and be gentle; it recovers.
Your own muscle. With a 20 Hz high-pass instead of 300 Hz, the same circuit hears your forearm muscles through snap electrodesElectrode The conductor that turns ion currents in tissue into electron currents in a wire; its chemistry and contact quality set the noise you live with. Related: Silver/silver-chloride (Ag/AgCl)Silver/silver-chloride (Ag/AgCl) The standard electrode material for biopotentials, because its chemistry produces a stable, low-noise, low-drift interface with salty gel. , Electrode impedanceElectrode impedance How hard it is to push current through the skin-electrode contact, typically 5 to 50 kilohms with gel and megohms dry, higher at low frequencies. , Half-cell potentialHalf-cell potential The DC voltage that appears wherever a metal meets an electrolyte; two electrodes with different half-cell potentials produce an offset that can swamp the signal. . Glossary entry. That is Project C.
What to read now
What was that sound? explains the action potentialAction potential The brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. Related: Membrane potentialMembrane potential The voltage across a cell's membrane, about −70 millivolts at rest, set by ion concentrations and which channels are open. , Ion channelIon channel A protein pore in the membrane that lets specific ions through, often only when the voltage or a chemical tells it to open. , SpikeSpike Shorthand for an action potential as seen by an electrode, a brief blip about a millisecond wide. , Extracellular recordingExtracellular recording Recording with an electrode near neurons rather than inside one; you see small, fast blips from nearby cells rather than the full membrane swing. . Glossary entry as a story about ions and a leaky bucket, and why the click you heard is a hundred times smaller than the voltage swing inside the cell. Why so small? explains why the amplifier had to be differential and what the gainGain How many times an amplifier multiplies its input; 1000× turns 50 microvolts into 50 millivolts, enough for an ADC to see. Related: Instrumentation amplifierInstrumentation amplifier A precision differential amplifier with very high input impedance and high CMRR, built from three op-amps and sold as a single chip such as the INA128 or AD8232. . Glossary entry did.