Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • 3D Printing
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to build an Arduino lie detector based on electrodermal activity

By Nikhil Agnihotri March 20, 2023

A polygraph is an instrument that records physiological indicators like pulse rate, blood pressure, and electrodermal activity of a human subject under questioning by an operator. It’s commonly referred to as a lie-detector test because it’s designed to assess whether a person is telling the truth.

Industry-standard polygraph equipment is said to be 80 to 90% accurate if used correctly with proper quality controls. They’re not foolproof, but these devices have been used in investigations.

An important physiological measure is a person’s electrodermal activity, which is skin changes such as perspiration (which might be one indication of lying for some people). It’s simple to design polygraph equipment based on electrodermal activity, and this type of “lie detector” can be built using Arduino or any microcontroller for fun.

Microcontroller boards have one or more analog inputs, and one can be used to measure skin conductance. The electrical conductance can then be plotted as a graph through Arduino Serial Plotter.

For the most part, the graph of the electrical conductance of a typical person is consistent. When someone lies, the person gets nervous, which may result in a change in the skin’s electrical conductance. This is a potential indication that a subject is lying to the question.

In this project, we’ll build a type of lie detector based on electrodermal activity using Arduino UNO.

Components 

1. Arduino UNO x1
2. Red LED x1
3. Yellow LED x1
4. Green LED x1
5. 330Ω resistors x3
6. 2K resistor x1
7. Jumper wires
8. Electrical wires
9. Arduino USB cable

Circuit connections 

  • Connect the red LED’s anode with Arduino’s GPIO10 via the 330Ω resistor 
  • Connect the yellow and green LED’s anodes to Arduino’s GPIO9 and GPIO8, respectively, via the 330Ω resistors 
  • Connect the cathodes of all of the resistors to Arduino’s ground
  • Connect a jumper wire to Arduino’s analog input A0, and pull it down to Arduino’s ground via the 2K resistor
  • Extend the connection from pin A0 to an electrical wire
  • Extend an electrical wire from 5V of Arduino

The electrical wires extended from pin A0 and 5V out will act as probes of our lie detector. The probe ends can be attached to pieces of tin foil, secured by hook & loop tapes, to ensure uninterrupted contact with the subject’s fingers. 

While prototyping, the open ends of the electrical wires can also be attached to the subject’s fingers using electrical tape. 

Arduino sketch

//Arduino Lie Detector

void setup() {
  Serial.begin(9600);
  pinMode(10, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
  digitalWrite(10, HIGH);
  delay(500);
  digitalWrite(9, HIGH);
  delay(500);
  digitalWrite(8, HIGH);
  delay(500);
}

void loop() {
   if (analogRead(A0) > 900)
{
  digitalWrite(8, HIGH);
}
else
{
  digitalWrite(8, LOW);
}
  if (analogRead(A0) > 300)
{
  digitalWrite(9, HIGH);
}
else
{
  digitalWrite(9, LOW);
}
  if (analogRead(A0) > 600)
{
  digitalWrite(10, HIGH);
}
else
{
  digitalWrite(10 , LOW);
}

  Serial.println(analogRead(A0));
  delay(20);
}

How it works
Once the circuit connections are complete, upload the sketch to Arduino UNO and connect the open ends of the probes to the subject’s fingertips. Open the Arduino Serial Plotter and begin observing the graph of electrical conductance. 

Initially, the graph is consistent, with periodic variations in the read analog input. Next, start questioning the subject. First, ask things that are simple and that you know to be true, such as ‘What is your name?’; ‘What city do you live in?’; ‘How old are you?’ 

Typically, the graph on the Arduino serial plotter remains consistent without any deviations. Slowly, ask new questions, including ones the subject might lie about (you can ask them to do so for fun!). 

Depending on the subject, you might notice a change in the graph. This could be an indication that the subject is lying. 

Over the course of a long investigation, the threshold values for the analog input can be determined, which may indicate when the subject is lying or telling the truth. The values can then be added to the sketch to turn on the red LED on when it detects a “lie” and the green LED when it detects the “truth.”

The code
The Arduino sketch monitors the analog input from the skin of the subject’s fingertips. The analog readings are plotted as a graph over Serial Plotter. The plotted graph is observed for a long time to determine the physiological behavior of the subject. The threshold values are set in the sketch for lie detection, accordingly. These values are also used to turn on LEDs as indicators of truth or lie.

The results
An Arduino lie detector based on electrodermal activity built on a prototyping board…

The subject’s fingertips are connected to the probes using electrical tape while prototyping as shown here…

A normal graph for a subject during an initial investigation, as observed on the Serial Plotter…

During a period of questioning, the subject lied several times as observed by the abrupt changes in the graph below…

 

You may also like:

  • low power design
    How to optimize Arduino for low power design
  • Getting Started With Arduino With Simple LED Blinking Code Circuit Setup On Breadboard
    Getting started with Arduino – (Part 1/49)
  • Using Digital Input And Out Of Arduino Using Push Button And LED Circuit Setup On Breadboard
    How To Use Digital Input And Digital Output Of Arduino-…

  • What are inertial sensors?

  • What are the different types of temperature sensors and their…

  • Illuminating lies with brain scan surpasses polygraph test

Filed Under: Arduino Projects, Electronic Projects, Tech Articles
Tagged With: Arduino, liedetector, pic, polygraph, serialmonitor
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Power Efficiency
Discover proven strategies for power conversion, wide bandgap devices, and motor control — balancing performance, cost, and sustainability across industrial, automotive, and IoT systems.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions.

  • Why is military EMC so strict?
  • Cannot prototype a power supply
  • Phased array antenna never on full power for long?
  • TPS63070 Power Supply
  • Question about resistors values impact on lead reading

RSS Electro-Tech-Online.com Discussions

  • need help in photodetection TIA circuit
  • Need to solder a really delicate ribbon for an electric reel need advice
  • Help please! BLDC driver circuit using the IR2136s and the STP80NF06 MOSFETS
  • Measuring controller current output with a meter
  • Anyone In The US Ordered From AliExpress Recently?

Featured Tutorials

Real Time Hardware Filter Design

  • Practical implementation of bandpass and band reject filters
    Practical implementation of bandpass and band reject filters
  • Practical application of hardware filters with real-life examples
    Practical application of hardware filters with real-life examples
  • A filter design example
    A filter design example
  • Types of filter responses
    Types of filter responses
  • What are the two types of hardware filters?
    What are the two types of hardware filters?
  • What are hardware filters and their types?
    What are hardware filters and their types?
More Tutorials >

Recent Articles

  • Microchip extends single pair Ethernet lineup with software-less endpoint
  • Infineon MCU targets high-voltage BMS in electric vehicles
  • SemiQ releases expanded SiC MOSFET lineup with detailed thermal and switching data
  • TDK adds 1000 W models to dc-dc converter series
  • LEMO introduces resin-free IP68 connectors for compact equipment

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • 3D Printing
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe