RoboCircuits
Published © CC BY-SA

Lie Detector Using Arduino

Catch your lying friend.

BeginnerFull instructions provided1 hour7,715
Lie Detector Using Arduino

Things used in this project

Hardware components

Buzzer
Buzzer
×1
LED (generic)
LED (generic)
×1
Arduino Nano R3
Arduino Nano R3
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematics for Lie Detector

Code

Code for Lie Detector

C/C++
void setup()
{
	Serial.begin(9600);
	pinMode(2, OUTPUT);
	pinMode(3, OUTPUT);
	pinMode(4, OUTPUT);
	digitalWrite(2, HIGH);
	delay(500);
	digitalWrite(3, HIGH);
	delay(500);
	digitalWrite(4, HIGH);
	delay(500);
}

void loop()
{
	if (analogRead(A0) > 60)
	{
		digitalWrite(4, HIGH);
	}
	else
	{
		digitalWrite(4, LOW);
	}
	if (analogRead(A0) > 20)
	{
		digitalWrite(2, HIGH);
	}
	else
	{
		digitalWrite(2, LOW);
	}
	if (analogRead(A0) > 45)
	{
		digitalWrite(3, HIGH);
	}
	else
	{
		digitalWrite(3, LOW);
	}

	Serial.println(analogRead(A0));
	delay(20);
}

Credits

RoboCircuits

RoboCircuits

37 projects • 218 followers
YouTuber, Explorer, Creator, Programmer, Arduino Lover and Engineer

Comments