Skip to main content

USB Polygraph


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: This is by no means a professional product and therefore it should not be used as such. 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 polygraph involves attaching metal objects to someone's hand. To avoid any minuscule 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). 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:

 The enclosure was designed in Fusion 360 and 3d printed. Front panel overlay was made on Inkscape. Connections are made using 4 mm banana plugs:

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

Comments

Popular posts from this blog

Arduino Based Electronic Load

I have had some problems with my "lab power supply" and I wanted to build another one, so I thought a DC load may be handy to have around.
The design is based around Dave's design shown in this video http://www.youtube.com/watch?v=8xX2SVcItOA, but with a couple more features, including:

    -Arduino controlled.
    -Voltage, current, power and temperature monitoring.
    -CC and external in hardware modes and CP, Cr software modes.
    -Over temperature, over power and over current protection (software)

It can handle around 4 amps and 24 volts, limited by the mosfet.

It's divided in two main boards.

* UI Board: houses the 7 segment displays (I know one is bigger that the others, just what I had aroud...) and the keyboard. The display is multiplexed using a shift register. In addition, the four buttons are read taking advantage of the transistors switching the comon anodes, requiring only one additional pin. Only the first digit had decimal point, so one led was adde…

A4 Pen Plotter

This is a pen plotter capable of printing on A4 paper sheets. It is intended to be similar to the Aritma Amagraph pen plotter, be as compact and robust as posible as well as reliable.


It is controlled by means of an arduino with a grbl shield, wich drives the x and y motors, and the solenoid used for lifting-lowering the pen in response to g-code generated in inkscape and sent through grbl controller.  Here is a video of it working:

More info & files here: https://www.thingiverse.com/thing:2504587