create a function to determine fall and output in LED with iCE40 UltraPlus and LSM6DSOX

Job ID: 37432303

Budget: $10 – $30 USD

I am looking for a freelancer to create a function using Verilog that will determine falls and output them in an LED display. The function will be used with the iCE40 UltraPlus and LSM6DSOX.

Requirements:
- The function must be written in Verilog.
- The freelancer should be familiar with the iCE40 UltraPlus and LSM6DSOX.

Skills and Experience:
- Strong knowledge and experience in Verilog programming.
- Familiarity with the iCE40 UltraPlus and LSM6DSOX is highly preferred.

I already have code for the LSM6DSOX and iCE40 UltraPlus 5K communicate through SPI.

You are using LSM6DSOX (3D accelerometer and 3D gyroscope) and iCE40 UltraPlus 5K and the software lattice radiant 2023 to finish this project.

Basically, all you need to do is to create a function to determine fall and output in LED

The purpose is to detect falls, the method is based on the accelerometer and gyroscope, as long as the change to movement is too fast and sudden stops, we can consider that as a fall.

The LSM6DSOX and iCE40 UltraPlus 5K will communicate through SPI

The LED should always be green when the system is powered on, and then a fall is detected, the LED should blink red for 3 seconds.

~~~~~~
just for reference
First, we will collect data from the accelerometer and then calculate the acceleration magnitude. Acceleration magnitude tells us about how quickly velocity changes while acceleration tells us the rate of change in velocity, so we need acceleration magnitude here.

The above equation is of the magnitude of acceleration and the three values ax, ay, and az are the acceleration of X-, Y-, and Z-axis respectively as per data collected.

After calculating the acceleration magnitude, we need to know if its value breaks the lower threshold. The lower threshold is the minimum threshold in the range decided by us and the value gradually increases up to the high threshold. Then we need to check that it breaks the high threshold in some milliseconds — let's say 500ms.

If all of these are detected as true conditions, then we need to check whether there is a change in orientation within 500ms and usually, it's true if the above conditions are true. After that, we check to see if orientation remains the same for some time. If yes, then there was a fall. There is a loop, meaning that if a condition is false at any stage, the process goes back to start and re-executes.
Related categories: Verilog / VHDL FPGA