Arduino-Based Lie Detector

 

Prototype

1. Introduction

A Lie Detector (Polygraph) works by measuring physiological changes in the body. One of the easiest methods to replicate with Arduino is measuring Galvanic Skin Response (GSR). When a person is nervous or lying, their skin's conductivity increases due to microscopic amounts of sweat.

In this project, we use Arduino to measure the electrical resistance between two fingers and display the result on an I2C LCD. We also add a Buzzer and LEDs to give an instant "Truth" or "Lie" alert.


2. Components

ComponentQuantityDescription
Arduino Uno / Nano1Processes the skin resistance data
16x2 I2C LCD Display1Displays the "Truth/Lie" status
LEDs (Red & Green)1 eachVisual indicators for status
Piezo Buzzer1Audio alert for a "Lie" detected
10k Ohm Resistor1Used to create a voltage divider
GSR Module with two finger coil2 stripsFor body pulse variation
Jumper WiresAs requiredFor connections

3. Circuit and Connections

Pinout Diagram of Arduino Uno R3
Pinout Diagram of Arduino Uno

Pinout Diagram of LCD with I2C
Pinout Diagram LCD WITH I2C

Pinout Diagram of Buzzer
Pinout Diagram of Buzzer

GSR Module Pinout Diagram
GSR Module Pinout Diagram

Circuit Overview:

The core of this project is a voltage divider. One leg of the divider is a fixed 10k resistor, and the other leg is the human skin (connected via finger straps). As skin resistance changes, the voltage at pin A0 changes.

Pin Connections:

ComponentArduino PinNotes
LCD I2C (SDA/SCL)A4 / A5Standard I2C pins
Finger Electrode 15VConnected to power
Finger Electrode 2A0Connected to Analog input
10k ResistorA0 to GNDCompletes the voltage divider
Green LEDD3Lights up for "Truth"
Red LEDD4Lights up for "Lie"
BuzzerD5Sounds when a lie is detected

4. Detailed Step by Step Circuit Working

  1. Conductivity Measurement: We wrap two strips of aluminum foil around the user's fingers. Arduino sends a tiny, safe current through one finger and measures how much reaches the other.

  2. The Voltage Divider: Since human skin has high resistance, we use a 10k resistor to GND at pin A0 to create a measurable voltage drop.

  3. Data Analysis: When the user is calm, skin resistance is high (lower voltage at A0). If they get nervous, sweat reduces resistance, and the voltage at A0 rises.

  4. Threshold Trigger: The Arduino code compares the live reading against a "Baseline" (the person's normal state). If the reading jumps significantly above the baseline, it triggers the "Lie" alert.


5. Code

C++
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

int sensorPin = A0;
int greenLed = 3;
int redLed = 4;
int buzzer = 5;

int baseline = 0;
int threshold = 20; // Sensitivity adjustment

void setup() {
  pinMode(greenLed, OUTPUT);
  pinMode(redLed, OUTPUT);
  pinMode(buzzer, OUTPUT);
  
  lcd.init();
  lcd.backlight();
  
  lcd.print("Calibrating...");
  delay(3000);
  
  // Take an average of 10 readings for baseline
  for(int i=0; i<10; i++) {
    baseline += analogRead(sensorPin);
    delay(100);
  }
  baseline /= 10;
  
  lcd.clear();
  lcd.print("Ready to Test!");
}

void loop() {
  int sensorValue = analogRead(sensorPin);
  
  lcd.setCursor(0, 0);
  lcd.print("Val: ");
  lcd.print(sensorValue);
  lcd.print(" B:");
  lcd.print(baseline);

  if (sensorValue > (baseline + threshold)) {
    // Lie Detected
    digitalWrite(redLed, HIGH);
    digitalWrite(greenLed, LOW);
    digitalWrite(buzzer, HIGH);
    lcd.setCursor(0, 1);
    lcd.print("STATUS: LIE!!   ");
  } else {
    // Truth
    digitalWrite(redLed, LOW);
    digitalWrite(greenLed, HIGH);
    digitalWrite(buzzer, LOW);
    lcd.setCursor(0, 1);
    lcd.print("STATUS: TRUTH   ");
  }
  
  delay(200);
}

6. Detailed Step by Step Code Working

  1. Calibration: In the setup(), the code spends 3 seconds reading the user's normal skin resistance. This is the Baseline. This is critical because everyone's skin is different.

  2. Threshold: We set a threshold variable. A lie is only detected if the value goes higher than Baseline + Threshold.

  3. Mapping the Input: analogRead(A0) turns the voltage into a number between 0 and 1023.

  4. Visual/Audio Feedback: The if-else logic controls the LEDs and Buzzer simultaneously based on the sensor value.


7. Tips for Success

  • Electrode Contact: Use Velcro straps or rubber bands to keep the finger sensor coil tight against the fingers. If they are loose, the reading will flicker.

  • Sensitivity: If the "Lie" alert stays on, increase the threshold value in the code (e.g., change 20 to 50).

  • Environment: Ensure the user's hands are clean and dry before starting the calibration.


8. Uses

  • Fun science fair projects.

  • Learning about human physiology and bio-sensors.

  • Understanding the Voltage Divider circuit in practical use.

  • Introduction to calibration logic in programming.


9. Conclusion

This Arduino Lie Detector is a fascinating way to see how electronics can interact with the human body. While it is not a professional-grade polygraph, it perfectly demonstrates the concept of GSR and provides a fun, interactive experience for students and hobbyists.

തുടക്കക്കാർക്കായി ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.