PCBHub
December 1, 202549 min read 2 views

Lie Detector With Arduino Nano and Biometric Sensors : 7 Steps (with Pictures) - Instructables

pcbhub
pcbhub
Author
Lie Detector With Arduino Nano and Biometric Sensors : 7 Steps (with Pictures) - Instructables

Introduction: Lie Detector With Arduino Nano and Biometric Sensors

Article visual
Article visual
Article visual
Article visual

This project will guide you through building a simple "polygraph" using an Arduino Nano to analyze two crucial biometric data points: skin conductivity (GSR - Galvanic Skin Response) and heart rate. The mechanism relies on recording a resting reference value and lighting up a red or green LED if the measured values exceed a set threshold during questioning.

IMPORTANT DISCLAIMER: Please note that the machine we are going to build is an experiment and a toy. Real professional polygraphs use dozens of sensors and complex algorithms. This machine does not provide scientifically accurate results, although, if calibrated correctly, it can offer relatively reliable values during tests. I’d also like to point out that most of the AD8232 heart rate sensors available on the market are copies of the original ones, which are significantly more expensive. Unfortunately, these copies often have defects (as you can see in my video, mine was even missing a resistor) and inaccuracies in the readings.

Supplies

Article visual

Required Materials:

Before starting, make sure you have all the materials. The 3D printed parts are not strictly necessary: the circuit can be mounted on a breadboard or in a container made with other materials (cardboard, wood).

Electronic Components:

Arduino Nano: LINK

AD8232 Heart Rate Sensor (+ cables and 3 electrodes): LINK

1x - Push-button: LINK

1x - Buzzer: LINK

3x - 5mm LEDs (Red, Blue, Green): LINK

2x - 10 kΩ Resistors: LINK

4x - 220 Ω Resistors: LINK

1x - 70x30mm prototyping board (for the Arduino): LINK

1x - 80x20mm prototyping board (for the front panel): LINK

2x - 15-pin female strip pins (for the Arduino): LINK

1x - 2-pin male strip pin (for the GSR electrodes): LINK

1x - 9-pin female JST connector: LINK

1x - 6-pin female JST connector: LINK

Male JST connectors (for internal wiring): LINK

Dupont cable (for GSR electrodes): LINK

Electrode and Assembly Materials:

3D printed parts: LINK

Aluminum foil (kitchen use)

Roll of Velcro: LINK

Double-sided tape: LINK

Various screws (2x - M3x5 countersunk , 8x - M2x5 countersunk): LINK

Screws 2x - M3x30 socket head: LINK

Electrical tape: LINK

Cyanoacrylate glue (Loctite): LINK

Complete documentation + Arduino sketch:LINK

Step 1: 💻Main Board Assembly

Article visual
Article visual
Article visual

The first assembly phase involves the main board, which will house the Arduino Nano and the connectors for the wiring.

Begin by mounting and soldering the 15-pin female strip pins onto the Arduino Nano. Next, position the Arduino Nano with the mounted strip pins onto the 70x30mm prototyping board. Use a single solder point to initially fix it in place.

Once that is done, position and fix the 9-pin female JST connector and the 6-pin female JST connector with solder as well. After tacking all components, flip the board over and complete all soldering to ensure a stable and permanent connection.

Step 2: 🎛️Front Panel Board Assembly

Article visual
Article visual
Article visual
Article visual

Now let's move on to the 80x20mm board, which will serve as the machine's front panel.

First, insert and solder the push-button and the 10 kΩ resistor. Continue by installing the buzzer, ensuring you respect its polarity (positive and negative), and solder it along with its 220 Ω resistor.

Finally, mount the three LEDs (Blue, Green, and Red) in sequence.

Solder each LED along with its 220 Ω resistor. Finish the board by soldering the 2-pin male strip pin, which will be used for the finger electrodes (skin conductivity).


Step 3: 🔌Wiring and Connections

Article visual
Article visual
Article visual

Before closing the case, it’s essential to make all the electrical connections between the two boards and prepare the external wiring.

Follow the wiring diagram carefully to correctly connect the components (button, LED, buzzer, connectors) to the digital and analog pins of the Arduino Nano.

I recommend using JST connectors to make assembly and disassembly easier. Prepare the wiring for the AD8232 heart rate sensor using a 6-pin JST connector, even though only 5 wires are needed (leave one pin free for a future body temperature sensor).

Create a 12–15 cm wiring harness with a 9-pin JST connector.

Tip: It’s crucial to leave the wiring cables long enough. This will allow you to easily disassemble the front section in the future for any modifications or repairs.

Step 4: 📦Final Enclosure Assembly

Article visual
Article visual
Article visual
Article visual
Article visual
Article visual

Once the boards are wired, proceed to the final assembly:

  1. Attach the heart rate sensor (AD8232) to the inside of the front panel using two M3x5 countersunk screws.
  2. Connect the wiring of the heart rate sensor and the front panel board to their respective connectors. I recommend making these connections now, before inserting the parts into the case, for easier assembly.
  3. Position the main board with the Arduino Nano inside the main box and secure it in place with two M2x5 screws.
  4. Attach the 80x20mm board to the front panel, ensuring the components (button, LEDs, buzzer) align correctly with the holes. Secure it with two M2x4 countersunk screws.
  5. Carefully arrange the wires inside the box and close the front panel, securing it to the main box with the remaining four M2x5 screws.
  6. Remove the buzzer cover.
  7. Mount the case lid using the two M3x30 socket head screws and check that it opens and closes smoothly.

Step 5: 🖐️Making Finger Electrodes

Article visual
Article visual
Article visual
Article visual
Article visual
Article visual
Article visual
Article visual
Article visual

These electrodes will measure skin conductivity (GSR) and should be applied to the index and middle fingers.

  1. Wrap a strip of Velcro around a finger to take the measurement and cut two pieces, leaving them slightly generous in size.
  2. Cut two strips of aluminum foil. The width should be the same as the Velcro, but the length should be 1–1.5 cm shorter.
  3. Take a Dupont cable (with the female connector on one side and the stripped end on the other). Position the stripped end approximately in the center of the aluminum strip, ensuring a section of the insulated cable is also included.
  4. Secure the cable to the aluminum with a piece of electrical tape.
  5. Fix the covered part of the cable to the aluminum with a drop of cyanoacrylate glue (Loctite).
  6. Apply a strip of double-sided tape to the opposite side of the aluminum strip.
  7. Remove the double-sided tape film and apply the aluminum electrode inside the Velcro strip.
  8. Repeat the same steps for the second electrode.

Verification: After making the electrodes, use a multimeter to check the continuity between the Dupont connector pin and the aluminum foil. Finally, place the finger electrodes and the cardiac electrodes in the designated slots on the underside of the machine.

Step 6: ⚙️Software and Operation

Article visual
Article visual
Article visual

For operation, you will need to upload the sketch (the Arduino code) and understand the calibration logic.

  1. Upload the Sketch: Connect the machine to the PC and upload the source code (the sketch) to the Arduino Nano.
  2. Apply Sensors: Apply the cardiac electrodes to the body (traditionally arms/torso) and the two GSR electrodes to the index and middle fingers.
  3. Stabilization: Wait a few minutes for the heart rate and skin conductivity levels to stabilize.
  4. Calibration (Reference Values): Press the blue button. This will memorize the current values as reference values. If the registration is successful, the blue LED will light up for 3 seconds.
  5. Set the Threshold: In the sketch, you must set the threshold values. The machine will mark "truth" (green LED) if the values fall within this threshold and "lie" (red LED) if they exit it. The code reads the conductivity (GSR) and heart rate (HR) values from analog pins A3 and A0 respectively.

Open the Serial Monitor and Serial Plotter in the Arduino IDE to monitor and visualize the values while the machine is running and during the testing phase. Any significant change in heart rate or skin conductivity (such as removing a sensor) will cause the values to exit the threshold and the red LED to light up.

Step 7: 🏁Final Conclusions and Considerations

Key Takeaways:

  1. Functionality: The machine is capable of reading and displaying skin conductivity data and, if working, heart rate data in real-time.
  2. GSR Reliability: Commercially available skin conductivity (GSR) sensors are generally more stable and provide more accurate readings of the subject’s emotional state (stress, anxiety) compared to DIY versions.
  3. HR Limitation: Due to the potential unreliability of the AD8232 sensor (especially if defective), heart rate data may not be precise and, as in the video's final test, may require setting a very high threshold value to be virtually excluded from the test.
  4. Future Developments: The 6-pin JST connector left with an open pole offers the possibility of expanding the project in the future, for instance by adding a body temperature sensor for an even more comprehensive biometric measurement.

This project not only provides a fun tool for social experiments but also serves as an excellent introduction to biometric data reading and Arduino programming.

If you enjoyed this project and found it inspiring, please leave a heart 💖and share it with your friends.

See you in the next project!

Enjoyed this article?

Support the author by leaving a like.