More Fun With MindFlex

Last Fire Bender

After my last article, I was thinking it wasn’t impressive enough. Sure, lighting a match that is on the computer screen is cool and all, but what if it where a real flame.

In fear of catching my house on fire, or blowing off an appendage or two, I decided to go small scale for the moment. I needed something with a controllable flame and was small enough to use inside. So I decided on using an adjustable lighter.

The MindFlex hardware portion will not be covered, you can read my last post to get that going.

The new stuff consists of hacking the lighter. I dissembled the lighter and took the swing arm off and super-glued a broke off clip to a ballpoint pen. I poked a hole through the end of the clip so I could fit a paperclip in it. Next was to attach another clip to the servo. After I had both pieces sturdy enough for use, I was off to find a base to put them in. I ended up with a cylinder shaped packaging that was holding some paperclips. I cut a square big enough to fit the servo in, and taped the lighter to the outside of the base. Next I fitted a paperclip on both clips so the servo could controlled the lighters flame adjuster. Pictures below:

Base Of Unit
Base Unit Front View

I have to manually hold the lighter on. Although, adding a riser or jamming something in it to keep it on wouldn’t be to hard.  You can also adjust the max height of the flame by lifting the adjuster arm up off the gear and turn it up.

The code is pretty simple, just a miner adjustment to the SerialOut example from Eric Mika.

// Arduino Brain Library
// Eric Mika, 2010
// Edit by Tech B. to interface with a lighter, 2011

#include <Brain.h>
#include <Servo.h>
Servo myservo;

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

void setup() {
   // Start the hardware serial.
   Serial.begin(9600);
   // data pin to servo
   myservo.attach(13);
}

void loop() {
   // Expect packets about once per second.
   // I played around to find the max and min servo values
   if (brain.update()) {
       atten = brain.readAttention();
       // Map atten to angle of servo horn
       servoMap = map(atten, 0, 100, 150, 70);
       myservo.write(servoMap);
   }
}

It is interesting to play with this. The hard part of this whole project is making your mind do what you want. It varies person to person on the responsiveness.  For example, my wife keeps a steady meditative state and finds it hard to bring focus up; while I seem to keep a low focus and a steady mid attentive level .  I would be interested to see the results on some one who is ADD or ADHD, and compare the data to some one who is a monk, or practices meditation on a religious routine.

Here is a quick demo of me controlling the lighter: