Using accelerometer for device rotation?

39 views
Skip to first unread message

frozeni...@gmail.com

unread,
Mar 7, 2018, 1:29:16 PM3/7/18
to Automate

Hi!

I'm currently using a cheap Chinese Android phone from Oukitel, a K6000 Pro and it only has 3 sensors, acceleration, light and proximity so no gyroscope.
It's using the accelerometer to detect device rotation going from -10 to +10 on 3 axes.It reads out X=0 Y=0 Z=9.8 (about 10) when the phone is flat on a table.
I saw you wrote this reply two years ago so I don't have high hopes for this, but could it be possible to have each acceleration axis as individual values added to the current Device Acceleration block? Or perhaps have a sensor selector on the Device Orientation

Why do I want this? On my Galaxy S7 I was using the device rotation to detect when I put my phone down for charging on my bedside table and then launch the sleep tracker in Sleep As Android and I would love to be able to do this with this phone as well.

Henrik "The Developer" Lindqvist

unread,
Mar 8, 2018, 2:49:30 PM3/8/18
to Automate
Getting the Device orientation block working without an magnetometer, if possible, is already on the to-do list:
https://groups.google.com/d/topic/automate-user/ieFxvzSiWkA/discussion

Chris Floof

unread,
Mar 9, 2018, 5:54:00 PM3/9/18
to Automate
Thank you. I tried to search the spreadsheet but "accelerometer" and "rotation" where apparently the wrong search terms lol.

I see you've noted "Is it even possible?".

I don't know if this is even remotely helpful but if you would be going by the accelerometer/gravity sensor alone, the phone I have triggers the rotation if the X or Y value goes above 8.5 or below -8.5 on the X and Y axes.

X=10 is resting on the left side and X-10 is resting on the right side.
Y=10 is standing straight up and Y-10 is upside down.
Z=10 is laying down on the back and Z-10 is laying down on the screen.

In my case I could get by with reading the raw Z value as I only need to know when the phone is laying flat down on a table.
Reply all
Reply to author
Forward
0 new messages