Dithira Hettiarachchi
Created November 9, 2020

The alcohol detector

basically this project can identify the percentage of alcohol that you have drunk.

The alcohol detector

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
m3q gas sensor
×1
LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver

Story

Read more

Schematics

The circuit

instead of using the m3q sensor you can use any gas sensor.

Code

the code

Arduino
void setup() {
  pinMode (A0,INPUT);
  pinMode (2,OUTPUT);
  pinMode (3,OUTPUT);
 
  Serial.begin (9600);

}
int t = 1000;
int h = HIGH;
int l = LOW;
float alco;
int val;
void loop() {
 alco = analogRead (A0);

 Serial.println(alco); 
 

 if (alco > 200){
  digitalWrite(2,h);
  delay (50);
 
  }
 if (alco > 220){
  digitalWrite(3,h);
  delay (50);
  digitalWrite (3,l);
 

 }
 else {
  digitalWrite (2,LOW);

 }
 
}

Credits

Dithira Hettiarachchi
7 projects • 6 followers
Python Cooking Web3

Comments