My university team and I are working on a project where we are working with Arduinos for the first time. For this project we are using the Arduino Nano 33 BLE Sense Rev2. We need to develop a mechanism that detects movements using the gyroscope and accelerometer for an app.
The idea is that the Arduino is held in the hand and moved randomly within short intervals in one of the following directions: left, right, up, down, or it is shaken. The goal is to accurately distinguish these movements.
We've already tried several codes with the help of ChatGPT. While they partially work, we are still facing issues where the movements are not always correctly detected and distinguished. For example:
A movement upwards is often mistakenly detected as a shake
Up and down movements, in particular, are not being detected correctly or are difficult to differentiate.
Does anyone have any tips on how to improve the accuracy of movement detection? Any help would be greatly appreciated!
For any movement regardless of the direction you can't move for minutes into the same direction. Certainly not an accelerated movement. And this means you have to deccelerate pretty quickly. Decceleration creates a accelerometer-signal with opposite sign.
You will have to define threshold values how long shall the movement into one direction be.
How much time is the signal allowed to be of reversed direction?
How much time will there be between one move and the next move?
Each move is an acceleration and and decceleration.
So it might be better to measure the signal of the whole movement.
Until the signal has been "low" for a minimum of time.
My experience with using AI is:
you have to input a very very precise description of what you want to have.
Any unprecise detail is an invitation for the AI to guess. To be able to write down it detailed enough you need a profound knowledge of the thing itself and often profound knowledge how to write code to correct things. And this means without much programming knowledge you can't describe it precise enough or find errors / bugs in AI generated code.