Pooja Baraskar
Published © GPL3+

Alcohol Detection Using Linkit One

Let us create a simple breathalyzer with LinkIt One microcontroller.

EasyFull instructions provided679
Alcohol Detection Using Linkit One

Things used in this project

Hardware components

LinkIt ONE
MediaTek Labs LinkIt ONE
×1
Seeed Grove mq5 sensor
×1
Seeed Grove buzzer
×1

Story

Read more

Code

breathalyzer

Arduino
int buzzer = 2;

int sensor = A0;

// The setup routine runs once when you press reset

void setup() {

pinMode(buzzer, OUTPUT); // Initialize the digital pin2 as buzzer output

Serial.begin(9600); // Initialize serial communication at 9600 bits per second

}

// The loop routine runs over and over again forever

void loop() {

var sensorValue = analogRead(sensor); // Read the input on analog pin 0 ('sensor')

Serial.println(sensorValue); // Print out the value on serial monitor

if (sensorValue > 650)

{

// If sensorValue is greater than 650

digitalWrite(buzzer, HIGH); }

else {

digitalWrite(buzzer, LOW);

}

}

Credits

Pooja Baraskar

Pooja Baraskar

25 projects • 137 followers
Intel Software Innovator and developer at Geek Monkey Studios. She is a Microsoft Certified Professional and C# specialist.
Contact

Comments

Add projectSign up / Login