Tag for questions about sensors, often used on integrated circuits and electronic devices to sense and measure external environmental variables. Sensors convert physical stimuli from the outside world into digital signals, which can be sampled by other subsystems.
Questions tagged [sensors]
2617 questions
73
votes
6 answers
Android accelerometer not working when screen is turned off
I'm developing an application for my final thesis on computer science, and I need to collect and log accelerometer data. I need to acquire it for a whole day long, so there are serious battery constraints (for instance, I cannot leave the screen…

martin
- 1,631
- 1
- 13
- 15
63
votes
6 answers
How to use onSensorChanged sensor data in combination with OpenGL
( edit: I added the best working approach in my augmented reality framework and now also take the gyroscope into account which makes it much more stable again: DroidAR framework )
I have written a TestSuite to find out how to calculate the rotation…

Simon
- 13,173
- 14
- 66
- 90
42
votes
6 answers
Android TYPE_LINEAR_ACCELERATION sensor - what does it show?
I am developing application for car acceleration tracking. I used standard accelerometer, calibrating it in specific position beforehand.
Then, assuming phone's orientation is not changing, I logged the accelerometer data for a specified time and…

Maep
- 833
- 1
- 10
- 16
42
votes
2 answers
How to use Kalman filter in Python for location data?
[EDIT]
The answer by @Claudio gives me a really good tip on how to filter out outliers. I do want to start using a Kalman filter on my data though. So I changed the example data below so that it has subtle variation noise which are not so extreme…

kramer65
- 50,427
- 120
- 308
- 488
39
votes
6 answers
How to detect movement of an android device?
I need suggestion about how to detect the amount of movement of an android device. Suppose I have put the phone on a table or bed and then if somebody taps the table or sits or laydown on the bed then I want to detect the movement of the android…

Surjya Narayana Padhi
- 7,741
- 25
- 81
- 130
31
votes
5 answers
How to get Android phone orientation matching human orientation?
I'm making a map app, including the location arrow that shows you which way you're facing, like so:
I get the orientation directly from SensorManager.getOrientation(), using the first returned value: azimuth. When the phone is held so that the…

AlbeyAmakiir
- 2,217
- 6
- 25
- 48
30
votes
7 answers
SensorEventListener doesn't get unregistered with unregisterListener() method
I have very simple Android app: in activity I have a button and I start/stop the OrientationListener. However, after unregistering it, in ddms I can still see the thread android.hardware.SensorManager$SensorThread] (Running).
The registration…

jacek
- 947
- 1
- 11
- 20
30
votes
6 answers
Smoothing data from a sensor
I have a 3D sensor which measures v(x,y,z) data. I'm only using the x and y data. Smoothing only x and y would be enough.
If I use a log to show the data, it shows me something like this:
(time) 0.1 ... (Data log) x = 1.1234566667
(time) 0.2 ...…

Mworks
- 301
- 1
- 4
- 3
25
votes
2 answers
Android - Acceleration down (smash)
Video explaining for those who does not understand
THIS ANSWER IS NOT CORRECTLY ANSWERED PLEASE TRY TO ANSWER IT WITH ANOTHER SOLUTION (100 Bounty is out of date)
Same question but better explained
This questions was accepted as a correct but it…

Skizo-ozᴉʞS ツ
- 19,464
- 18
- 81
- 148
24
votes
4 answers
How can I rotate display only in landscape mode in android?
I want that my View rotates only in landscape mode, clockwise and counterclockwise.
I read about the only counterclockwise for android < 2.2 and that's not a problem, my App will be +2.2 for now.
I modify my manifest to catch Configuration…

rubdottocom
- 8,110
- 10
- 39
- 59
24
votes
4 answers
Display an Android Sensors List
I'm trying to display a list of available sensors but it's like there are not!
I was thinking that it was because of the emulator, but i tried it on the phone and the result is the same.
private SensorManager mSensorManager;
TextView…

Skatephone
- 1,165
- 2
- 12
- 26
23
votes
1 answer
How do I use the Google Maps API GPS sensor?
All I've been able to find is how to specify the sensor parameter:
http://code.google.com/apis/maps/documentation/v3/#SpecifyingSensor
But nowhere does it say how to actually USE it. Isn't the whole point to be able to get the user's current…

renegadeofunk
- 445
- 1
- 3
- 11
22
votes
3 answers
How to access CPU's heat sensors?
I am working on software in which I need to access the temperature sensors in the CPU and get control over them.
I don't know much hardware interfacing; I just know how to interface with the mouse. I have googled a lot about it but failed to find…
user379888
21
votes
5 answers
Meaning of "LSB/Unit" and "Unit/LSB"
At the moment I'm playing with the LSM303DLHC accelerometer/magnetometer/thermometer.
This is its datasheet: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00027543.pdf
Everything is working quite well, but I…

Genesis Rock
- 707
- 2
- 5
- 16