Lie Detector
A portable lie detector that uses heart rate signals to detect stress or deception.
Author: Macesanu Miruna-Andreea \ GitHub Project Link: (https://github.com/UPB-PMRust-Students/project-mmirudeea.git)
Descriptionβ
This project is a portable lie detector that analyzes heart rate variability (HRV) to detect signs of stress or deception. It uses a pulse sensor to capture heart rate signals, processes the data using a Raspberry Pi Pico 2 running Rust, and displays the result in real time.
The device provides feedback in three ways:
- Displays the result on an LCD screen
- Lights up an LED:
- π₯ Red = Lie
- π¨ Yellow = Unsure
- π© Green = Truth
- Sends session data over USB serial for logging or analysis
A push button starts each detection session manually, making the device interactive and easy to use.
Motivationβ
I chose this project because Iβve always been interested in how technology can interpret signals from the human body. The idea of detecting stress or deception by analyzing heart rate variability felt like a meaningful challenge that connects both biology and technology β two areas I find fascinating.
At the same time, this project gave me the opportunity to deepen my skills in embedded Rust programming, work with real-time signal processing, and design an interactive system that gives immediate feedback. Itβs rewarding to build something that not only works technically but also helps visualize how small changes in the body can reflect emotional states. I see this as a step toward future projects where technology can be used to better understand or respond to human behavior.
Architectureβ
Schematic Diagramβ
Main Architecture Componentsβ
-
Sensor Interface Layer
Captures analog signals from the pulse sensor via the Picoβs ADC. -
Signal Processing & Detection Logic
- Filters and processes the heart rate signal.
- Uses algorithms (e.g., HRV analysis) to detect stress or deception.
- Decides the result: "Lie", "Unsure", or "Truth".
-
User Interface Layer
- Displays the detection result on the OLED screen.
- Controls the LEDs to give visual feedback (Red, Yellow, Green).
- Monitors the push button to start sessions.
-
Communication Layer
Sends processed data and session results over USB serial usingusbd-serial
.
Connections Between Componentsβ
-
Sensor Interface Layer β Signal Processing & Detection Logic
(Heart rate data is read and processed.) -
Signal Processing & Detection Logic β User Interface Layer
(Detection result is displayed on OLED and indicated with LEDs.) -
Signal Processing & Detection Logic β Communication Layer
(Session data is transmitted over USB serial.) -
User Input (Start Button) β Signal Processing & Detection Logic
(Triggers the start of a new detection session.)
Logβ
Week 5 - 11 Mayβ
Week 12 - 18 Mayβ
Week 19 - 25 Mayβ
Hardwareβ
The device is built around the Raspberry Pi Pico 2W microcontroller, which serves as the brain of the system. It reads physiological signals from a Pulse Sensor XD-58C for heart rate monitoring. The detection results are shown in real-time on an LCD ecru display and indicated visually through three LEDs (Red for lie, Yellow for unsure, Green for truth).
A tactile push button allows the user to manually start each detection session. All components are connected using a breadboard, jumper wires, and pin headers for prototyping. Basic electronic components like resistors are used for signal conditioning and LED current limiting.
Schematicsβ
Bill of Materialsβ
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico 2W (x2) | Microcontroller + debug | 79.32 RON |
Pulse Sensor XD-58C | Measures heart rate | 15.17 RON |
LCD | Display readings | 16 RON |
Red LED | Lie indicator | ~1 RON |
Yellow LED | Uncertain indicator | ~1 RON |
Green LED | Truth indicator | ~1 RON |
Resistors (220β330Ξ©, assorted) | Current limiting | 14.99 RON |
Pull-down resistor (10kΞ©) | Stabilize button input | Included |
Breadboard (830 points) | Prototyping | 9.98 RON |
Header de pini (40p x4) | Connect components | 3.96 RON |
Tactile Push Button (x3) | User input | 1.08 RON |
Jumper Wires | Connections | ~7 RON |
Softwareβ
Library | Description | Usage |
---|---|---|
embassy-rs | Async embedded framework | For async tasks and timing |
embedded-hal | Hardware abstraction layer | Standard traits for sensors, LEDs |
ssd1306 | Display driver | Displaying text and graphics |
usbd-serial | USB serial communication | For debugging and data logging |
gpio | General-purpose I/O | LED and button control |
panic-halt | Panic handler | For halting on panic |
cortex-m | Cortex-M support crate | Low-level ARM operations |