The need of immediate assistance after a traffic accident is one of the greatest concerns in our society. By the time an accident takes place the procedure to identify and locate it can take minutes, hours or even days. This is a challenging problem that can be addressed using autonomous devices combined with standard IoT networks such as Sigfox. In particular, this technology provides a wide and deep coverage area including a geolocation system which is very useful in this type of applications.
This is the support of Carfox, a Sigfox-based device created to notify hospitals, authorities and even relatives when an accident takes place as fast as possible, providing useful information such as geolocation, severity and the source of the problem. This is totally transparent to the injured, is achieved using cost-effective components and can be used in any vehicle.
This project has been developed using MKRFOX1200 board, an Inertial Measure Unit (IMU) with 9 Degrees of Freedom (DoF) and a flexible force sensor. To supplement the functionality of Carfox, I created a dashboard in Losant platform to receive data from Sigfox backend and visualise the geolocation of the vehicle and characterise the kind of accident.
Hardware implementationBefore starting the project, you must solder some pins in the IMU that are not soldered in advance. Then, I have used a piece of perforated prototyping board for supporting the parts and reducing the size as can be seen in the figure below.
Later, you must solder each connection as it is shown in the next figure (see Fritzing for more detail). The IMU and MKRFOX1200 are communicated via I2C. Therefore, we need 4 wires to connect it completely (SDA, SCL, GND and VCC).
Now, we add the force sensor and a 100kΩ resistor. The idea is to create a voltage divider to measure forces adjusted to our scale (see Fritzing model). In particular, this flexible force sensor can measure a maximum of 100 lbs (45.36 kg).
The result should be something similar to the next figure (the protoboard is not necessary).
The fritzing of the project is the next one:
Some knowledge and characteristics of accelerometers are important to understand the code correctly and the way to manage them. The first thing that we must know is that these sensors measure acceleration which seems simple, however, we cannot forget acceleration caused by gravity. Therefore, accelerometers measurements, in a static position, are not zero, since one of its axes is near 9.81 m/s^2. Units could be provided in m/s^2 or simply in g. It means that 1 g is one times the gravity acceleration. In this case, accelerometer data are in mg (a one thousandth of g). This board has also gyroscopes which give information about angular velocity in rad/s or °/s.
This Inertial Measure Unit (IMU) provides several configurations with a programmable full-scale range for the accelerometer (±2 g, ±4 g, ±8 g, ±16 g) and gyroscope (±250 °/s, ±500 °/s, ±1000 °/s, ±2000 °/s). For the accelerometer I have chosen ±16 g since we do not need a high accuracy, but we want the widest range to detect high accelerations produced in accidents. In the case of the gyroscope, I have selected ±2000 °/s for the same reason.
Software resourcesArduino IDE In this case I have Arduino IDE installed, you can download it on the official webpage or you can use the web editor.
For adding libraries it is very useful to use Arduino IDE tools, as can be seen in the link below.
https://www.arduino.cc/en/Guide/MKRFox1200
If you want to use the same IMU (is not necessary) you can see all the information required in the links below.
Sigfox
In Sigfox backend is important to know several things to surf easier. First, if you want to see incoming messages you must do the following actions.
If you want to forward messages to other platforms or to send an email when new data is received you can follow the next steps.
I implemented several callbacks. The first one to forward geolocation data to Losant platform, the second one to send an email with the same information plus the radius and the last to forward the rest of the values to Losant platform (Temperature data and high temperature, extreme temperature, accident and critical accident alarms). The configuration is shown below in the same order as explained.
Losant Platform
Losant is the platform that I have chosen to represent data, where temperature data inside the vehicle is shown, two panels to check if there are alarms regarding accident or high temperature and, finally, there is a map with the current geolocation.
For using this platform I highly recommend the tutorial made by Brandon Cannaday explaining how can be used Losant with Sigfox devices. I followed it step by step and all worked properly.
3D DesignAutodesk Fusion 360
I used Fusion 360 to design the cover of Carfox. It is a very complete and easy to use design software. Although, if you are new in 3D design there are many programs that are simpler than this one and very useful for developing small projects.
https://www.autodesk.com/products/fusion-360/overview
Ultimaker Cura Software
I used Cura software to export to .gcode the .stl file that provides fusion 360 (or any other). Do not forget to select the correct 3D printing before exporting.
https://ultimaker.com/en/products/ultimaker-cura-software
Video demonstrationHere you have the video demonstration.
Comments