Project tutorial
Arduino Polygraph Machine (Lie Detector)

Arduino Polygraph Machine (Lie Detector) © GPL3+

Getting some information from human body by using simple sensors and Arduino.

  • 1 comment
  • 38 respects

Components and supplies

Apps and online services

About this project

In this project, we’ll try to get some information from human body using simple sensors and Arduino. You can use these information to create a lie detector machine. At the end of this article, you:

  • Know polygraph and basics of measuring and recording physiological indicators.
  • Will be familiar with lie detector systems.
  • Can get data from sensors and analyze them by Arduino.
  • Can measure respiration rate by using ECG electrodes and impedance pneumography.

An Introduction to Polygraph

You may hear about lie detector machines used by FBI or CIA or any another investigation by police. Today we are going to make one of those machines. First of all, let’s figure out one important fact about the polygraph and the lie detector machine. It’s better to say an important fact about lie detection tests. This test cannot tell us the person is lying or telling the truth, by itself. This is very important. But, how do they rely on polygraph test results?

The main idea of the lie detection test is changing the reaction of the human body between when a person is telling the truth or answering to a normal and routine question like what’s your name?, and his body reaction when he or she is lying.

For example when a criminal is going to have a lie detection test the investigator attach sensors on his finger, head or maybe on his chest. These sensors measure the breathing rate, pulse, blood pressure, perspiration and etc.

Sometimes the machine will also record things like arm, leg, face, and pupil movement. When the test begins the investigator asks some questions like “Is your name, Bob?” or “Do you live in the United States?” When the criminal answers, investigator establish the norm graphs of his reaction. After that, the main questions will be asked. During the test or after that, the investigator checks the result. If he finds a significant change indicates that the criminal is lying. These changes could be faster heart rate, higher blood pressure, increased perspiration, moving and looking around and etc. When an experienced examiner uses a lie detector machine He can detect the lie with high accuracy. If you use the polygraph for the first time it could be a little bit hard for you to recognize the lying.

In this project, we use SHT20 to measure temperature and perspiration, ECG electrodes to measure respiration rate, A pulse sensor to measure heart rate and an Arduino board to get data and analyze them.


In this circuit, we used ECG pads to have a better connection between the skin of the body and Arduino. You can use alligator clips and jumper wire to make this connection. This circuit can measure the breath rate of the body. But some parts of the circuit is removed from the picture because it depends on the level of parameters resolution and sensitivity in your project. For better understanding, read the impedance pneumography way to measure breath rate and complete your circuit according to your interest.

Impedance pneumography


In this code, we get temperature and perspiration from SHT20 sensor by I2C port, Heart rate from pulse sensor by analog input pin and breath rate from impedance pneumography circuit by analog input pin.

You must add the library and then upload the code. If it is the first time you run an Arduino board, don’t worry. Just follow these steps:

  • Go to and download the software of your OS. Install the IDE software as instructed.
  • Run the Arduino IDE and clear the text editor and copy the following code in the text editor.
  • Choose the board in tools and boards, select your Arduino board.
  • Connect the Arduino to your PC and set the COM port in tools and port.
  • Press the Upload (Arrow sign) button.
  • You are all set!
#include "Wire.h"
#include "DFRobot_SHT20.h"
DFRobot_SHT20    sht20;
void setup()
sht20.initSHT20(); // Init SHT20 Sensor
sht20.checkSHT20(); // Check SHT20 Sensor
void loop()
float humd = sht20.readHumidity(); // Read Humidity
float temp = sht20.readTemperature(); // Read Temperature
Serial.print(temp, 2);
Serial.print(analogRead(A3)); // Read Pulse sensor value
Serial.print(humd, 1);
Serial.println(analogRead(A2)); // Read Breath rate  


All you need to do is just cut the sponge and place the sensors. Then put it on your hand and adjust the stretch rubber and stick it using the hot glue gun.

Now, open up the Tools >> Serial Plotter.

You can see PULSE and BREATH graphs in the plotter of Arduino.

What’s Next?

You can improve this project as you wish. Here are a few suggestions:

  • Use ECG modules and connect them to Arduino.
  • Try analyzing data from your body.
  • Make a simple lie detector by more sensors and more coding.


Pulse SensorC/C++
No preview (download only).
No preview (download only).


Similar projects you might like

Nano Lie Detector Polygraph

Project tutorial by Roni Bandini

  • 5 respects

Arduino Lie Detector

Project tutorial by Dante Roumega

  • 188 respects

Healthcare Skin Pressure Detector

Project tutorial by David Escobar

  • 26 respects

Open Source Pulse Oximeter for COVID-19

Project tutorial by Arduino “having11” Guy

  • 141 respects

Arduino EMF Detector A.K.A Ghost Detector

Project showcase by Patel Darshil

  • 26 respects

A Posture Detector Sending Bluetooth Data to a Cordova App

Project tutorial by Gini76

  • 29 respects
Add projectSign up / Login