Project tutorial

Lie Detector

Lie detector that measure your skin galvanic skin response to tell if someone is lying.

  • 13,234 views
  • 6 comments
  • 31 respects

Components and supplies

Ard nano
Arduino Nano R3
×1
resistor 2k
×1
09590 01
LED (generic)
×1
5mm Led : Red
×1
5mm Led: Green
×1
cable
×1
12002 04
Breadboard (generic)
×1

Necessary tools and machines

mounting board
alluminium foil

Apps and online services

About this project

Hey everyone today I want to show you how to make an Arduino-controlled lie detector to see when your friends are lying to you :D or to measure the different responses that your bodies skin goes through depending on the situation you are in or the emotions you are feeling. The result will be based on the visual in processing.

Step 1: How it works:

Our skin is amazing! It provides a medium for us to experience the sense of touch, it keeps infections out and keeps innards in but I bet you didn't know that our skin changes conductivity depending on many different things one being our mood! It called Electrodermal activity (EDA). The basics are that our skin changes its conductivity depending on how we feel.

We start by connect our Arduino to the subject and then connect the Arduino to a computer with the graphing software (I'll go over this in detail later). The data from the arduino will be transmitted to processing software where a visual will appear.

We have to start by asking the subject some easy questions we know they will answer truthfully like "what is your name" and "where do you live" to get a baseline and from there we can start asking questions that they may lie about, if they do they would probably feel nervous and then we can see the visual change.

Step 2: Parting list:

We need, Arduino Nano, 3 leds, 2K resistors, cables and some basic tools like cardboard and aluminium foil.

Step 3: Wiring

The wiring for this is pretty easy, we will start by connecting them in this order:

  • Connect a piece of cable to Arduino analog pin 0
  • Connect the 2k resistor to ground and the the extended analog 0 pin
  • Connect a piece of cable to Arduinos 5 volt pin
  • Connect the anode (long leg) of the green led to pin 2 and the cathode (short leg) to ground
  • Connect the anode of the orange led to pin 3 and the cathode to ground
  • Connect the anode of the red led to pin 4 and the cathode to ground

That's all the wiring for the Arduino.

Step 4: Software and code

We will be using arduino and processing software. First copy and paste the arduino code to arduino and upload it to the board. Make sure it is working fine. Next, open up processing and select sketch and import library serial. Go to sketch > import library > serial. This will make the data from arduino run in processing.

Step 5: Making the finger clips

Now that the basic form of the project is done we can start adding features to make it easier to use we will start by adding finger clips to keep a stable connection between our fingers and the cables. Lets start by gluing a strip of aluminium foil on a mounting board. Now tape down the exposed wire from analog pin 0 to the aluminium foil and repeat this step fo the 5 volt pin (make sure it makes a good connection).

Schematics

flb6ayeirsb5unr_large_1FvjiPB73I.jpg
Flb6ayeirsb5unr large 1fvjipb73i

Code

Arduino codeArduino
Code from arduino
void setup(){
  Serial.begin(9600);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  digitalWrite(2, HIGH);
  delay(500);
   digitalWrite(3, HIGH);
  delay(1000);
  digitalWrite(4, HIGH);
  delay(1500);
}

void loop()
{
  if (analogRead(A0) > 15){ //15
    digitalWrite(4, HIGH); //red
  }
  else{
    digitalWrite(4, LOW); //red
   }
   
  if (analogRead(A0) > 4) //4
  {
    digitalWrite(2, HIGH); //green
  }
  else{
    digitalWrite(2, LOW); //green
  }
  
  if (analogRead(A0) > 8) //8
  {
    digitalWrite(3, HIGH); //yellow
  }
  else{
    digitalWrite(3, LOW); //yellow
  }
 
  int sensorValue = analogRead(A0);
  Serial.println(sensorValue);
  delay(20);
}
  
Processing codeJava
code for processing
import processing.serial.*;

Serial myPort;        
float inByte = 0;
float inByte2 = 0;

void setup() {
  size(800, 800); 
  background(0);
  smooth();
  myPort = new Serial(this, Serial.list()[0], 9600);
  myPort.bufferUntil('\n');
}

void draw() {

  if (inByte > 15) { //red
    background(20);
    fill(20);
    stroke(255, 0, 0);
    strokeWeight(5);
    ellipse(400, 400, 500, 500);

  } else if ((inByte > 8)) { //yellow
    background(20);
    fill(20);
    stroke(250, 255, 23);
    strokeWeight(5);
    ellipse(400, 400, 500, 500);

  } else if ((inByte >4)) { //green
    background(20);
    fill(20);
    stroke(86, 250, 87);
    strokeWeight(5);
    ellipse(400, 400, 500, 500);

  } else {
    background(20);
    fill(20);
    stroke(255);
    strokeWeight(5);
    ellipse(400, 400, 500, 500);
  }
}

void serialEvent (Serial myPort) {
  String inString = myPort.readStringUntil('\n');

  if (inString != null) {
    inString = trim(inString);
    inByte = float(inString);
    println(inByte);
    inByte2 = map(inByte, 0, 630, 0.05, 4);
  }
}

Comments

Similar projects you might like

Magic Lamp

by Nekhil ravi

  • 878 views
  • 3 comments
  • 8 respects

Arduino MKR GSM 1400 and DTMF

by Arduino_Genuino

  • 3,605 views
  • 0 comments
  • 10 respects

Love You Pillow

Project tutorial by Arduino

  • 2,064 views
  • 0 comments
  • 4 respects

Infrared Replicator

Project tutorial by Gustavo Gonnet

  • 3,639 views
  • 6 comments
  • 26 respects

A Model Lighthouse Using an Adafruit NeoPixel Ring

Project tutorial by Jeremy Lindsay

  • 366 views
  • 0 comments
  • 4 respects

Rural Hack Kit

by Officine Innesto

  • 3,949 views
  • 0 comments
  • 7 respects
Add projectSign up / Login