Skip to content

Lazy Sunday

September 20, 2010

I spent a couple of hours yesterday taped up to my Arduino watching Ted talks on happiness and flow.

I was measuring my galvanic skin response (GSR) and comparing it to the declining intensity of the afternoon light.  This is an admittedly stupid comparison, and was more an effort to get up to speed on logging multiple sensors simultaneously.  Here’s the Arduino and breadboard setup:

The light sensor’s on a 10K resistor, and the GSR is on a 10 Mega-Ohm resistor.

If I’m going to continue doing this, portability is going to be essential.  It was like having my leg broken again.  Here I am getting around the Kitchen:

And I’m going to need to find a way to make the sensors more comfortable:

For code I pretty much used DanO’s Arduino and Processing sketches which can be found here:  I modified them slightly and you can see that code here:



For the Arduino code, I was interesting in mapping the values to a wider range, but the data was a bit erratic, so I was getting unhelpful negative values, and ended up commenting that out.  That’s going to need some fine-tuning.

For the Processing code, I was getting some hidden ASCII characters at the beginning of my serial transmission which was causing Java to close the port.  I am still in the process of adding some code there to trim the string properly.

The output was a bit languid, so even though I enjoyed the Ted talks, perhaps I should have been watching something like Dexter.  Here’s a screen shot of the Processing sketch playing:

The logi.txt copy file is a copy of the logi.txt file that the Processing sketch generates and to which it appends data.  I modified the pathway for the logi.txt file in the Processing sketch so that it would end up in a data folder in the sketch folder.  Otherwise, Processing will put it in the same directory as the application, and if that is in an Administrator account, Java will generate a File not Found error as it cannot write a file there without permission.

I noticed that the GSR response would leap up if I touched my keyboard.  Not sure what that means, but I definitely felt like I was being shocked by my old laptop:

Visualizing the data in the logi.txt file is the next challenge.  I tried simply importing it into Excel and generating a chart, but the program crashed on the second step.  There were over 7200 data entries as I had sampled once per second for a little over 2 hours.  The data is at

There is a slow climb to the GSR data, followed by a fairly abrupt drop, and then a slow climb again.  Not sure what accounts for the period, but is does seem quite regular.  One other thing I noticed is that there is some loss between the Arduino clock and my MacBook.  I have the Arduino sampling and sending data every 1000 millis, but the time stamp increments by 1025-1030 millis.


From → Rest of You

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: