Alcohol Sensor with Arduino

Learn to make your own breathalyzer

Written By: Madeleine Schappi

Dash icon
Difficulty
Very Easy
Steps icon
Steps
6

Introduction

An Alcohol Sensor detects alcohol concentration in the air. It is not unlike a standard alcohol breathalyser. 

In this guide, we will learn to hook it up to an Arduino, give it a test and view the results using the serial plotter found in the Arduino IDE. If you are under the age of 18, you will need to enlist Mum or Dad to help with "acquiring the data.".

By completing this guide, you will have gained some understanding of how to use an alcohol sensor. You could go on to build your very own alcohol detection system.

Step 1   Connect the 5V line from the Arduino to the Module

  • Connect the 5V line from the Arduino to the Module.

Step 2   Connect the Ground line from the Arduino to the Module

  • Connect the Ground line from the Arduino to the Module.

Step 3   Connect Analogue 0 to the Module

  • Connect Analogue 0 to the Module.

Step 4   Upload the code

int gas_ain = A0; //Alcohol Sensor AnalogPin to Arduino A0
int led_pin = 13; //use Arduino integrated LED which connected to D13
int ad_value;

void setup() {

  pinMode(led_pin, OUTPUT);
  pinMode(gas_ain, INPUT);
  Serial.begin(115200);
  delay(2000);

}
void loop() {

  ad_value = analogRead(gas_ain);
  Serial.println(ad_value);
  delay(200);

}
  • Grab this code and upload it in the Arduino IDE
  • Open the serial monitor
  • Now grab a beer! ....or better a whisky! When you breathe alcohol over this sensor, you should get a spike in the reading.

Step 5   Open the Serial Plotter

  • In the Arduino IDE go Tools → Serial Plotter.

Step 6   Demonstation of the Alcohol Sensor

  • Here we have used the Serial Plotter to view the results as a graph.
© 2021 Little Bird Electronics Pty Ltd.
Made with ❤️ in SYD. All prices inc GST. ABN 15 634 521 449. We're 🐥 @lbhq on Twitter.