Biodata Sonification

29K50192

Intro: Biodata Sonification

Generate MIDI notes based on changes in Galvanic Conductance across two probes.

For the latest code version and updated tutorials please go to electricityforprogress.com and checkout my github project https://github.com/electricityforprogress/BiodataSonificationBreadboardKit

STEP 1: Solderless Breadboard

A key tool in electronics experimentation is the Soldless Breadboard. Allowing users to connect components together and reconfigure easily, the Breadboard lets newcomers to electronics and seasoned engineers to prototype designs and connect electronic systems easily.

Breadboards have a series of holes which are electrically connected. Horizontal rows run across the Breadboard in Terminal Strips of 5 connected points points and are marked with the letters abcde and fghij. A large divide down the middle of the breadboard separates the horizontal rows, this facilitates the use of Dual Inline Package (DIP) microchips. On the sides of the breadboard are vertical columns of holes, usually marked with Red and Blue lines. These vertical columns are used most often for power connections (positive voltage and ground), and are called a 'Bus'. We will be attaching all of our Positive and Ground connections to these Buses on each side of the breadboard. In a later step we will tie together the Grounds and the Positive Buses on each side of the breadboard.

In order to 'connect' two electronic components, we simply place the leads (or 'legs') of the parts into adjacent horizontal holes. This allows a user to connect multiple components together using each horizontal row of 5 points.

STEP 2: Insert 555 Timer

The 555 timer is an 8 pin DIP microchip, which we will configure as an astable multivibrator capable of measuring electrical conductivity. Orient the chip so that Pin 1 is at the top - you will see a small circle near pin 1 on the chip, also see the diagram which identifies each of the pins on the 555 Timer.

Place the 555 timer at the bottom of the Breadboard. The breadboard is arranged with a gap down the middle, the microchip should span across this gap. The rows of the breadboard are numbered, we will be inserting the 555 timer in rows 27, 28, 29, and 30, with pin 1 in row 27.

STEP 3: Pin 1 to Ground

Attaching the 555 Pin 1 to Ground, add a jumper wire from row 27 column A to the Ground Bus.

STEP 4: Timing Capacitor C1

Connect the timing Capacitor C1 (0.0042uF) between Pin 1 and Pin 2 of the 555 Timer. Insert the tiny blue capacitor into rows 27 and 28 in column B.

This capacitor sets the overall frequency range of the timer, here we use a very small value in order to get the highest resolution of pulses out of the 555 as we measure fluctuations in electric capacitance across the two probes.

STEP 5: Decoupling Capacitor C2

Connect the high frequency decoupling capacitor C2 (1uF) across the 555 Timer's positive and ground, pins 1 and 8 in row 27, column D and G.

It can be helpful to trim the legs of the capacitor, for a better fit on the breadboard, but be careful to leave enough space for the legs to span the microchip and fully connect with the breadboard sockets.

STEP 6: Decoupling Electrolytic Capacitor C3

Connect the low frequency decoupling Electrolytic Capacitor C3 (41uF) across the 555 Timer's positive and ground, pins 1 and 8 in row 27, column C and H.

Note that Electrolytic capacitors are polarized, identifying the negative end with a white stripe down the side of the cap; ensure that the negative side of the capacitor goes to Pin 1 (Ground) column C and the positive side of the capacitor goes to Pin 8 (Positive) column H.

STEP 7: LED Output

Add the Red LED to the output pin 3 of the 555 Timer Row 29 pin A and across to the Ground Bus. Place the longer lead of the LED (anode) in Row 29 Column A, with the shorter leg of the LED in one of the Ground Bus holes.

**- LEDs are polarized and must be inserted in the correct orientation. The LED's Cathode leg (negative) can be identified by a flattened edge on the side of the LED, and the positive Anode can be identified by the longer leg. LED's polarity and color can be identified using a simple button battery, by sliding the battery in between the LED leads, you will either see the LED glow or not, try turning the battery the other direction. The LED will illuminate when the battery + (wide flat) end is connected to the Anode (longer leg) and the battery - (smaller button) is connected to the Cathode Ground leg. Grab a CR2032 3v button battery and try it out!

