Franklin's Sex Tech: A Thought-Controlled Vibrator

I’ve moved some of my weird mad-science sex stuff to its own site: Tentacle.love.

The brainwave-controlled vibrator was originally born of an idea to make an even more evil version of the Tormentor. What if, I thought, there was a way to read someone's state of arousal by reading their brainwaves with an EEG device, and then using that information to control a vibrator? And what if the less aroused you were, the faster the vibrator ran...but it ran more and more slowly as you got turned on, and stopped right when you were about to reach orgasm? And then as you calmed down again, it started to run again?

This merited investigation, I thought. The first step was to see if an EEG could be used to get a reading of sexual arousal. "Hey," I said to a bunch of my friends, "wanna have sex under an EEG while I record your brainwaves?"

Naturally, my friend circle being what it is, I soon had more volunteers than I knew what to do with. And so it came to pass that I rented a seedy hotel suite in Seattle, got my hands on a simple EEG setup, and set out to do an experiment.

I'd been introduced to a neurobiology Ph.D. student in Seattle who was part of the extended friend network, and she enthusiastically agreed to help with the project. We met on the appointed day:

I paused long enough to admire her fabulous striped socks and she paused long enough to admire our fabulous motel suite, and we were ready to start with the Science.

My mad scientist partner and I checked the structural integrity of the bed, to help ensure first and foremost the validity of the data we planned to collect and also, as a helpful side benefit, the safety of our experimental subjects. When one is doing mad science, safety is job...well, safety is something one considers.

She had brought a photographer with her, so while the photographer started to set up we talked experimental protocol. If you're doing anything for Science, including sex, you can't just sit down and get right to it; you need to establish a methodology that helps to control for confounding factors and that has a reasonable shot at providing a clear answer to a specific question.

Our objective for this particular experiment was to see whether or not the Neurosky chip could detect any pattern of brainwave activity that was typical for sexual arousal but different from other states not related to arousal. To that end, she worked out a protocol that involved taking a set of baseline readings from each person while reading silently, meditating, and reciting a memory. That done, we would then record for fifteen minutes while each victim subject's partner sexually stimulated that person. At the end of each session, there were exit questions involving asking the test subject for a subjective assessment of level of arousal and level of nervousness (to help control for whether or not nervousness was what the EEG was recording). During all this, a note-taker would be timing the events and recording anything that could present an anomaly on the EEG, as well as observations of each subject's behavior.

My partner in science brought one of her partners along--the mutual friend who'd introduced the two of us on Twitter and made the whole thing happen. He brought a netbook to record data and a really nifty necklace with a microphone and a bunch of LEDs that would glow and change according to the ambient sound. That bit became interesting a little later on, as it turns out.

For an EEG, we used a Mattel Mindflex toy that had been modified--the output from the Neurosky EEG chip had been run to the Arduino's serial input, as described here. Photo gear, netbook, modified Mattel Mindflex, and Arduino in pace, we were ready to start.

I'll skip over the next few hours, as it was for the most part nothing but people putting on the MindFlex, doing a bit of reading and meditating and stuff, and then lying still and being sexually stimulated in various ways. I would hate to bore you with the details. Such details are the stuff of scientific research, but when described in black and white, they tend toward the drab and tedious: "Subject number three spread her legs while her partner slowly kissed his way down her body, until at three minutes and sixteen seconds reaching her clitoris, at which point the subject began to moan and..." You get the idea. Pretty dry stuff, right?

The second was the interesting way in which the necklace I mentioned previously would react when my fellow mad scientist was screaming, which was, in my estimation, pretty damn nifty.

Now, at this point I have a confession to make, which, Dear Readers, I am trusting not to impact too severely your opinion of your humble scribe. I may lose some of my street cred as a veteran, seasoned pervert, but in the interests of fulldisclosure (for Science!) there is a confession I feel I must make.

I had not, up until this point in my life, actually had an orgasm in front of people I didn't know personally. Oh, sure, I'd been to sex parties and played in public dungeons; I mean, really, who hasn't? But until that afternoon in that seedy motel in the industrial part of Seattle, I'd not gone that one last inch (so to speak).

