Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

I have implemented a simple GSR module using Arduino in order to use for my research.

I
thought of sharing it with you.

What is GSR ?
When people are anxious, they tend to sweat due to the activity of Sympathetic Nervous
System. This is different from the typical sweating and its highly reflected at palms and foot.
Because of this sweating, it causes a difference in conductivity of the skin, by reducing the
resistance. Hence, it is used as a measurement of anxiety, which in turns can be used in lie
detection. But it should be noted that the accuracy of this is very low, since the same
conditions may rise due to other countermeasures, such as emotions.

Arduino code.
void setup(){
Serial.begin(9600);
}
void loop(){
int a = analogRead(A0);
// Sleep for 50ms, which provides the recommended sample rate (20Hz)
delay(50);
Serial.println(a);
}

What this code does is reading the data from the Analog 0 and write it to the Serial. It can be
read through the USB port using a simple RS232 reader.

If youre familiar with Arduino, you know how to write it to the Arduino. If not, dont worry,
here is a simple guide how to do it.

First, we have to write this to an Arduino module. For that, we need Arduino IDE and it can
be freely downloaded from their website. When you install the software, you will get the
drivers for the Arduino modules as well (please note that you need these drivers, not just to
program, but also to connect an Arduino and read data).

Open the Arduino IDE and write the above code (or simple Copy & Paste). In order to write
to the Arduino, you need to know the type of the Arduino (either its Uno, Leonardo, LilyPad
etc.) and select it from the Tools -> Borad.

And also we need to know which COM port the Arduino is connected to. You can see it from
the Ports in Device Manager window (Right click My Computer (This PC) -> Manage ->
Select Device Manager from the left side, if youre using Windows). Then check the
corresponding COM Port which connects the Arduino and we need to select it in the Arduino
IDE, from Tools -> Serial Port.

Then write the code to the Arduino module by clicking . If it is successful, it will print
Upload Successful message in the console.
Circuit Setup
Even though above program pushes the reading to the Serial Port, in this case USB port, we
need to set it up to read skin conductivity. For that, we need to create a simple circuit which
gives the comparative value of the conductivity of two fingers. The circuit is as follows.

Circuit
Diagram for GSR

1. Connect the 5V, GRND, A0 to the 5V, GRN and A0 pins in the Arduino respectively.
2. Connect the ARef to the ARef pin in the Arduino, which gives the reference for the
Analog readings.
3. Use Copper or Silver plates to the finger 1 & 2. You may use a velco cloth to make it
steadily connects with fingers.
4. Use C = 0.1 F, R = 2K to 300K (I have used 240K).
5. You may apply a little amount of Conductive Gel on two fingers, in order to increase
the strength of the readings.

The final setup would be like this.


GSR using Arduino

Now everything is ready..!!

Reading Serial Data


Now you can use any programming language to write a simple program to read the
corresponding COM Port. Please note, that you have to face lots of problems when youre
using C/C++ for this task (See this if youre still interested). Then I tried to use Java to read
the Serial port, and it worked (See this). Then I tried to plot the data, but it was SLOW as

expected. But after reading the data, we can do WHATEVER we want with it.

Then it hit me, why cant I use already available serial port reading programs :P. I tried,
RS232 Data Logger by Eltima Software, and I simply could select the COM Port and write it
to a file.

For offline usage, you can use a plotting to make a graph. If youre using MATLAB, you can
use smoothing alorithms to smooth the signal.

Plotted GSR Values

In here, the drastic changes in the readings shows the anxiety of the person (But it does NOT
mean that he is lying in a lie detection test).

You might also like