This is a USB Polygraph, which I designed and built as a classroom project on June 2018. The hardware side is pretty simple, an Arduino UNO collects data from some sensors and sends it via serial. On the computer, a Python program takes that data and not only graphs it, but it also allows the user to save it, manages questions and adds question and answer markers to the graphs so results can later be inspected. All results are saved in .txt files.
First, some legal stuff:
DISCLAIMER: I make no claim whatsoever on the validity of poligraphy for lie detection. Call this a signal acquisition device if you must. While it makes for an interesting and enjoyable build, it is intended just as an experiment and cannot distinguish between truth or else. Anyway, it is up to the user to decide. Always make use of common sense.
WARNING: Using this device involves attaching metal objects to someone's hand. To avoid any possibility of shock hazard, please make sure all "probes" are attached to the same hand and that the polygraph is connected to an isolated computer (i.e. a laptop running on batteries). The device as is does not provide galvanic isolation, so powering it from a supply derived from mains is out of the question. If you build and use this, you are doing so at your own risk. I am not to be held responsible for any damage that may occur.
Now, we can get on with further describing the project:
Electronics, sensors and project enclosure:
Here you can see the simple schematics for this project:
Three different sensors are used:
-A "galvanic skin response" (GSR) sensor, which is just a voltage divider in which your hand is one of the resistors. When you get nervous, your skin resistance changes and that can be measured as proposed. Photos below show the simple probes, just two pieces of aluminum and some "hook and loop tape".
-A pulse sensor, which is just a piezo element that generates a voltage proportional to changes of pressure resulting from blood flowing in your finger. I am relying on the ESD diodes on the Arduino inputs to handle overvoltage, although a series resistor would not be a bad idea. One side of the piezo is biased with a potentiometer, so the trace can be moved up and down for best results. It can be seen on the leftmost picture above.
-A breath sensor, based around the same principle of the pulse sensor. This time, the piezo element is mounted inside a 3d printed box. A strap goes around the "suspect" and a rubber strip presses the element in time while breathing. See photos below:
Software side:
The Arduino reads data from its analog inputs and sends a formatted string at periodic intervals to the computer, where a python program interprets it. Below, a screenshot of said program can be seen.
This is my first "major" python program, and I must admit it is a bit messy. If I started again, I would do things differently. The program is made out of two files, one contains all the GUI related code, while the other has all the underlying methods. I am using PyQt for the GUI and PyQtGraph for the graphs. Other libraries needed include PySerial.
"Installation" instructions:
Install python on your computer if you have not already done so. Don't forget to check the "Add Python to Path" box.
There is a file named "Modules install.bat" that will install all required libraries on your computer. Or you can do it manually of you wish.
Then, the program can be run by clicking on: "USBPolygraphLogic113.py".
Quick start guide, as it appears after pressing the "Help" button:
1) Connect with polygraph:
-Enter port name.
-Press Connect.
-Use Start and Stop to start and stop the transmission.
2) Record an exam:
-Create a .txt question file: 2 lines for notes and each question in a new line.
-Press the New exam button and chose a file name, press Save.
-Click Load question set and choose the question file.
-Connect and press Start.
-Press Q key, read question and press again. Press Y and N for answer markers.
-Questions will automatically update.
-Press E key or click Close/Save to end the exam.
3) Open exam:
-Click Open exam and choose file.
-Use arrow keys or < > buttons to move through the file.
-Press Close exam to exit.
4) Miscellaneous:
-To zoom in the graph, use ctrl and mouse.
-To return to auto-scaling, click the A button on the bottom left of each graph.
-For fixed scale, click Reset scale.
-To enable or disable the pulse Beep, click Beep ON or Beep OFF.
Documentation and project files:
All project files, including STLS and code, can be found in this GitHub repository.
This work is licensed under GNU General Public License v3.0
P.D. This project has been featured in Hackaday and in the Arduino website. Only noticed a couple months later looking at blogger stats... :)
Comments
Post a Comment