After you get everything working in the last step, you can come back and trim the legs of the LED if desired.

NOTICE: under all normal circumstances, a resistor would be added between the output pin and the LED. In order to simplify the build of this kit, the current limiting resistors have been omitted. We have included resistors for each LED in the kit. Modified instructions including current limiting resistors will be provided as an appendix.

STEP 8: Jumper 555 Trigger to Threshold

Connect a Jumper wire between Pin 2 and Pin 6 of the 555 Timer Row 28 column D to Row 29 Column G.

This attaches the threshold and the trigger pins of the 555 timer, which form the input connection for the primary electrode.

STEP 9: Jumper 555 Reset to V+

Connect Pin 4 of the 555 Timer to the Positive Bus using a Jumper wire Row 30 Column D to the Positive Bus

Connect Pin 8 of the 555 Timer to the Positive Bus using a Jumper wire Row 27 Column I to the Positive Bus

(add image and step for 555 VCC to V+)

STEP 10: Resistor R1 100K 555 Discharge to Positive Bus

Connect Resistor R1 (100k) between Pin 7 of the 555 and the Positive Bus. Place one side of the Resistor in Row 28 Column J and the other side of the resistor to the Positive Bus.

STEP 11: Probe Input Jack

The Probe input is an 3.5mm mono jack, which connects to the breadboard through two soldered pins. While its a tight spot, the header pins soldered to the jack will fit into Row 28 and 29 Column H.

The header pins have been added to the jacks to make it easier for the user to build the kit. Please note that excess stress on the jack or pins may cause damage to the solder connection. If your kit does not have the header pins soldered to the jack, please see the appendix for soldering instructions for the jack and header.

STEP 12: Positive Bus Jumper

Connect the Positive Bus on both sides of the breadboard by inserting a Jumper wire between the top highest points on the left and right (red) Power Bus.

STEP 13: Ground Bus Jumper

Connect the Ground Bus on both sides of the breadboard by inserting a Jumper wire between the top highest points on the left and right (blue) Ground Bus.

STEP 14: Testing the Galvanometer

Now we are ready to hookup some batteries and test the Galvanometer we just built from the 555 Timer.

Insert 3 AA batteries into the black Battery box, ensure the power switch on the box is in the 'OFF' position. Attach the Battery box Red wire to the Breadboard Positive (red) Bus, attach the Battery box Black wire to the Breadboard Ground (blue) Bus. Now slide the power switch on the battery box to 'ON'. The LED should be illuminated, showing the 555 timer is powered on.

Attach the white electrode leads (don't bother using the sticky pads yet) to the 3.5mm jack connecting to the Galvanometer. By touching the metal button ends of the electrodes with your fingers, you will be able to see the LED flash based on changes in conductivity. Touching the electrodes very lightly can show the LED flash on and off slowly, by squeezing the electrodes really hard the LED flashes very fast, appearing like the LED remains lit or slightly dims.

STEP 15: Insert ATMEGA328 28pin DIP

Your MIDIsprout Kit comes with a preprogramed ATMEGA328 micro controller, with fuses set to runn at 8Mhz on the internal oscillator (Fuses: Low-E2 High-D9 Ext-FF) , and preloaded with the MIDIsprout firmware. This 28 pin DIP has two parallel rows of 14 pins.

Insert the 328p chip at the top of the breadboard, identifying Pin 1 by the small circle on the chip, into Rows 1 - 14 spanning the DIP across the gap in Columns E and F.

**To easily reprogram and experiment, it is possible to add a 16Mhz oscillator on pins 9 and 10 of the breadboard, and program using an arduino Uno board with modifications of the MIDIsprout code. The ATMEGA328 can also be reprogrammed through ICSP with an external programmer (other arduino) and a maze of Jumper wires ;)

**Also as an addendum, MIDIsprout Kit can be built using the previous steps to assemble the Galvanometer, with the breadboard attached directly to an Arduino Uno! Stay tuned...

For reference, the code preloaded into the current version MIDIsprout :

Arduino Code:

STEP 16: Power the ATMEGA328

