In this project we explain how to create a breathalyzer for estimating blood alcohol content from breath sample using Zerynth to program the board.
We used an Arduino Due but it is possible to use other ARM board as Particle Core and Photon and ST Nucleo, with the same code because Zerynth is multiboard.
Our breathalyzer has 9 LEDs; 3 green and 6 red. They light according to the alcohol concentration read by the sensor MQ-3. The system must be calibrated by setting the values of the calibration array in the code and through the resistors. Otherwise you can use a potentiometer. The aim is having only the 3 green LED light when the concentration is under a fixed level.
1. Connect the power to the Vin pin and ground rails to the GND pin on the Arduino Due.
2. Connect the anod of the led to the pin 4 (to re-use our code) and the cathod to the ground rail of the breadboard using a 220Ω resistor. See the circuit diagram for more details. Repeat to connect the other LED's from pin 5 to 12.
3. Connect the sensor as shown in the specified scheme:
- Connect the B pins and one of the H pins of the sensor to the 5V output of the board.
- Connect the other H pin to the ground.
- Connect the A pins to the breadboard before the two serial resistor (4.7K and 10K ohm) as in the scheme.
- Connect the A0 analog in to the breadboard among the two serial resistors (4.7K and 10K ohm).
- Connect the end of the serial resistors to the ground (as in the scheme).
The Hardware is ready!
Download and install Zerynth Studio from www.zerynth.com/zerynth-studio/ (it runs on Windows, Linux and MAC OS).
Zerynth allows to program ARM board as Arduino Due, Particle Core and Photon, ST Nucleo in Python, that is an high level programming language really simple and clear. Zerynth allows to bring Python ease and portability to the embedded devices.
So, paste the code in the IDE, virtualize your board and upload the code to the board.
Your breathalyzer is ready to use!
This project is not accurate enough to register the exact value of blood alcohol concentration. It also is sensitive to environment temperature and humidity. It isn't a professional instrument. So we recommend: if you drink, don't drive!