You Are Here: Home » AVR ATmega Projects » DIY Polygraph Mask using ATmega32

DIY Polygraph Mask using ATmega32


A polygraph (often and incorrectly called a ‘lie detector’) is a machine which plots in real time several human biological signals such as pulse rate, galvanic skin resistance (GSR), blood pressure, and breathing rate. This machine, in conjunction with a certified examiner, is then used to analyze a subject’s stress during interrogation with the intent of distinguishing truth from lying. These machines can cost anywhere from hundreds to thousands of dollars. We attempted to build one for $50.

Polygraph Mask

For our design project we constructed a polygraph which measured pulse rate, GSR, and breathing rate, and performed a discrete cosine transform (DCT) on the subject’s voice in the hope of measuring a deviation in the fundamental frequency (another indicator of stress). The measurements were sampled, analyzed, and transmitted to a computer for further analysis using an ATMEL AVR Mega32 microcontroller.

High Level Design

The basic design of the polygraph is shown in the diagram to the right. The four analog circuits: plethysmograph (pulse rate meter), GSR meter, breathing rate meter, and audio preamplifier, are attached to the first four pins of the Mega32 analog to digital converter (ADC). The polygraph can then be run in one of two modes: pulse, GSR, and breath sampling or audio sampling. This is simply because the microcontroller is the limiting factor in processing power. In the first case, the microcontroller samples the three signals in a polling loop. The samples are taken at a fast enough rate (100Hz) that it appeared to be sampling each signal in real time. In the second case, the microcontroller exclusively samples audio at 8kHz.


In PGB (pulse, GSR, breath) mode, the microcontroller waits for a signal from a concurrent MATLAB program (running on a laptop) indicating a data request. The data is sent to the laptop over an RS-232 link via a serial to USB adapter and it is plotted in real time. The MATLAB program performs the signal processing, such as computing pulse and breathing rates as well as skin resistance.


In audio sampling mode, once a set of 32 sequential samples is acquired, the microcontoller performs a 32 point DCT on the audio signal to extract the frequency decomposition of the subject’s voice. At 8khz, 32 samples cover 4ms of speech and are enough to capture the primary features of human speech. The signal power is computed and the average DCT is updated with the new data. A concurrent MATLAB program periodically polls the microcontroller for the current DCT coefficients. These values are then plotted in a time-based heatmap, along with the signal power and average DCT.

Hardware Design

This design project was heavily analog. Each measurement component required amplification of a signal generated by some sensor. This presented many difficulties. For example, the pulse signal depends strongly on the particular subject, the finger being used, ambient lighting, etc. To combat these parasitic effects, we constructed an examination board, shown below and required that the subject being tested wear a specialized sensor facemask, also shown below. The board restricts movement of the subjects hand, which improves both the pulse and GSR signals. Similarly, the facemask, on which we mounted the breath sensor and microphone, has the dual purpose of maintaining the positions of the sensors relative to the subjects face and improving both the breath and audio signals by reducing noise such as outside audio stimulus.

Polygraph Mask schematic

Closeups of the circuits we built are shown below. Note that we made a special effort to lay the circuits out in such a way as to take up little physical space and to avoid any obstruction.


The plethysmograph that we built works on the principle that the amount of transmitted infrared light through a subject’s finger is a function of the blood flow in the finger. That is, when the heart pumps there is an influx of blood into the tip of the finger. This leads to a decrease in the light received by the infrared sensor, which can be measured. Heart rate is a key component in the polygraph since under certain stressful conditions, the subject’s heart rate will increase.

The circuit shown amplifies this signal by approximately 10000x in two 100x steps (the gain, in fact, can be optimally tweaked using the 10k trimpot) and filters out unwanted noise. It was designed by Dr G. J. Compton – our only modifications from the original design were small changes in resistor and capacitor values so that we could use lab components. Note that the capacitors are tantalum so that they can withstand some reverse bias.

The IR LED and photodiode sensor were mounted opposing each other on a the polygraph board. A hole in the polygraph board was drilled for the IR emitter to eliminate any interference. A measurement is acquired by having the subject places his finger between the elements and remain reasonably still.


For more detail: DIY Polygraph Mask using ATmega32

Leave a Comment

You must be logged in to post a comment.

Read previous post:
USB Sensors with ATtiny Microcontrollers
USB Sensors with ATtiny Microcontrollers

Working with embedded electronics, you will eventually ends up with some sensor between your hands, here I’ll show how to...

Scroll to top