Project A: The SpikerBox
Hear action potentials from a cockroach leg on a speaker, with an amplifier you built for about twenty dollars. The hello-world of neural engineering.
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.
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 gain 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 potentialThe brief, all-or-nothing voltage spike a neuron fires, about a millisecond long and about 100 millivolts tall across its membrane. Glossary entry. Backyard Brains sells this as the SpikerBoxSpikerBoxBackyard Brains' small battery amplifier that lets you hear action potentials from a cockroach leg on a speaker; easy to build yourself. 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 spikes.
- Press Touch the leg. The burst is what mechanoreceptors do.
- Raise the noise until you can no longer pick out spikes by eye. That is the noise floor 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 spikes 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 gain in the thousands before a speaker can do anything with it.
Parts
| Part | Where | Qty | Approx. |
|---|---|---|---|
| 9 V batteries and snap connectors, ×4 Two batteries give you a ±9 V split supply. Never power anything touching skin from the wall or from a laptop USB port. | Any store | 1 | $10 |
| Alligator clip leads | Amazon | 1 | $6 |
| Digital multimeter You will use this more than any other tool. Auto-ranging saves time. | Amazon, Harbor Freight, Micro Center | 1 | $25 |
| Flush cutters, wire strippers, tweezers | Amazon | 1 | $15 |
| Full-size breadboard, ×2, and jumper wires | Adafruit, Amazon | 1 | $12 |
| INA128 instrumentation amplifier (DIP-8), ×2 The AD620 or INA118 are interchangeable for our purposes. Get the through-hole DIP version for breadboards. | Digi-Key, Mouser | 2 | $18 |
| LM386 audio amplifier Drives a small speaker so you can hear spikes. | Digi-Key, Mouser, Amazon | 1 | $2 |
| Pinecil soldering iron (USB-C powered) and a spool of solder Or any temperature-controlled iron. Lead-free solder is fine; get flux. | Pine64 store | 1 | $35 |
| Resistor and capacitor assortment 1% metal-film resistors matter for the instrumentation amplifier's balance. Include 0.1 µF ceramics and a few 1 to 10 µF film or ceramic caps. | Amazon, Adafruit | 1 | $15 |
| 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, Amazon | 1 | $3 |
| TL072 or OPA2134 dual op-amps, ×4 For filters, the DRL circuit, and the audio stage of the SpikerBox. | Digi-Key, Mouser | 1 | $4 |
| Total (prices drift; treat as a ceiling) | $147 | ||
The circuit
Four stages, left to right. Every neural recording system you will ever meet has the same four.
- Instrumentation amplifier. An INA128 with a 500 Ω gain resistor gives a gain 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 filter. A high-pass at about 300 Hz (0.1 µF into 4.7 kΩ) removes the slow drift and the 60 Hz hum; spikes are fast, so you lose nothing. A low-pass at about 5 kHz (3.3 kΩ into 10 nF) removes hiss above where spikes live.
- Second gain stage. A TL072 as a non-inverting amplifier with gain 10 (1 kΩ to ground, 9.1 kΩ feedback). Total gain now about 1000.
- Audio amplifier. An LM386 with its default gain of 20, through a 10 kΩ volume pot, into the speaker. The LM386 will clip on big spikes. 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 notch. 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 gain 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 potential when you touch a trigger hair. It is about 100 millivolts and lasts a second or two, so the filter 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 spikes 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 electrodes. That is Project C.
What to read now
What was that sound? explains the action potential 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 gain did.