Discussion about Cancelling Alert message temporarily/permanently and about using sensors to detect sudden increase in speed after short term rest or less movement?

yes, you can find it out by experimenting or you also could take a look into the documentation...

https://ai2.appinventor.mit.edu/reference/components/sensors.html#AccelerometerSensor

Taifun

May I know why accelerometer sensor is also functioning like orientation sensor, ie, If I change the position/angle of phone, both sensors are showing some fixed values (even if the phone is fixed somewhere without giving any further movement). But, I expexted that accelerometer will give values based on how fast the device is moved in x or y or z axis. Right now, I can't find differences between both sensors, Both sensors are giving some fixed values for each phone position/angle.

MY EXPECTATION:

Accelerometer sensor must be in 0 (or some initial value) when it is in rest regardless of the phone's position or angle. Now, when the phone moved in any angle, the value of that angle must go up. This is what I expected.

Or else, how can I do this using accelerometer?

  1. Check all the x values of accelerometer for 5 seconds & Find the average of all those values.

  2. Repeat step 1 again.

  3. Compare and check step 1 value and step 2 value. If Step 1 value < Step 2 value, then 'SPEED INCREASED'.

So, in 10 seconds we can give audio-alert to the driver as 'You Started Driving'.

How can I loop the 'Orientation sensor block' and 'Accelerometer sensor block', so they will check the changes each other and perform accordingly consistently.

Right now the blocks within acceleromer block are functioning only one time without repetition. ie, these blocks are not going back and checking the players named as player5Roll and player5Pitch.

How can I do this? I tried to create loop as I told above, but still not working.

Help me to do this,

  1. If phone's position is in favor to accelerometer's x value then proceed with x value - To detect the speed change.

  2. If phone's position is in favor to accelerometer's y value then proceed with y value - To detect the speed change.

That is what I tried in above blocks as a newbie.

See the answers here

Taifun

I guess, the blocks that I shared recently is closer to the result. Please, look at it and give your ideas as well.

Update: Im getting result now as expected but with some errors, ie, the x and y values are getting stuck (not updating new values). This may be because of fault in clock arrangements or something else, have a look and guide me.

Accelerometer shows fixed value when we tilt the phone in different position. So, it is difficult to depend this sensor to check the speed/movement-spikes. Because, same x,y,z reading for phone tilt and phone movement. How can we differentiate the readings between phone tilt and phone movement? There is no option for that.

In case of orientation sensor, the readings will be shown only for phone tilt. But, in accelerometer sensor both values are confused and mixed/merged each other, we cannot differentiate the values as when the sensor shows reading for phone tilt and when it shows reading for phone movement. If there is a way to differentiate Phone Movement using accelerometer sensor, please share the idea here.

Is there a way to compare current accelerometer values with past accelerometer values?

Keep copies of the values somewhere.

1 Like

Is there predefined values for accelerometer sensor for different phone positions? Is there any table for that?

No predefined values since accelerometers are hardware based, ranges of measurement are determined by what hardware a manufacturer includes in a device.

Accelerometer Data Collection and Processing Criteria to Assess Physical Activity and Other Outcomes: A Systematic Review and Practical Considerations - PMC.

As a rule of thumb,

  • the x axis values are positive when the phone is tilted left
  • the x axis values are negative when the phone is tilted right
  • the y axis values are positive when the front of phone is tilted up
  • the y axis values are negative when the front of phone is tilted down

Why not experiment with your phone?

. What Google says:

1 Like

Yes, I am experimenting with my phone.

@SteveJG But, how can I create an app that differentiate tilt value and movement value using accelerometer, because accelerometer shows both value (ie, value for tilt and movement) without distinguishing both values. I wish to distinguish both.

That Google article was very informative a about this problem, especially when they talk about calibration and the use of high pass filtering.

Get out your math muscles

1 Like

Distinguish both. :wink:
shaking

For other methods to determine constant movement

1 Like

I think, by using the above blocks, we can detect when the phone is not shaking as well. Il try.

Can I predict if the values of accelerometer goes up or down from the current value? If the value goes up/down (+3 or -3 ) from the current value, then play music.

I tried these blocks, But, this is not working, guide me,