alcoholsensor.pde
File Size: 2 kb
File Type: pde
Download File

My little sister turned 21 recently, so I started working with the MQ-3 alcohol sensor from SparkFun to see if I could make a portable breathalyzer that runs off a 9v battery, can plug into to a computer via usb and that has some sort of indicator lights to show how drunk one might be.

<insert photo here>
  
It has 6 LEDs which fade up in order depending on the level of alcohol it senses. I also can be plugged into a computer running a processing sketch that shows a more accurate fullscreen readout and displays 170 different images from the internet also depending on the drunk level.


Parts list:
Arduino Mini Pro (5v 16mhz version)
MQ-3 Alcohol Sensor
(2) Red LEDs
(2) Yellow LEDs
(2) Green LEDs
SPST switch
9v battery
9v battery connector
(3) 330k resistors
10k resistor
Right angle headers
FTDI USB->Arduino (5v version)
USB cord

The MQ-3 is a little strange, it definitely needs 5volts, much less and it won't function correctly. Because the sensor has a heating element it's values are easily skewed with hot or cold temperatures blowing on it. The MQ-3 has a burn in period of about 24 hours to give you accurate readings. Also I noticed that the MQ-3 alcohol sensor responds to a few other things like Rock Star energy drinks!

Other than the redundant pins the MQ-3 is pretty straight forward and easy to use. Simply hook up 5v to all 3 of the pins on one side, then hook up a ground (middle pin) and a 10k resistor to ground and finally the last pin goes to the Arduino's analog input. The pin with the 10k resistor to ground can be swapped with the pin going to the Arduino analog input.

The LEDs are taking up all of the PWM lines so they can be faded in sequence. Since the input from the MQ-3 sensor ranges from 0-1023, each LED covers a different range for example green1 covers 0-170 and green2 covers 170-340 and so on adding 170 each time.

There are also 170 images that are cycled through in the Processing sketch.
 


Comments




Leave a Reply