Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Arduino Raspberry Pi Python MIDI

📖 Project Overview

This repository contains the resources for a bio-sonification instrument: a system that captures the faint bioelectric signals of a houseplant and converts them into real-time MIDI music. It covers the full signal chain — analog acquisition, an Arduino-based processing stage, and a Raspberry Pi sound engine — from circuit design to a working, headless installation.

Features

  • Analog Front-End: Op-amp based acquisition circuit (CA3140) with low-pass filtering for clean bioelectric signal capture.
  • Arduino Signal Processing: Real-time sampling, digital smoothing, and threshold-based MIDI note/chord generation.
  • Raspberry Pi Sound Engine: Python MIDI bridge feeding a SunVox-based synthesizer for continuous, evolving sound.
  • Autostart Setup: Scripts for a fully headless installation that starts on boot.
test_plante.mp4

🔗 Explore the Full Project

For a detailed walkthrough of the project, including the analog design, signal processing algorithm, and testing results, check out the full article:

Read the Full Article

This article includes:

  • Signal Characterization: Understanding plant bioelectric activity and the noise challenges around it.
  • Circuit Design: The full analog front-end, gain and filter calculations.
  • Firmware Walkthrough: How raw sensor readings become MIDI chords and melody.
  • Results and Testing: Filter performance, noise rejection, and sensor validation.

🚀 Getting Started

Files Included

  1. Arduino:

    • Arduino/code_arduino_2_capteurs: Main firmware — signal acquisition, filtering, and MIDI generation for two sensor channels.
    • Arduino/detect_manu: Standalone test sketch for validating raw sensor readings before running the full system.
  2. Raspberry Pi:

    • RaspberryPi/bio_bridge.py: Python script that bridges Arduino serial MIDI messages to a virtual MIDI port.
    • RaspberryPi/start_bio_instrument.sh: Startup script that launches SunVox and the MIDI bridge.
    • RaspberryPi/bio_instrument.desktop: Autostart entry for headless boot-time launch.
  3. Documentation:

    • Documentation/hardware_list.txt: Full bill of materials.
    • Documentation/setup_guide.txt: Step-by-step installation and configuration guide, including troubleshooting.
    • Documentation/schematics/: Circuit schematics, Arduino pinout, and component datasheets.

How to Use

  1. Download the Files:

  2. Build the Acquisition Circuit:

    • Follow the schematics in Documentation/schematics/ to assemble the analog front-end on a breadboard.
  3. Flash the Arduino:

    • Open Arduino/code_arduino_2_capteurs in the Arduino IDE and upload it to an Arduino Nano (or compatible board).
  4. Set Up the Raspberry Pi:

    • Install SunVox and Python dependencies (pyserial, python-rtmidi), then run RaspberryPi/bio_bridge.py.

🛠️ Installation and Setup

  1. Circuit Assembly:

    • Wire the CA3140-based acquisition stage as shown in the schematics, one channel per plant sensor.
  2. Firmware Upload:

    • Flash the Arduino with the provided sketch and verify sensor readings via the Serial Monitor.
  3. Software Setup:

    • Install SunVox on the Raspberry Pi, configure the virtual MIDI port, and enable autostart using the provided .desktop and .sh files.

🧪 Testing and Validation

  1. Sensor Validation:

    • Verify that contact with a plant produces a measurable, variable signal on the Arduino's Serial Monitor.
  2. Filter Validation:

    • Inject test signals at different frequencies to confirm the low-pass filter rejects mains-frequency noise while preserving the biological signal band.
  3. Full System Test:

    • Confirm MIDI messages reach SunVox and trigger audible notes in response to plant activity.

📝 Documentation and References

  • SunVox: Lightweight modular synthesizer used for sound generation — warmplace.ru/soft/sunvox
  • python-rtmidi: Python MIDI I/O library (MIT license)
  • pyserial: Python serial communication library (BSD-3-Clause license)

🔧 Future Improvements

  • Move from breadboard to a custom PCB.
  • Improve sensor design and long-term contact reliability.
  • Add more simultaneous plant channels for a larger "plant orchestra."
  • Battery-powered, fully portable enclosure.

📫 Contact and Support

For questions or support, please open an issue on this GitHub repository or contact [email protected].

📖 Additional Resources


About

Open-source Arduino + Raspberry Pi system that converts a plant's bioelectric signals into real-time MIDI music

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages