Skip to main content

Turning a Plant's Electrical Signals Into Music DIY: A Bio-Sonification Build

·1786 words·9 mins
Electronics DIY Projects Bio-Sonification Arduino Raspberry Pi
Bio-Sonification Projects - This article is part of a series.
Part 1: This Article
This project sits at the crossroads of electronics, signal processing and music. If you want to dig deeper into plant electrophysiology before reading on, there’s a good general overview on plant bioelectricity to get you allo started.

Introduction: Giving a Plant a Voice #

Plants are not electrically silent. As living organisms, they react to their environment (light, humidity, temperature, mechanical stimulation) by producing small variations in electrical potential, not unlike the signals found in animal nervous systems. These variations are usually invisible to us, but with the right sensor chain they can be measured, and with a bit of creativity, turned into sound.

The goal of this build was to capture these tiny voltage fluctuations directly from a houseplant and use them to drive a real-time musical instrument: no pre-recorded samples, no manual triggering, just the plant’s own activity shaping an evolving melody. That means solving the problem end-to-end, to acquiring a very weak, very noisy biological signal, cleaning it up, converting it into musical data, and finally turning that data into actual sound.

plant used for the project
The houseplant that ended up wired into the instrument

Step 1: Characterizing the Signal Before Building Anything #

Before picking a single component, it’s worth understanding exactly what needs to be measured. Prior research on plant electrophysiology shows that plants generate low-amplitude potential variations (in the microvolt to millivolt range) with frequencies generally between 0.1 Hz and 40 Hz. Artistic explorations of the same phenomenon already exist: projects like the Damanhur Foundation’s “music of plants” or the commercial PlantWave sensor both translate this bioelectric activity into audible sound, which confirmed the idea was technically sound before committing to a full build.

That characterization immediately surfaces the central challenge, mains electrical noise. Household wiring radiates strongly at 50 Hz, sitting right at the edge of the useful signal band and completely dwarfing it in amplitude. Any acquisition chain has to solve three problems simultaneously:

  1. Amplification : the raw signal is far too small for a microcontroller’s ADC to resolve on its own.
  2. Low-pass filtering : frequencies above roughly 40–50 Hz need to be suppressed to keep mains hum and other electromagnetic noise out of the measurement.
  3. High input impedance : the sensor must draw negligible current from the plant, or it will disturb the very signal it’s trying to measure.

Step 2: System Architecture #

With those constraints defined, the system was split into three functional blocks:

  • Acquisition — electrodes and analog front-end that turn the plant’s potential variations into a clean, amplified signal.
  • Processing & conversion — a microcontroller that samples the analog signal, filters it digitally, and converts meaningful variations into MIDI messages.
  • Sound generation — a small computer that receives the MIDI stream and renders it as audio through a software synthesizer.
FunctionChoiceWhy
SensorCopper wire + cotton pad soaked in waterReliable electrical contact with the plant, cheap and non-invasive
AmplificationCA3140 op-ampVery high input impedance, fast slew rate, runs on the same 5V rail as the microcontroller
FilteringPassive RC low-pass, ~48 Hz cutoffMatches the 10–40 Hz useful band while rejecting 50 Hz mains noise
Acquisition & processingArduino NanoSimple, 10-bit ADC, multiple analog inputs, well documented
Link to computerSerial over USBSimple, sufficient bandwidth for MIDI-sized messages
Sound synthesisRaspberry Pi + SunVoxCompact, powerful enough for real-time mixing, SunVox is lightweight and free
Audio outRaspberry Pi headphone jackStandard, drives a small speaker directly

Step 3: The Analog Front-End #

The acquisition electronics are the part where most of the signal quality is won or lost. Each channel uses a CA3140 operational amplifier wired in a non-inverting configuration to minimize loading on the input signal.

circuit schematic
Two-channel acquisition circuit, designed in KiCad

A few design choices are worth calling out:

  • The gain resistors were sized to give a voltage gain of roughly 1001 (1 + R2/R1 = 100kΩ/100Ω + 1), turning a 100 µV input into a 100 mV output that the Arduino’s ADC can resolve comfortably.
  • Small compensation capacitors across the feedback resistors limit high-frequency noise from the op-amp itself and keep the stage stable.
  • An RC low-pass filter ahead of each amplifier sets the cutoff frequency at about 48 Hz, right where the useful biological band ends.
  • Bias resistors tie the non-inverting input to a defined reference instead of letting it float, which would otherwise make the reading drift unpredictably.

Two identical channels were built on a single breadboard so the instrument could eventually run more than one plant like an orchestra, each one contributing its own voice.

full acquisition system wired to the Raspberry Pi
The breadboard, Arduino Nano, and Raspberry Pi enclosure

Step 4: From Voltage to MIDI — Signal Processing on the Arduino #

Once the analog signal is clean, it still needs to become music. That conversion happens entirely on the Arduino, in three stages.

Sampling : The two analog channels are read at 100 Hz, comfortably above the 40 Hz upper bound of the biological signal.

