Boozeduino using arduino


Now with more LED.

Arduino mega powered breathalyzer using the MQ-3 sensor.   A relative gauge for judging how intoxicated you are.
This is more of a device to encourage one to drink more. The MQ-3 can’t achieve the accuracy to register exact BAC.
And It behaves weirdly. Sensitive to temperature and humidity. This is purely for fun.Boozeduino

Links Awesome tool for this, made testing MQ-3 analog levels a snap.

My first project, instructable, First everything. I’m a total noob and my main goal was to not burn out any chips. I got an Uno early in January and my girlfriend got me an MQ-3(among other goodies) for Valentines day. I had blinked and breadboarded but hadn’t tried a complete project. Here it goes…

Step 1: Parts & tools


1x Arduino+Mega+2560  $50  Liquidware     *Great Price*
4x 5mmClearBlue Led  $5 Sure electronics
18x 5mmGreenLed  $4 Adafruit
6x 5mmRedled  $4 Adafruit
10x 5mmYellowLed  35cent/each Sparkfun
1x MQ-3 Alcohol Gas Sensor  $5 Sparkfun
1x Drilled PCB for leds   $3 Radioshack
1x Power supply PCB for MQ-3  $2 Radioshack
1x 7805 Voltage Regulator  $2 Radioshack
2x 10uF capacitors
50x 250ohm resistors
1x Project Box  $5 RadioShack
4x #4 Machine Screws  $2 RadioShack
2x 9V Snap Connectors  $3 for 5 Radioshack
1x Really long heat shrink tubing or cord with 4 wire  $2 Local store
1x Cheap microphone housing(Rockband)  $Salvaged
1x Mic holder  $5
1x On/off Switch
1x spool of solder
1x alcohol hand sanitizer
1x pieces of Velcro for mounting
1x tube of adhesive
Lots of wire in multi colors


Solder Iron
Heat Shrinker(Blowdryer or Lighter at worst)
Helping Hands
Usb cable
Arduino IDE 021
Dremel and/or Drill
3/8″ bit
Flathead screwdriver

A lot of stuff for a newbie but if you been at this a little bit, you’ve got most of these things, minus the MQ-3.  You could use any number of other project boxes, more or less LEDs.  This is a real flexible project.

Step 2: The code

@ Code for interfacing Alcohol Gas Sensor MQ-3 with Arduino
@ Code by Daniel Spillere Andrade and Daniel Amato Zabotti
@ /
@ www.DanielAndrade.netconst int analogPin = 0; // the pin that the sensor wire is attached to
const int ledCount = 32; // the number of LEDs in the bar graph 

int ledPins[] = {
// Here we have the number of LEDs to use in the BarGraph   53 is green 22 is red

void setup() {

for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);

void loop() {
//This is the code to light up LED’s
int sensorReading = analogRead(analogPin);

int ledLevel = map(sensorReading, 500, 1023, 0, ledCount);

for (int thisLed = 0; thisLed < ledCount; thisLed++) {

if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);

else {
digitalWrite(ledPins[thisLed], LOW);
} }}

Step 3: Mic Teardown and Holder

First, I pried the case open with a small flathead screw driver. Ripped out the existing components.
Then removed and examined the cord. Not 4 wires, no help for us-throw it aside. The non electric parts of the rockband mic give it a nice weighty feel so I wanted to keep those. The MQ-3 fit conveniently inside the rubber housing made for the electret microphone. I then poked a hole through the rubber underside to feed my wires for the MQ-3. The sensor has 6 leads. We will use 4. The sensor is reversible so alignment doesn’t matter. 4Long wires(resistance unknown) go to the separate circuit. We read the sensor between the yellow wire and the resistor pulling to ground.
One caveat of the MQ-3 is to let it “Burn-in” for 24-48 hours. Worked for a noob. There are other ways to calibrate the sensor. If you know hardware, set up 2 circuits and read the Datasheets. Software guy, use the Drinksheild.h library from Gfxhax.

Read more: Boozeduino

Leave a Comment

Your email address will not be published. Required fields are marked *