Week 3(c) and Week 4(a): Arduino Biodata Sonification device setup and Python transmission Bioelectrical MIDI note into audio

1. Prepare the Arduino component

After working through the Arduino circuit diagram and breadboard sketch in Fritzing, I began preparing for the physical installation of the device. Based on the earlier prototyping process, I had already developed a clear understanding of the overall wiring layout and component arrangement, which made this stage more efficient. At this point, I also created a checked component list for the Arduino setup (Table 1). This checklist helped me systematically identify which parts I had already acquired, which ones were still missing, and whether any components might need to be ordered in multiples to account for potential damage during installation. This preparation step ensured a more organised workflow and reduced the risk of delay or malfunction caused by missing or faulty components.

To begin the testing process, I used a 3V battery to check the polarity and function of the LED, confirming that it could light up properly. This ensured that both the LED component and the power connection were functioning as expected. Following the Arduino guide, I then measured each resistor in the circuit using a multimeter to verify that their resistance values matched the required specifications, confirming the feasibility and accuracy of the planned installation ( Fig 1).

However, at this stage, several essential components were still missing, including the 5-pin MIDI connector, 10K potentiometer, wire cables, electrode leads, and lead pads. As a result, I was not yet able to upload or run the Arduino code to test the full system. Further testing and debugging will take place once the remaining components are in place.

CountComponents
1Arduino – Uno
1Breadboard
7Resistor 220 Ohm
1Resistor 100k
1Capacitor 4700pF
147 uF capacitor
10.1uf capacitor
2Red LED
1Green LED
1Blue LED
1White LED
1MIDI 5 pin DIN
1Potentiometer 10k
1555 Timer IC
1Tactile Button switch 
13.5mm Jack
1Electrode Leads 3.5mm jack to dual snap
2Electrode Pad(Snap)
22Jump Wires(black, brown, blue, yellow, red)
Table 1 : Components list table

2. Receiving Missing Components and Hardware Assembly

After receiving the previously missing components, including the 5-pin MIDI connector, 10K potentiometer, wire cables, electrode leads, and lead pads, I was finally able to proceed with both the hardware installation and the Arduino code implementation (Fig 1a). With all required parts now available, I began assembling the Biodata Sonification Arduino Shield. Following the circuit diagram closely (Fig. 1a and 1b), I carefully connected the electrodes, MIDI output, and power supply, making sure each element was correctly positioned and properly wired to match the planned layout (Fig 1b).

2. Starting Arduino Code Implementation

After completing the installation, I proceeded to run the Arduino code to verify the system’s functionality. My prior experience with Arduino during UAL workshops and technical modules provided a strong foundation for this stage. Through previous hands-on sessions, I had already become familiar with the basic setup, wiring procedures, and programming environment, which enabled me to carry out the installation process more efficiently and with greater confidence.

To guide the coding process, I referred to a GitHub tutorial by Samuel Cusumano, which offers a step-by-step explanation of how to use Arduino to collect plant bioelectrical signals and convert them into MIDI data. By following his instructions, I was able to gradually adapt and customise the script to fit the specific hardware setup. Additionally, a series of YouTube tutorials on related projects helped me quickly understand the structure and logic of the code. These resources significantly accelerated my workflow by reducing the time needed to troubleshoot and build the program from scratch. Together, this combination of prior knowledge and accessible online guidance allowed me to transition smoothly from hardware assembly to system testing.

Fig 3: Github Tutorial by Samuel Cusumano

3. Debugging the MIDI Data Output

After completing the Arduino code, I proceeded to connect it to the assembled hardware setup and initiated a series of runtime tests. The Arduino IDE indicated a successful upload, confirming that the code had been compiled and transferred to the board without errors. The onboard LED also briefly blinked, suggesting that the script was running as expected. However, when I opened the Serial Monitor to observe the output data, I encountered a problem: instead of readable data, the monitor displayed a stream of garbled text and unintelligible characters (Fig. 4).

Fig 4: Encounter the unreadable character from the Arduino Output
Fig 4b: Encounter the unreadable character from the Arduino Output

To debug the issue, I first checked whether there were any configuration errors in the code that might have caused the unreadable output. I carefully reviewed the serial communication settings and found that the baud rate was set incorrectly. By default, the Arduino Serial Monitor was set to 9600 baud, but to properly encode real-time plant bioelectrical signals into MIDI, I needed to use the standard MIDI baud rate of 31250. This mismatch was likely causing the garbled output in the console.

After updating the baud rate to 31250, I then examined the midiSerial function, which was responsible for converting bioelectrical data into MIDI messages. The code used the following lines to send MIDI data (Fig 5):

  • Serial.write(statusByte);
  • Serial.write(data1);
  • Serial.write(data2);