Attach the VCC pin on the 328 to the Positive Bus using a Jumper between Row 7 Column A and the Positive Bus.

STEP 17: Ground the ATMEGA328

Attach the Ground pin on the 328 to the Ground Bus using a Jumper between Row 8 Column B and the Ground Bus.

STEP 18: Power the ATMEGA328 (analog)

Attach the analog Voltage pin on the 328 to the Positive Bus using a Jumper between Row 9 Column J and the Positive Bus.

STEP 19: Ground the ATMEGA328 (analog)

Attach the Ground pin on the 328 to the Ground Bus using a Jumper between Row 7 Column J and the Ground Bus.

STEP 20: 555 Timer Output to ATMEGA328 Input

Connect the output pin from the 555 Timer to the Input Pin 4 on the 328 with a Jumper wire between 555 Timer pin 3 Row 29 Column D and Row 4 Column D.

Here the digital output of the 555 triggers an interrupt pin on the 328, INT0, which measures and compares pulse durations.

STEP 21: Knob

The included knob should be prepared by gently bending its three legs (bend all three at the same time) so the knob can stand vertically. Insert the Knob onto the left side of the breadboard in Column A Rows 19, 20, and 21.`

STEP 22: Knob Wiper to ATMEGA328 Analog Input

Connect the center pin of the Knob to the Analog Input (A0) of the 328 using a Jumper wire. Attach a jumper between the Knob Row 20 Column E and 328 (A0 pin) Row 6 Column G.

STEP 23: MIDI Jack

Insert the MIDI Jack into the breadboard. Prepare the jack by identifying the two pointed mounting pins located at the front of the MIDI jack and bending them upward to point out the front of the MIDI jack. Place the MIDI jack on the right side of the breadboard, with the jack facing the right side. Insert the MIDI jack into Column I and J, Rows 18, 19, 21, 23, and 24. The five MIDI jack pins will fit (snuggly) into the breadboard, be careful not to push too hard.

STEP 24: MIDI Data Pin to ATMEGA328 Tx

Connect the MIDI Data output pin to the ATMEGA328 serial Transmit (Tx) pin, by attaching a jumper between Column F Row 23 (MIDI Data pin 5) and Column B Row 3 (328 Tx).

STEP 25: MIDI Power Resistor to V+

Connect a resistor between the MIDI power pin (4) and V+ using a 220 Ohm resistor connected to Column H Row 19 (MIDI power) and the Positive Bus on the right side of the board.

STEP 26: MIDI Ground Jumper

Connect the MIDI Ground pin to the Ground bus using a Jumper wire between Column F Row 21 (MIDI Ground) and the Ground Bus.

STEP 27: Knob Positive Voltage

Connect the Knob positive voltage pin to the Positive Bus using a jumper between Column D Row 19 and the Positive Bus.

STEP 28: Knob Ground

Connect the Knob Ground pin to the Ground Bus using a jumper between Column D Row 21 and the Ground Bus.

STEP 29: LEDs (red)

There are 5 colored LEDs in the MIDIsprout which provide a light show and indication of the state of the MIDI notes being played.

Connect the LED (red) Anode - long leg to Column A Row 5 and the LED Cathode to the Ground Bus.

**- For simplicity, we are omitting current limiting resistors in this build, please see the appendix for steps to include resistors with the LEDs.

STEP 30: LEDs (yellow)

Connect the LED (yellow) Anode - long leg to Column A Row 11Connect the LED (red) Anode - long leg to Column A Row 5 and the LED Cathode to the Ground Bus.and the LED Cathode to the Ground Bus.

STEP 31: LEDs (green)

Connect the LED (green) Anode - long leg to Column A Row 12 and the LED Cathode to the Ground Bus.

STEP 32: LEDs (blue)

Connect the LED (blue) Anode - long leg to Column J Row 14 and the LED Cathode to the Ground Bus.

STEP 33: LEDs (white)

Connect the LED (white) Anode - long leg to Column J Row 13 and the LED Cathode to the Ground Bus.

STEP 34: 16MHz Crystal Oscillator PlaceHolder

The 16MHz crystal oscillator should be added on pins 9 and 10 of the ATMEGA328 Row 9 and 10 Column C. The part is not polarized and the crystal can be inserted into pins 9 and 10 in either orientation.

STEP 35: Battery Pack

Attach the battery pack to the breadboard by placing the battery pack Red wire into the breadboard Positive Voltage Bus and the Back wire into the breadboard Ground Bus. Insert 3 AA batteries and switch on the battery box. With the power on the LED by the 555 Galvanometer should illuminate.

Connect the electrode leads to the jack at the bottom of the breadboard, and touch the two button ends of the leads. The Galvanometer LED should flash in response to the conductivity across your fingers.

STEP 36: Biodata Sonification

When the electrode leads are touched or attached using gel pads, the MIDIspout program will detect small changes in conductivity and represent these changes as MIDI notes and colorful lights!

Connecting a MIDI cable from the MIDI jack on the bread board, the MIDIsprout Kit can be attached to synthesizers, keyboards, sound generators, and computers supporting MIDI to produce sounds in reaction to the MIDI notes.

By turning the knob, the Threshold/Sensitivity of the MIDIsprout can be adjusted. By decreasing the threshold, smaller fluctuations in conductance from the galvanometer can be detected; by increasing the threshold, larger changes are required in order to produce notes. During long term installations, I use a low threshold setting which produces a pleasant babbling stream of MIDI data. For public interactive events with multiple plants, I turn the threshold up rather high, which results in MIDI notes only being produced when a person gets very close or physically touches the plant.

159 Comments

Hello Samuel and all. I Made it. Amazing. It works. Thing is it keeps reseting and stops working after a few notes. Need help please.

Hi! I assembled the device on an arduino nano, everything works, but for some reason it does not transmit a midi signal to the microkorg (there is 1 channel), the transmission signal flashes on the arduino. What could be the matter?
I have the same issue, but with the Uno. Did this ever get resolved?
Hello, thanks for this great step by step guide. Could you give me a link to where I can buy the Midisprout Kit? Thank you, Eve
hola, tengo chasis midi 5 pines con 1 pin de montaje, sirve? en mi pais no venden chasis midi con 2 pines de montaje y no he logrado hacer este proyecto por eso, te pido que me guies en la compra de ese componente electrico. Otra duda es si el capacitor de 0,001 uf se puede reemplazar por uno de 0,01 uf, esto cambia mucho la exactitud del dato cientifico? muchas gracias
You should be able to use any midi connector, just make sure that the pins for the pull up voltage and the data transmit are correct. The .01uf cap is used to decouple power for high frequencies on the 555 timer, you can just exclude it probably. The other resistors and capacitor values are more important because they impact the timing on the 555 timer.
Thank you for this great post. I've done it with success. I'm trying to downsize it. Would it work with arduino nano instead of arduino UNO. Tanks!
Oh yeah, it would be very easy to either remap the pins in the code or connect almost any arduino. One thing to remember, this circuit is based on a 5v power supply, if you use a 3.3v microcontroller you will need to change the 100k resistor to a 3.9k. I have a new version which uses an Adafruit Feather ESP32 board providing Bluetooth or Wifi or serial MIDI, any Feather could easily work. If you port to a proMicro you can also use USB MIDI with just a couple code tweaks. checkout my main webpage and github: electricityforprogress.com
Thank you for your feedback! I've done the arduino nano thing and something is not working :( When I turn it on, the red led lights up and de other LEDs do their work too but when I touch the electrodes the red LED turns off and the other LEDs don't light up. I've changed the 555 chip, the jack connector, and with external 5v power with no success. When I have response I get "+5.615 - Serial In: Ch 1: Note 0 off velocity 0"
Okay great. You will need to put some thought into what pins should be mapped, and share more details about your hardware and code setup. Perhaps make a branch of the code in github as you port to the new board.

Look at the pinout of your nano focusing on the function (not number) of the pins. Each of the LEDs needs a PWM pin for fading, the 555 Timer Biodata output needs to go into an interrupt pin, and of course the potentiometer needs an analog input.

You will need to then update the code to match the pins on your nano.

This will give you great experience with working across boards, the tasks are not trivial if you are new to coding, but you should write down each of your pin mappings and find the pin definition to update in the code.


Thank you very much for your response. I've been trying with a correct mapping (I think) but with no success. First I was using a wrong resistor hahahahaha but after that it worked like a charm with Arduino Uno. Then I changed to Arduino Nano again using the correct pins: Arduino Nano port D2 which is INT0 and Pin 1 which is TXD. Te rest is the same, pins 3, 5, 6, 9 an 10 for LEDs, A0 for potentiometer and A1 for button, 5V pin and ground pin. Usin the "same" pins as Arduino UNO, I assumed no change in code was needed. Thanks again!
hmm your mapping looks good. what part 'isnt working'? Does the light show light up on boot? What shows in Serial Monitor?

Yes, the light show light up on boot and the red "power" LED stays on but when I connect the electrodes and touch them, nothing happens, not even shut down. When I looked for serial info I got nothing :(
Okay, you should test the biodata circuit with the 555 timer first, make sure that is working. When you touch the electrodes the red led on pin 3 of the 555 should begin to flash, squeeze the electrodes hard and the led should flash reallyreallyreally fast.

I recommend removing everything from the breadboard and only build the 555 timer circuit with power from the Nano.

If you are getting the main LED light show on boot up then most of the code is working!
Hello I am a beginner, when compiling the program encountered such feedback, I am a little bit not quite know where the error, can you help me answer
You should review the other comments on this thread. You will need to install the libraries which are listed at the top of the Arduino sketch (EEPROM, LEDFader,Bounce2) If you are new to Arduino you should start with some intro arduino examples and just get some LEDs flashing on a breadboard. The LEDFader Library has some good examples, and Bounce2 is used for the button de-bouncing.
Thank you for your reply. I have solved the previous problem, but then we encountered a new problem: at present, all the LEDs are working normally, and the red LED of 555 also responds, but when I connect to midisprout, I didn't enter it, and the practical midiox can't see the letter. No. I don't know what went wrong at that time. I'll give you a detailed picture. Please help me answer it. I don't know if it's a problem with the midi connecter. Of course, I don't know if it is feasible to directly link to the midisprout APP of iOS.
You have a couple problems based on your photos. 1.) The USB/MIDI Device will not likely work, it appears to be an inexpensive red cable, you need to use a good brand name USB MIDI device. I use the EMU xMIDI, other users have Roland UM1, there are many which will function correctly available. If the USB-MIDI costs less than $20 it will not likely function for MIDI input. 2.) You should use a different MIDI app in iOS, the old MIDIsprout app makes pretty sounds but the biodata device will work with any MIDI synthesizer application. I recommend Animoog. 3. You should not need MIDI Ox unless you are trying to utilize a windows synthesizer application.

At this point your only issue is trying to get a good MIDI-USB cable and using some synthesizer apps.
Hello,
I am doing a university project where I will be building a device similar to this. I would love to pick your brain about this topic, so apologies if this is a little long.
My project is focused on the signalling behaviour of mushrooms. Experiments by Adam Adamatzy (On spiking behaviour of oyster fungi Pleurotus djamor | Scientific Reports (nature.com)) on this behaviour use a 24 bit high resolution ADC data logger for their measurements.

I was wondering how you thought your 555 timer galvanometer's accuracy and readings would compare? The ATEMEGA328 chip has a 10 bit resolution, I would assume this is the resolution of the system?

Would you assume the data logger also uses a similar process of calculating the conductance between 2 electrodes to measure the signals? It seems they can capture action potential like behaviour with the data logger. Would your system be able to do that? As the action spikes would cause the overall conductance to change?

I am not using a midi approach. I'm instead reading the direct voltage value from some electrodes. This needs to be read into my system as a control parameter. Any advice overall for as to how I should approach this?

Finally, what would a voltage/time graph of the output of your galvanometer look like? this loops back to the accuracy question. The graphs on the linked paper^ are what i am really hoping for but I'd assume in a lower resolution?

Thank you for your time any help will be appreciated :)
More Comments