Cars are the second most dangerous transport vehicles, right after motorbikes. Hence why we decided to develop a product that would help to minimise the risk factor of traffic accidents.
DescriptionProject is based on Arduino Nano 33 BLE device. Arduino (accelerometer sensor) is located on the driver's seat belt, at shoulder height. Before driving starts, driver must start the application on his smartphone. While driving, application is receiving information about all the movements with the help of Arduino's accelerometer sensor. The application differentiates between allowed and unsafe movements without the need for direct interaction with the driver, making the app nonintrusive to the driver. Application timer is set to five minutes and number of "allowed" unsafe motions to five. Meaning that if the driver makes five or more unsafe movements in the timespan of five minutes, he will be warned with an audio alert, otherwise the number of unsafe motions drops back down to zero.
Machine LearningRight after the product idea was finalized, we started working on our machine learning process. We implemented the machine learning model by using Edge Impulse platform and Arduino Nano 33 BLE. At first, the best way to gather data was simply by using our Arduino accelerometer sensor to record driver's incorrect movements. Firstly, we mounted the Arduino on driver's seat belt, then we connected Arduino to Edge Impulse platform using MicroUSB cable and finally started capturing the data.We classify between these movements: - Allowed movements: - Normal driving (small usual movements and vibrations while driving) - Idle - Unsafe movements: - Moving towards the passenger - Moving towards the back seat - Leaning under the steering wheelHowever, we only considered drastic XYZ axis changes and classified them as correct and incorrect movements. All recorded movements in Edge Impulse were set to be 5000ms long. Quick movements and other position changes we captured with Arduino are showed as spikes on graphs in Edge Impulse.
The deployment of the machine learning model to Arduino is a reasonably straight forward process. Just import the Edge Impulse library to your Arduino IDE and from the examples drop down select "acceloremeter_continuous" example. After uploading the example to your Arduino device you can check whether the model is working properly. When opening the serial monitor in Arduino IDE, the correct prediction should be displayed, based on the movement of the Arduino sensor.
In order to connect the Arduino to the app, we had to implement the Bluetooth Low Energy (BLE) connection to the smartphone. We added a few lines of code to our original "acceloremeter_continuous" example, so that the app automatically finds and connects to our Arduino Nano, all with the press of the start button in the app.
We further modified our code, so Arduino sends the right bytes over BLE to the app. It is not continuously sending the bytes to the app, it sends them only when the prediction changes. If the label, predicted by the ML model, is "uncertain" we send 0, if the label is "normal" we send 1 and if the model predicts that the movement is unsafe we send 2 to the app.
Our mobile application was designed in MIT App Inventor. App development in this environment is made to be intuitive and simple, since all the functionalities are represented like puzzles with blocks as a programming interface. However the problem we came across was in design interface. When we tried to assemble our model it was hard to move pieces around. Connection with certain devices was not working, while on others ran smoothly.
Our application works as follows. Firstly the user must click button Start journey, so the application starts scanning for devices and it automatically connects to the Arduino, based on its MAC adress, serviceUuid and characteristicsUuid. Under lable Status, user is able to see if the connection is sucessful. While the app is running it recieves changes in movements. When unsafe movement is detected (data reached over one), error count increases by one. This change is also evident on screen, by showcasing brackets which represent number of errors made. When maximum number of five errors is reached a sound alert is played, and everything resets back to its initial phase.
This application will help you to improve your driving and make it safer for you and everyone else included. This is a great starting point to improve safety on roads and to increase drivers awareness of his actions and pay closer attention to the traffic.
Comments
Please log in or sign up to comment.