While this method correctly sends MIDI signals to external devices, it does not format the data in a human-readable way for the Serial Monitor. Since I wanted to verify the MIDI note output in real time, I modified these lines to use Serial.print() instead (Fig 6). This allowed me to view the MIDI note values directly in the console, ensuring that the plant’s bioelectrical activity was successfully converted into MIDI signals.

After these adjustments, the real-time plant bioelectrical signal was finally displayed correctly as MIDI note values, confirming that both the data acquisition and conversion processes were working as expected(Fig 7a, 7b).

Fig 7b: Received the correct data output

4. Searching for a MIDI Synthesis Solution

After successfully collecting the plant bioelectrical signals and converting them into MIDI note values, I encountered a new challenge, which is most MIDI synthesis tools available online were unable to fully interpret the MIDI note data in real time. Additionally, many of these tools required external MIDI-compatible hardware for sound playback, which made direct testing difficult.

To find a workaround, I began searching for a software-based solution and came across Hairless MIDI, a tool designed to bridge serial MIDI data from Arduino to virtual synthesizers. However, I soon discovered that Hairless MIDI only runs on older macOS versions (10.x), making it incompatible with my system. After multiple attempts to find a working version or an alternative software bridge, I decided to explore a different approach.

Through further research, I found that Python could be used to convert MIDI data into actual sound output. This led me to experiment with Python-based real-time MIDI processing, where I first attempted to read the live data from the Arduino Serial Monitor using Python. My goal was to verify whether the data could be successfully captured in real time and later processed into audible MIDI notes.

5. Establishing Python MIDI Processing

To begin the real-time MIDI processing with Python, I first needed to establish a connection between Arduino and Python. For this, I used PySerial, a Python library that enables serial communication with external devices. My initial step was to write a simple script to open the Arduino’s serial port, read incoming MIDI note data, and print it to verify that the transmission was working correctly(Fig 8).

6. Implementing Real-Time MIDI Sound Synthesis

After completing the tests, I confirmed that the MIDI data was successfully transmitted to Python in real time. With the Arduino sending plant bioelectrical signals as MIDI notes and python-rtmidi handling the MIDI input, I was now ready to move on to the final step of real-time sound synthesis.

To achieve this, I used FluidSynth, a powerful software synthesizer that allows MIDI note playback using SoundFont files. I chose FluidR3_GM.sf2, a widely used General MIDI SoundFont, to generate expressive instrument sounds from the incoming plant signals. By integrating FluidSynth with my Python script, I successfully established a full pipeline from signal detection, MIDI conversion, and real-time transmission, to sound synthesis. I could now map the real-time MIDI data from Arduino to synthesized sound output, effectively allowing the plant’s bioelectrical activity to be heard as music.

Fig 8: Installed the library and make real-time sound synthesis
Fig 9: Received the real time plant electrical signal into MIDI sound

Video Outcome of my process

Arduino Biodata Sonification Installation Process

Reflection:

As Morton (2009, pp 132) points out, albums like Songs of the Humpback Whale and Deep Voices played a significant role in the “Save the Whale” movement not because we understood the whales’ language, but because the recordings functioned as a medium that made listeners aware of animals as co-inhabitants of the Earth. Since we can’t decipher what these animals are saying, or even know if they’re saying anything at all, their sounds highlight the medium itself. This opacity becomes part of the environmental quality. Ambient poetics is not about fully decoding the imperceptible, but about making it perceptible while preserving its mystery and indeterminacy.

Following this line of thought, my work translates the bioelectrical signals of plants into sound is not to reproduce some kind of “plant language,” but aim to create a medium through which people can sense the presence and activity of plants. The MIDI sounds generated by these signals are inherently random. This randomness does not aim to simulate or analogize nature, but instead retains its unknowability and the ambient sense of mystery.

Outcome Recording Video

Reference:

Send and Receive MIDI With Arduino – https://www.instructables.com/Send-and-Receive-MIDI-with-Arduino/

MIDI Representationhttps://www.audiolabs-erlangen.de/resources/MIR/FMP/C1/C1S2_MIDI.html

Biodata Sonification Creation Process:https://www.instructables.com/Biodata-Sonification/

Kurundkar, S., Lathiya, D., Kurade, S., Likhitkar, P. and Lokhande, T., 2023, October. Bio-sonification–Converting Microcurrent Fluctuations of Plant Leaves into Sound. In 2023 7th International Conference on I-SMAC (IoT in Social, Mobile, Analytics and Cloud)(I-SMAC) (pp. 831-836). IEEE.

Sam Cusumano – Biodata Sonification kit using breadboard, for Arduino Uno (https://github.com/electricityforprogress/BiodataSonificationBreadboardKit)

Morton, T., 2009. Ecology without nature: Rethinking environmental aesthetics. Harvard University Press.

Playing music from Python via fluidsynth: https://ksvi.mff.cuni.cz/~dingle/2019/prog_1/python_music.html

Leave a Reply

Your email address will not be published. Required fields are marked *

*