↑↓ move↵ open[] previous / next lesson? all shortcuts
Appearance
Theme
Type size
Reading

Focus mode hides the sidebars. Press f to toggle it anywhere.

Keyboard shortcuts
/
Search
[ ]
Previous / next lesson
t
Jump to the table of contents
r
Review queue
f
Focus mode
?
This panel
ProjectOne afternoonAbout $25 in chips, $110 with the bench toolsTier 1

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.

SpineAnalog / mixed-signal hardwareElectrophysiology / wet lab
On this pageOne afternoon
  1. The circuit
  2. Variants
  3. What to read now

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 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 . Backyard Brains sells this as the . You can build it in an afternoon, and building it teaches you the entire signal chain of neural recording in its simplest form.

A simulated extracellular recordingSimulated signal
This interactive needs JavaScript. If you are reading a printout, the caption describes what it shows.
Figure 1. What the speaker plays. Three simulated neurons on one electrode, in noise. Press 'Touch the leg' and the rate jumps, the way it does when you brush the spines on a cockroach's leg. Turn on Listen.
Try this
  1. Listen for a few seconds with the baseline rate low. The clicks are single .
  2. Press Touch the leg. The burst is what mechanoreceptors do.
  3. Raise the noise until you can no longer pick out by eye. That is the problem, which Phase 2 is about.
Predict before you look

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 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 in the thousands before a speaker can do anything with it.

Recording action potentials from cockroach nervesBackyard Brains1:59Open on YouTubeThe real thing, from the people who sell the kit. Listen for the burst when the leg is touched; that is what Figure 1 simulates.

Parts

PartWhereQtyApprox.
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 store1$13
Alligator clip leads, ×10Amazon1$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.
Amazon1$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).
Amazon1$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.
Amazon1$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.
Amazon2$10
LM386 audio amplifier, ×10
Drives a small speaker so you can hear spikes. Sold in tens; nobody sells one.
Amazon1$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.
Amazon1$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 store1$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.
Adafruit1$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.
Amazon1$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.
Amazon1$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.

  1. . An INA128 with a 500 Ω resistor gives a 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.
  2. . A high-pass at about 300 Hz (0.1 µF into 4.7 kΩ) removes the slow drift and the 60 Hz hum; are fast, so you lose nothing. A low-pass at about 5 kHz (3.3 kΩ into 10 nF) removes hiss above where live.
  3. Second stage. A TL072 as a non-inverting amplifier with 10 (1 kΩ to ground, 9.1 kΩ feedback). Total now about 1000.
  4. Audio amplifier. An LM386 with its default of 20, through a 10 kΩ volume pot, into the speaker. The LM386 will clip on big . 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.

The SpikerBox, all four stages
This interactive needs JavaScript. If you are reading a printout, the caption describes what it shows.
Figure 2. The whole SpikerBox. Hover or tap any part for its value and its job; the buttons light up one stage at a time. Build it in the same order: stage 1 alone, test, then add the next.
INA128, TL072, LM386
This interactive needs JavaScript. If you are reading a printout, the caption describes what it shows.
Figure 3. The three chips, top view, notch up. Pin 1 is at the top left, beside the dot. Tap a pin for what it does in this circuit.
  1. Build stage 1 on the breadboard. Check the pinout twice; pin 1 is at the . Add the two 0.1 µF bypass capacitors at the chip’s supply pins.
  2. 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).
  3. Add the high-pass and low-pass, then the TL072 stage. Retest with the tone; it should be louder and cleaner.
  4. 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.
  5. 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.
  6. 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.
  7. Listen. Then brush the spines on the leg with a toothpick. Then blow on it.
  8. 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 when you touch a trigger hair. It is about 100 millivolts and lasts a second or two, so the 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 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 . That is Project C.

What to read now

What was that sound? explains the 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 did.

Recall
What are the four stages of the SpikerBox, in order, and which one does every neural recording system share?
Instrumentation amplifier, band-pass filter, second gain stage, audio (output) amplifier. All four appear in every neural recording system in some form: amplify, filter, amplify, output.
Recall
Why is the SpikerBox high-pass set around 300 Hz, and why must it change for a Venus flytrap?
Spikes are about a millisecond wide, so their energy is above a few hundred hertz, and the high-pass removes drift and 60 Hz without touching them. A plant action potential lasts seconds, so it lives below 10 Hz and a 300 Hz high-pass would erase it.