Car-Lock Breathalyzer

Introduction

This portable breathalyzer is unlike any other commercial breathalyzer because it can physically prevent intoxicated drivers from starting their cars. There are two main parts to this breathalyzer: the base station and the portable breathalyzer. The base station should be left in the vehicle while the breathalyzer is used to unlock the vehicle by blowing a sober value. The servo-motor controls the locking mechanism of the vehicle. If the breathalyzer detects an intoxicated driver, it will lock the vehicle and immediately send a text message and an email to an individual specified in the program. The software and hardware needed to setup both the base station and the breathalyzer can be found below, as well as a video on how to use the breathalyzer.

Breathalyzer Setup

The standalone breathalyzer can be activated by pushing the start button located within a side-port. The LEDs will display a blue light in the center if the alcohol sensor is currently polling, and it will continue to do so for the next 10 seconds. Then by blowing into the same port a relative BAC will be displayed according to a ring of lights around the blue start light. The red indicates that the driver is intoxicated, and a signal will be sent to the base-station to keep the ignition locked and send the email/text. Otherwise the ignition will simply unlock and the kill-switch can be used once more.

Hardware

Hardware Needed:

  • MQ-3 Alcohol Sensor
  • nRF24L01 Wireless Transceiver
  • Pushbutton
  • Neopixel Jewel 7x5050 RGB LED
  • mbed

/media/uploads/rmaran6/breath.jpg

Wiring Table

mbedPushbuttonAlcohol SensorLEDTransceiver
p5MOSI
p6MISO
p7SCK
p8CSN
p9CE
p10IRQ
p11IN
p19Pin
p20S
GNDPin-GNDGND
Vout(3.3V)VCC
External 5V+5V

Software

Import programBreathalyzer

Source code for the breathalyzer box

Base Station Setup

Upon exiting the vehicle, the designated driver can hit the button located on the face of the base-station, aptly named the kill switch, to lock out car�s ignition. For demonstration purposes the lockout is simulated as a turning servo, but a proper implementation would require a real electronic ignition lockout. Now once the kill-switch is hit, the portable breathalyzer must register a BAC under a predefined limit in order to unlock the ignition. However, if the driver blows a positive BAC the ignition will remained locked and a server set up over the Wi-Fi chip to send an email and text to a pre-designated individual. This individual will also receive GPS coordinates such that he/she can come pick-up the drunk driver and his companions.

Hardware

Hardware Needed

  • MQ-3 Alcohol Sensor
  • nRF24L01 Wireless Transceiver
  • Pushbutton
  • Neopixel Jewel 7x5050 RGB LED
  • mbed

/media/uploads/rmaran6/base.jpg

Wiring Table

mbedGPSServoPushbuttonTransceiverWifi Module
p5MOSI
p6MISO
p7SCK
p8CSN
p9CE
p10IRQ
p14White
p19Pin
p21Yellow
p26Reset
p27RX
p28TX
GNDBlackBlackPinGNDGND
Vout(3.3 V)RedVCC
External 5VRedVbat

Software

The python code reads the webpage setup by the wi-fi chip and sends out an email and text based on it. It uses the requests and BeautifulSoup APIs to monitor the IP of the Wi-Fi chip. Once the webpage is setup it parses the html text and sees if the word drunk appears in it. If it does it sends an email using the smtplib API and a text using the twilio API. The twilio API requires you to set up a free trial account. There is no time limit on it but every text will be appended with “Sent from my free Twilio Account”. The code needs to be running on a separate pc or server.

Link To Python Code /media/uploads/rmaran6/monitor.py

Import programBaseStation

Basestation code for portable breathalyzer

Conclusion

In conclusion, the project works with the hardware and software used above. It successfully reads the alcohol on your breath giving you immediate feedback as well as stopping you from driving drunk. It can also notify people close to you if you are drunk and locked out of your car to come pick you up, also giving them your location. However certain assumptions were made to complete the project in the given time. It is assumed that the base station is in range of an access point and can connect to it as the Wi-Fi chip needs to set up a webpage if you are locked out. It is also assumed that the python code monitoring that webpage knows the IP at which the web page is set up. To correct that a modem can be used instead of the Wi-Fi chip to connect to the internet as well as the cellular network to successfully send notifications. Another assumption is that while reading from the breathalyzer, you are actually blowing into it. To make sure of this some tubing and an anemometer needs to be added. The anemometer reads wind speed and it can be used to make sure that a reading is only taken when someone is blowing into the tubes. For further work, a display and some form of input can be added at the base station to get more feedback to the user and give the user choice in who to contact.


Please log in to post comments.