final _ the code — three concepts for chimes + plus a bonus

I chose to work with the headset’s “Meditation” values — the idea of meditation, or relaxation, seemed to fit nicely with wind chimes. I experimented with three different scenarios. Here they are, along with the code.

1) meditation by quintiles.

Meditation values are delivered to the Arduino on a scale of 0-100. There are 6 chimes. I decided to attached EEG to 5 of them, and leave one as the “observer” — a concept I picked up from reading about Mindfullness meditation. So, I divided the meditation values into quintiles and deliverd them to the wind chime via five independent muscle wires (all powered by the same 12V external power supply, but each attached to a separate pin on the UNO and passing through individuals MOSFETs.

FYI Also, using PWM, I drove Meditation (and sometimes Attention) values to an LED as a visual cue that the headset was delivering data.

SEE CODE at bottom of post (1/2)

Here is a basic schematic I have drawn to illustrate the wiring of the wind chime.

2) Bandwave values

One of the most exciting moments for me during this project was the decision to tap into the bandwave values and tie them to the Arduino.

EEG bandwaves (as they relate to the Mindwave headset are as follows:

delta // 0.5 – 2.75Hz

theta // 3.5 – 6.75Hz

lowAlpha // 7.5 – 9.25Hz

highAlpha // 10 – 11.75Hz

lowBeta // 13 – 16.75Hz

highBeta // 18 – 29.75Hz

lowGamma // 31 – 39.75Hz

highGamma // 41 – 49.75Hz

I had to do a little research: basically find the the Neursosky literature that explained how I could access the bandwaves. It didn’t take too long. Inside the original code provided by Neurosky, there is the “case 0x83”. That’s where you access the bandwaves — however, what is the specific code used to do it? I experimented with writing my own, but got only one value output for all of the bands. I looked around. Finally, I discovered a Processing sketch that had accomplished what I wanted to do. So I adapted that code to Arduino – and it worked!

see the code below (2/2).

Here is a pic of the output.

PROBLEM: all that extra work seemed to really slow down the Arduino. I saw lots of chugging going on in the serial monitor – and so I decided not to work with the bandwave data.

3) pwm meditation

Lastly, I drove all of the Meditation data through a single pin, using PWM. So that the higher the M-values, the more current passed through to the muscle wires, causing(in theory) more activity.

OUTCOME:

I experimented with all of these scenarios, hoping that one might actually trigger some chimes. But ultimately, the mechanics of making the wind chime “chime” was the problem. I should have consulted Jim, as he had mentioned to me that he had worked with muscle wire. I had run out of time. But I am very excited about what I did accomplish:

–> I will keep experimenting with EEG, muscle wire and … wind chimes. I am still excited by the project.

4) BONUS!

…earlier on in the project, I used PWM to power an analog meter I found at Active Surplus — this was for kicks. But I thought it could be used to illustrate Attention values that were active during Meditation sessions on the chimes.

–> I was helped by a nice fellow at the Integrated Media wing to figure out how much voltage would power the meter. It turned out that the range for the meter was 0 – 0.3 DC. After consulting with Jim, the first step was to try PWM, and map the headset values to “0 and (0.3/5)*255 = 15”.

I found that I had to go much lower, and map between 0 and 4.

But it worked! (the first time – the next few times the meter only tracked about 1/3 of the entire spectrum?!?)

What became obvious here was that the headset data was being transmitted 1/s. I already knew this, but you really see it with the meter.

I mocked up a new graphic for the meter – a sort of spoofy Design Fiction meter that reads when and what kind of memory is being formed by the headset user.

int readings[numReadings]; // the readings from the analog input
int index = 0; // the index of the current reading
int total = 0; // the running total
int average = 0; // the average
//END analogWrite code

// subtract the last reading:
total= total – readings[index];
// read from the sensor:
readings[index] = analogRead(attention);
// add the reading to the total:
total= total + readings[index];
// advance to the next position in the array:
index = index + 1;

// if we’re at the end of the array…
if (index >= numReadings)
// …wrap around to the beginning:
index = 0;

// calculate the average:
average = total / numReadings;
// send it to the computer as ASCII digits
Serial.println(average);

THIS CODE CONTAINS TWO EXPERIMENTS THAT WORKED OUT WELL:
1) I accessed EEG bandwave data by adapting an existing Processing sketch
2) I powered a $5 analog meter bought at Active Surplus,
using PWM and mapping headset values (0-100) to the meter’s voltage input (0-0.3 volts).

// subtract the last reading:
total= total – readings[index];
// read from the sensor:
readings[index] = analogRead(attention);
// add the reading to the total:
total= total + readings[index];
// advance to the next position in the array:
index = index + 1;

// if we’re at the end of the array…
if (index >= numReadings)
// …wrap around to the beginning:
index = 0;

// calculate the average:
average = total / numReadings;
// send it to the computer as ASCII digits
Serial.println(average);