from machine import Pin, ADC
import time
# Initialize ADC for GSR sensor (potentiometer)
gsr = ADC(26)
# Output devices
led = Pin(15, Pin.OUT)
buzzer = Pin(14, Pin.OUT)
# Threshold (adjust during simulation)
LIE_THRESHOLD = 35000
print("Pico Lie Detector Started")
while True:
gsr_value = gsr.read_u16()
print("GSR Value:", gsr_value)
if gsr_value > LIE_THRESHOLD:
led.on()
buzzer.on()
print("⚠️ Possible Lie Detected!")
else:
led.off()
buzzer.off()
print("Normal Response")
time.sleep(1)