Digital smoothing : A simple first-order exponential filter smooths out the remaining jitter without lagging the underlying trend:

f[n] = α · x[n] + (1 − α) · f[n − 1]

where x[n] is the raw sample, f[n] is the filtered output, and α is a small smoothing coefficient (0.12 in this build).

Threshold-based note generation : When the smoothed signal crosses a defined threshold and enough time has passed since the last note, the corresponding channel triggers a musical event:

  • Channel 1 → chords : A three-note chord is picked from a small predefined table. Every trigger has a chance of randomly moving to a different chord, keeping the harmonic backdrop from feeling static.
  • Channel 2 → melody : A single note is picked from whichever chord is currently active, transposed up an octave, with its velocity mapped directly to signal intensity. A louder, more energetic plant activity produces a more forceful note.

Two independent cooldown timers (roughly 800 ms for chords, 500 ms for melody notes) prevent the output from turning into an unlistenable stream of overlapping notes, which was one of the first failure modes encountered during testing.

Step 5: Bridging MIDI to Sound #

The Arduino only speaks serial, not MIDI-over-USB, so a small Python script running on the Raspberry Pi bridges the two: it reads 3-byte MIDI messages off the serial port and re-emits them on a virtual MIDI port using python-rtmidi. Once that bridge is running and a plant is touched, the terminal confirms the link:

Système 100% fonctionnel ! Données reçues sur /dev/ttyUSB0

That virtual port is then picked up by SunVox, a lightweight open-source modular synthesizer well suited to running on constrained hardware like a Raspberry Pi. Each MIDI channel from the Arduino is routed to its own instrument inside SunVox (in this build, channel 1 drives a sustained bass/pad texture and channel 2 drives a piano-like voice) and both are mixed down to the Pi’s audio output.

SunVox patch used for sound generation
The SunVox module graph: two MIDI-driven voices feeding a shared vibrato/echo/compressor chain before output

To make the whole thing usable without a keyboard or screen, a small autostart script launches SunVox with a saved project, waits for the Arduino’s serial port to appear, and then starts the Python bridge, so the instrument comes alive automatically every time the Raspberry Pi boots.

Step 6: Results and Testing #

Each stage of the chain was validated independently before testing the full system together.

Sensor validation. With no contact, the readout hovers around a low noise floor. Touching a leaf produces a clearly higher and more variable reading, and touching the sensor with a hand (which generates a stronger, higher-frequency bioelectric signal than a plant) pushes the readout noticeably higher still. That confirms the front-end is actually picking up biological activity rather than just noise.

raw plant signal captured through the acquisition chain
Blue: raw sampled signal on a live plant. Red: after digital smoothing

Filter validation. A signal generator and, separately, a length of wire acting as an improvised antenna were used to inject controlled interference into the front-end, with and without the analog filter engaged. A 1 Hz test signal passes through essentially unchanged whether the filter is active or not. A 100 Hz test signal, by contrast, drops from a peak of about 120 to about 40 once the filter is switched in, roughly a threefold reduction. When the “antenna” is used to pick up ambient electromagnetic noise, the unfiltered signal shows clear high-frequency pickup, while the filtered signal flattens out almost completely.

low-pass filter test showing attenuation of out-of-band noise
Same 1 Hz injected signal, filter engaged: the useful band passes through cleanly

System load and stability. The Arduino’s processing loop stays under 20% CPU usage, leaving comfortable headroom on hardware that isn’t exactly powerful to begin with. In a continuous 20-minute run, the full chain (sensing, filtering, MIDI conversion, and sound synthesis) kept running without interruption.

Step 7: Final Assembly and a Couple of Lessons Learned #

With everything validated on the bench, the sensor was moved directly into the plant’s pot for a final test, leaving the electronics sitting among the leaves.

final sensor placement inside the plant’s pot
The finished sensor board, planted alongside its subject

Two issues came up along the way that are worth noting for anyone attempting something similar:

  • Getting a genuinely pleasant sound took several iterations. The very first algorithms produced something closer to noise than music, tuning the chord table, the note-selection logic, and the cooldown timers made the biggest difference.
  • Not every Raspberry Pi behaved the same way. Development started on a Raspberry Pi 3, where the virtual MIDI port and SunVox would not reliably connect to each other. Moving to a Raspberry Pi 4 resolved the issue outright, a good reminder to account for hardware-generation differences when a “software” problem doesn’t have an obvious software cause.

Conclusion #

The finished instrument covers the entire chain from a plant’s raw bioelectric activity to audible sound, with each stage (acquisition, filtering, MIDI conversion, and synthesis) tested and validated on its own before being combined. The result is a genuinely reactive piece: the plant’s own electrical behavior, shaped by its environment and by touch, drives an evolving, ambient soundscape in real time.

There’s plenty of room to keep improving it: more robust sensors, a proper PCB instead of a breadboard, more simultaneous channels for a larger “plant orchestra,” and a battery-powered enclosure to make the whole thing fully portable.

References #



Bio-Sonification Projects - This article is part of a series.
Part 1: This Article