Galvanic Skin Response GSR or Electrodermal Activity is the study of the change in human skin conductivity (resistance) under different psychological conditions. Used in lie detectors (polygraph) and biofeedback devices, the measurement is actually quite simple but frequently associated with expensive equipment. Some interesting information about GSR can also be found on the iMotions website.
The traditional solution would be to build an external device and communicate with the phone using WIFI, Bluetooth, or maybe even sneak in through the USB port. However, these would require considerable effort and would not likely be something easy to reproduce by amateur scientists. The one available electrical input on a phone is for an external “hands-free” microphone.
Normally skin resistance is measured with direct current or DC. This is a problem because the microphone circuitry only inputs alternating current or AC since sound is essentially alternating vibrations. However, if the frequency is kept low enough, the skin’s resistance to low frequencies should be about the same as DC. The obvious way to generate an AC signal for the microphone circuit to pick up would be the headphone output.
Conveniently, both the microphone and headphone connections are in the same place. They use a single 3.5mm connector that has 4 connections rather than the typical three you see used for stereo headphones for example. The pinout of the plug is shown below. Oddly the ground connection is NOT the base but rather the second ring up. Initially, I thought I’d have to add some electronics to the path, but it turns out that the work can be done in software. The simple connection diagram below seems to work for most smartphones, but Samsung phones need an additional resistor discussed further down.
I thought I’d show you my first prototype of the interface. It isn’t very pretty, but it allowed me to easily switch parts and do some initial testing before I figured out how to do everything without the parts you see. The plug came from an adapter cable I happened to already have and all I did was cut the rest of the cable off and strip the wires. The little wires from the 4 elements of the plug are soldered to the terminal strip in order from tip to base. You could probably also do this with a hands-free microphone/headphone for example. It isn’t a bad way to go if you aren’t too skilled at soldering. However, the wires in cables like this have a special enamel paint insulation that you have to vaporize by at least tinning them with hot solder.
If you cut and strip the wire of a hands-free handset, you will find the 4 wires from the plug as shown below. All you need to do is attach a heaver stranded wire to the little wire that was headed to the left earphone and another to the one that was headed to the microphone. The colors might not be standard, so you will need to figure out which wire is which. Remember these wires are insulated with paint! To make a connection, you need to vaporize the paint off by adding a little solder to the last few millimeters of the wire.
Two of the wires aren’t used, while the others are soldered to the electrode wires as shown in the photo below.
The magazine Electronics Now had an nice article on building a Biofeedback Monitor in the December 1996 issue. I have modified their plans for finger probes slightly. You use “Sticky Back Velcro” and Aluminum Foil to make them. An assembly diagram and photo of the finished product are shown below. I used the Loop side of the Velcro (looks like carpet) for the part that wraps around the finger, and small square of the Hook side (stiffer plastic) to act as a catch. The stripped and frayed end of the connector wire is sandwiched between the Loop sticky side and the Aluminum Foil that covers the rest of the probe. These are known as a dry type electrodes. Professional electrodes would employ a conductive paste that would make the readings more stable and repeatable.
Finally here is a photo of the finished Smartphone GSR Sensor
Here are the video instructions for making the cable and electrodes from a 42-3546 Audio/Video cable from Philmore. I bought my cable from Fry’s, but Amazon also seems to sell them.
Most Samsung phones seem to require a resistor from Mic to Ground to convince them that there actually is an external microphone attached. There isn’t a specified resistance for this, but I’ve found 2.2k Ohm is a reasonable compromise. You can even get this resistor from Radio Shack as part #271-1325. Lower values might confuse the phone into thinking you pushed one of the buttons on the headphone/microphone hands-free cable. Here is the modified circuit diagram. For now, I’ll leave it to you to figure out how to incorporate resistor into a cable.
The Android App was the most difficult part of this project. It is written using a language called Basic 4 Android. So that it would work on most phones, I made it as simple as possible and still have it do everything you needed. The display shows about one minute of skin resistance history. Usually that is enough to see reactions and detect general trends. If the value exceeds the limits of the graph, it automatically resets the trace to the middle.
The App is also logging the value to a CSV file along with the time. The file’s name is made from the date and time YYMMDDHHMMSS.csv and you will find it is created in the base directory of your sdcard. CSV files can be read with many spreadsheet programs and the long recording of values can be nicely analysed and plotted this way.