That all changed, though, and opened the way to a repeat performance, of a sort, in the dungeon at Frolicon some months later...but more about that at a later time.

I was rigged up, the baseline measurements were made, the timer was started, started doing things to me, and I in fact did have some incredible screaming orgasms of my own.

Four of them, in fact. I was right on the edge of the fifth when the fifteen-minute mark rolled by, and was left shaking and frustrated right on the edge. Much, I might add, to the delight of the onlookers, who seemed perhaps less than fully engaged in sympathy for my plight.

I crunched the data over the next few weeks, and discovered to my dismay that the EEG did not record anything that correlated even remotely with the experimental subjects' arousal. I was halfway expecting that, to be honest--the structures in the brain mediating arousal are deeply buried, and difficult to get information from with surface-mounted electrodes.

I wrote up the results of the experiment in a PDF, which you can read by clicking here.

Hopes for a brainwave-controlled Tormentor dashed, I turned my attention to making a vibrator that you could turn on or off just by thinking about it. The Neurosky EEG chip has an output that the manufacturer calls "concentration," and that seemed a likely candidate to control a vibrator.

So I used the same Arduino setup I'd used for the Tormentor for this project, connecting the Neurosky's output to the Arduino's serial input and switching on the vibrator when the EEG's "concentration" output reached a certain threshold.

It worked quite well...for about half the people who try it. About half the volunteers can, with ten minutes' practice, learn to control the vibrator at will just by thinking about it. About half the volunteers who try it, can't control it at all. I am one of the people who can't control it at all.

The code for the final brainwave-controlled sex toy uses the Arduino "Brain" library written to interface with the Neurosky chip in the Mindflex. The code looks like this:

// Arduino Brain Library

int buttonLatch = 0;
String inputString;
String debugOutPutString;
char inputArray[67];
char * pch;
unsigned long strength, attention, meditation, delta, theta, lowalpha, highalpha, lowbeta, highbeta, lowgamma, highgamma;
int vibratorPin=3;
unsigned long timeOfLastData;
unsigned long timeSinceLast;


#include
#include
#include
#include

// Set up the brain parser, pass it the hardware serial object you want to listen on.
Brain brain(Serial);

void setup() {
//     pinMode (vibratorPin, OUTPUT);
// Start the hardware serial.
Serial.begin(9600);
}

void loop() {

  timeSinceLast = millis() - timeOfLastData;
  if (timeSinceLast > 1500 ) {
    analogWrite(vibratorPin, 0);
  }
  
   // Expect packets about once per second.
// The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format:
// "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma"

if (brain.update()) {
inputString=brain.readCSV();
                Serial.println(inputString);
                inputString.toCharArray(inputArray,66);

                pch = strtok (inputArray," ,.-");
                strength=atol(pch);
                pch = strtok (NULL," ,.-");
                attention=atol(pch);
                pch = strtok (NULL," ,.-");
                meditation=atol(pch);
                pch = strtok (NULL," ,.-");
                delta=atol(pch);
                pch = strtok (NULL," ,.-");
                theta=atol(pch);
                pch = strtok (NULL," ,.-");
                lowalpha=atol(pch);
                pch = strtok (NULL," ,.-");
                highalpha=atol(pch);
                pch = strtok (NULL," ,.-");
                lowbeta=atol(pch);
                pch = strtok (NULL," ,.-");
                highbeta=atol(pch);
                pch = strtok (NULL," ,.-");
                lowgamma=atol(pch);
                pch = strtok (NULL," ,.-");
                highgamma=atol(pch);
//               debugOutPutString=String(strength)+" "+String(attention)+" "+String(meditation)+" "+String(delta)+" "+String(theta);
//               Serial.println(debugOutPutString);

                if ( strength <= 84) {
                  timeOfLastData = millis(); // Record time of last input only if we're getting good data
                  if ( attention > 20 ) {
                    analogWrite(vibratorPin, 255);

                  } else {
                  analogWrite(vibratorPin, 0);
                  }
                }
                  else
                  {
                    analogWrite(vibratorPin, 0); // Turn off if signal strength is worse than 84
                  }
        }

  }