Pooja Baraskar
Published © GPL3+

Alcohol Detection Using Linkit One

Let us create a simple breathalyzer with LinkIt One microcontroller.

BeginnerFull instructions provided1,525
Alcohol Detection Using Linkit One

Things used in this project

Hardware components

Seeed Studio Grove mq5 sensor
×1
Seeed Studio 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 • 178 followers
Pooja Baraskar is an accomplished software engineer, inventor, and technical author with over a decade of experience in the tech industry.

Comments