An embedded system is a combination of computer hardware and software designed for a specific function or functions within a larger system. The systems can be programmable or with fixed functionality.
The main characteristic of embedded systems is that they are task specific. For example, they can be either microprocessor-based or real time sensing applications.
In this application, an anti-tilt system is implemented by using an accelerometer. This system can be integrated in the cargo bay of heavy-duty vehicles to warn about odd distribution of the cargo. So, it is possible to measure the acceleration along the three-axis x-y-z and calculate the relative angular position with respect the reference one. Therefore, a different LED is switched on.
• GREEN LED indicates the no warning state;
• RED LED turns on if the angle exceeds the threshold value;
• BLUE RED displays the calibration phase.
The calibration phase is carried out at the beginning in order to eliminate the noise and improve the accuracy of the measurements. In this phase, the board should not be touched. The LEDs are updated every 100 msec.
The application id built through the ‘Full executable export’ path. Thus, in the model of application were add different components for modelling the behaviour of basic software, according to the application. The environment to make it possible is Simulink where there exist several Board Support Packages. Afterwards, the code generation is accomplished and the source code is get.
We can easily construct our application by using the BSP, where there already are implemented functions in the Simulink library. After the model has set up, the code generation can be generated by clicking on ‘Build’ (CTRL+B). Through the ‘Monitor and tuning’ button we can display the application directly on our board without intermediate programs.
The accelerometer detection aims to blinks the LED when a certain direction along one axes exceeds a threshold value that it is set up to 1.5 g. For this purpose, the calibration phase isn’t needed. The crash sensor can be useful in a wide range of applications where the maximum acceleration is specified.
The LEDs are fixed in the following fashion:
• RED LED blinks if the acceleration along x-axes exceeds 1.5g;
• GREEN LED blinks if the acceleration along y-axes exceeds 1.5g;
• BLUE RED blinks if the acceleration along z-axes exceeds 1.5g.
Also in this case, we adopt the ‘Full executable export’ method. So, the model of application is built in the Simulink environment through the BSP. The board is the ‘FRDM-K64F’ but it is possible to choose also a different hardware.
The video below shows the behaviour of the board when the threshold acceleration is passed over. However, the manual inaccuracy leads to blinks different LED colors because the given acceleration is a combination across different axis. This is the reason for which in several moments of the video, we observe a mix of colors blinking in the board. In conclusion, it can be improved by choosing a specific environment for which the correct movement along a specified axes is guaranteed.