Skip to main content

Breathalyzer

A breathalyzer which detects the alcohol in the blown air.

info

Author: Tudor-Cristian Arhir
GitHub Project Link: https://github.com/UPB-FILS-MA/project-TudorArhir

Description

My project is a breathalyzer with a LCD (which shows the precentage of alchohol in the air(and some other stuff)), a buzzer, an alcohol sensor, 2 LED's and a button which resets the number so we can have another reading.( the "no idea" price tag on the components is there because they come from an arduino kit which i bought 1 year ago and i cannot remember the price). It has a 3D-printed case which makes it look more practical than just wires and components on a breadboard . I want this project to be something useful and at the same time something fun which anybody can use.

Motivation

I chose this project based on two important factors:

  • on my 20th birthday my friends got me a real breathalyzer which is very usefull for me because i love to drive
  • I wanted to make it more practical and easy to use for anybody at any time(we use it at gatherings and parties)

I want to put in use everything that i learned until now and to learn new things that will make this passion of mine to grown on a larger scale.

Architecture

Add here the schematics with the architecture of your project. Make sure to include:

  • what are the main components (architecture components, not hardware components)
  • how they connect with each other Block diagram

Log

Week 6 - 12 May

In this week i've constructed the project itself on the breadboard. At first , it was kinda difficult to figure out how all those componets should be put on the breadboard but eventually with some research i found out how to do it. I also had to buy another LCD because mine did not have the I2C interface and i couldn't use it without that interface.

Week 7 - 19 May

In this week I started to work on the code. I had some misunderstandings on how to do this part, but fortunately I managed to make it happen. The only problem was that the project did not work I didn't know how to fix it.

Week 20 - 26 May

In the last week, I found the problem to my project. The MQ-3 sensor had to be connected to 5V and I found out about this when searching for a formula on how to calculate the alcohol concentration(I still didn't manage to find any mathematical formula for this so I remained with the raw values that the senzor reads.). I also had a small problem with my buzzer, but I quickly managed to fix it.Regarding the 3D printed case, I didn't manage to do it because the friend of mine that had the 3D printer told me that too much material would have been wasted. In the end, I made a case from cardboard which I think it's a pretty good alternative to what I had in mind. The project is finished and ready to be presented. I had fun building this project. It made me get out of my comfort zone and to finally see how hard it really is to make something like this. In the future, with the knowledge I've aquired throught this semester, I will surely build something even bigger than this.

Hardware

The idea is simple : someone who drinks alcohol(a beer for example) blows into the MQ-3 sensor and then 3 thing will happen :

  1. The LCD will show some data which shows the precentage of alcohol in the air that was blown into the sensor
  2. The buzzer will make a sound to signal that the upper limit of detected alcohol in the air has been passed
  3. The LED's will be one red and one blue, which resembles the lights on a police car ( this is just for looks )

Schematics

Place your KiCAD schematics here.

Kicad Schematic

Photo of the project

Led's

MQ-3 sensor

alcohol detected

Bill of Materials

DeviceUsagePrice
Rapspberry Pi Pico WThe microcontroller35 RON
LCD1602 ModuleThe displayfrom an arduino kit
MQ-3The alcohol sensor15 lei
BuzzerEmits sound if you pass the alcohol limitfrom an arduino kid
Jumper cablesTo cable thingsfrom an arduino kit
2 LED'sUsed for signaling when the limit was passedfrom an arduino kit
Cardboard caseTo make it more practicalfound it in my house

Software

LibraryDescriptionUsage
embassy-rpRP2040 peripheralsUsed for accessing the peripherals of the Pico W
LCD-1602_driverA LCD1602 driverTo use the display
embassy-executorasync/await executor designed for embedded usageUsed for spawning asynschronous functions like main and read_adc_value
embassy-timeInstant and Duration for embedded no-std systems, with async timer supportStops code execution for a predefined time period
rp2040-halA Rust Embedded-HAL impl for the rp2040 microcontrollerUsed as a dependencie for the LCD
heaplessstatic friendly data structures that don't require dynamic memory allocationUsed to convert values to strings
  1. How does a breathalyzer work
  2. Breathalyzer with pico w
  3. How does an MQ-3 work