Driving when under the influence of alcohol is very dangerous. Your reflexes are altered, your vision goes blurry, you are no longer the master of your vehicle.This is where our project comes in. The main idea for our project was to prevent someone to take the road inebriated, however, it is based on people goodwill.
As part of our third year of engineering school in Unilasalle Amiens, in the RIOC (Réseaux Informatiques et Objets Connectés) section, we decided to create a connected locker/breathalyser as part of our IOT/LPWAN project.
The first step to use our BreathAnalyser - Locker is to put the car keys in the locker. Once you feel sobered up, simply breathe into the analyser and if your feeling was right, the locker opens and you can go back home with your car. If not, the user will have to wait a little longer, until the risk rate is none.
The project was made entirely in 50 hours by Quentin Boyeldieu and me (Tristan Cunha) and the only requirement was to use the LoRaWan protocol.
Using the locker is very simple.
- First, you pass the badge on the RFID sensor, this will unlock the locker, allowing you to put your keys inside.
- Once your keys are inside, the locker is locked. No one else can open it. The locker is closed with a SG90 Micro-Servo motor.
- There are two conditions to open the locker : First, you have to pass the good RFID tag, else it won't work. The second condition is obvious: you have to be sober. Just blow some air with your mouth on the MQ-3 sensor, and it will unlock the locker if you are negative to alcohol.
The locker is an IoT (Internet of Things) object. It uses the LoRaWan communication protocol.
It will send information about the locker and the breathalyser every 10 seconds. All the informations arrive on the LoRa platform called TTN, (The Thing Network). There, data send will be processed and will be published on an MQTT Server. To use this data, we have created a Node-Red server. This server obtains the information it needs with MQTT. We have made a dashboard to display all the information on a user-friendly interface.
The dashboard displays all the useful information for the user :
- Current Alcohol measurement (from 0 to 1000). A user is considered under the influence of alcohol if the value goes above 400.
- An historic by hour.
- State of the locker to know if someone uses it or not.
- RFID badge registered if the locker is in use.
Unfortunately, we couldn't print the different pieces of our project because they were too big for the printer. However we recreated everything using cardboard.
ArduinoOur arduino code can do 4 things:
- Lock and unlock the locker
- Measure the value of the alcohol sensor
- Get the RFID data from the tag
- Send the data to TTN
Here is some samples from our code :
void ouvrir(){
for (int position = 0; position <= 180; position++) {
monServomoteur.write(position);
etatcasier = 0x00;
delay(15);
}
}
void fermer(){
for (int position = 180; position >= 0; position--) {
monServomoteur.write(position);
etatcasier = 0x01;
delay(15);
}
}The function ouvrir() moves the Servo Motor in a position that allows the opening of the locker. We keep track of the status of it via the variable etatcasier.
The function fermer() does the opposite.
boolean alcool(){
sensorValue = analogRead(0); // read analog input pin 0
if(sensorValue > 400) {
lcd.setCursor(0,0);
lcd.print("Alcoolise");
return true;
}
else
lcd.clear();
return false;
}The function alcool() gets the value of the MQ-3 Sensor. If it's superior to 400, prints "inebriated" on the screen and returns a boolean. This function is called when the locker is closed and someone scans a RFID tag.
payload[0] = hexa;
payload[1] = sensorValue;
payload[2] = Savecle1;
payload[3] = Savecle2;
payload[4] = Savecle3;
payload[5] = Savecle4;
payload[6] = etatcasier;This is all the data that will be sent to TTN. The first two bytes are from the alcohol value. The next 4 bytes are for the RFID and the last one is for the state of the locker.
The entire arduino code is available below for download.
Conclusion and possible improvementsAs a conclusion, i would say that it was a really fun project to do; Quentin and I really enjoyed working on it and messing around with the MQ-3 sensor was entertaining.
Although the timing was a bit short, we managed to finish our project in time and we were able to show a working project to our teachers.
Here is some possible improvements for our project :
- Use of a different protocol than LoRa (WiFi, 5G, etc...)
- Printing the pieces in 3D
- A more accurate alcohol sensor
- A standalone version of the project without a locker with only the alcohol sensor that would allow the user to measure his alcohol level.
Thanks you for reading !



_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)












_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)
Comments