[Q] Temporarily swap the device sensors axes - Hardware Hacking General

I'd like to create an app that can temporarily swap the XYZ device sensors axes such as the gyroscope, compass, accelerometer, etc. (i.e. make the device believe that X axis is Z, north is south, right is left, up is down, etc...).
As long as this app is loaded, all other apps will believe the fake sensors data, the ability to turn it on/off directly from the notification bar, if possible, I'd like this to work without root!
If anyone can help or can point me to an existing solution, I'd be very grateful! I would even be willing to pay a reasonable price if you can develop that for me!

Related

What is G-Sensor?

i couldnt find a thread that explains exactly what it was... is it hardware or software...
hardware. I think its a type of accelerometer.
my wife is also interested in this.
so my phone wouldnt have it then.. doesnt the camera have some kinda sensor like it in it?
your wife needs to get a diamond or touch pro...
andason said:
my wife is also interested in this.
Click to expand...
Click to collapse
gotvitamink said:
hardware. I think its a type of accelerometer.
Click to expand...
Click to collapse
As far as I know it IS an accelerometer. Same thing I would say. Don't have much knowledge, but it's basically the same technology the iPhone uses. It can detect how you're holding your phone. Yes, you could use your front camera on your phone as a accelerometer and it's been asked before, but no one attempted to do so since it would consume too much battery.
Kraize92 said:
As far as I know it IS an accelerometer. Same thing I would say. Don't have much knowledge, but it's basically the same technology the iPhone uses. It can detect how you're holding your phone. Yes, you could use your front camera on your phone as a accelerometer and it's been asked before, but no one attempted to do so since it would consume too much battery.
Click to expand...
Click to collapse
yea i wasn't really sure if it differed from an accelerometer. I used google and wikipedia and i couldn't find anything on G-sensor, and I didn't find G-sensor under the accelerometer wikipedia entry.
but yea, basically the technology that iPhone uses.
someone should do it...
its an accelerometer which is hardware to do what the iphone does where when u turn it to its side its screen also changes to the sideways orientation.
It detects which way the phone is facing and can detect acceleration in 3 axis.
petard said:
It detects which way the phone is facing and can detect acceleration in 3 axis.
Click to expand...
Click to collapse
Ah, there is the more technical answer. It can detect movement. Basically you use the 3 axis which detects movement in all directions. You tilt left and right and you tilt up and down. I knew that just didn't know the technical meaning lol.
In most cases the G-Sensor is simply a small metal ball laying in a tub with several contacts. When you turn or move your phone, the ball moves also, connecting some of these contacts to anothers. So the phone can figure out how you hold it (portrait or landscape, upside down etc.) and can switch the screen or perform different actions. Its called G-Sensor because the ball is driven by G-Force.
What is G-Sensor ?
A G sensor is usually an accelerometer. It measures the forces that act on it during changes in velocity. The wiki article below has more details.
Source(s):
http://en.wikipedia.org/wiki/Accelerometer
Dennis78 said:
In most cases the G-Sensor is simply a small metal ball laying in a tub with several contacts. When you turn or move your phone, the ball moves also, connecting some of these contacts to anothers. So the phone can figure out how you hold it (portrait or landscape, upside down etc.) and can switch the screen or perform different actions. Its called G-Sensor because the ball is driven by G-Force.
Click to expand...
Click to collapse
False. It's a three (and probably sometimes two) axis MEMS accelerometer - there are a few companies making those, but probably the most popular ones are analog devices' ADXL series. Similar device sits in wiimote (just as a secondary motion detection system, the more accurate one is camera+sensor bar).
Because these chips became really cheap recently, and are way more accurate, reliable, and robust than any mechanical sensors (in the same price ans size range), they're being shoved in every possible device You can find them in digital cameras (used to recognize if the photo is portrait or landscape and tag it accordingly), in hard drives (to detect mechanical shocks and protect the hdd by parking its head), in laptops (usually same as above plus to detect when the computer is falling down or other dangerous situations and protect the hard drives), in cell phones (you probably know this one's uses), in toys, portable media players, and lots of other stuff.
It detects which way the phone is facing and can detect acceleration in 3 axis.
Click to expand...
Click to collapse
A more precise answer is that it detects acceleration in three axes, and from these values phone's orientation can be calculated.
[MORE DETAILED EXPLANATION]
It's rather simple - when the phone is normally handled (it's not free falling and it's not being waved around), the dominant acceleration detected by the accelerometer is the gravitational acceleration (-9.81m/s^2 in vertical axis). So, if most of the time acceleration detected along the vertical axis of the phone is bigger than one detected along horizontal axis, the phone is being held in landscape position. If the situation is reversed, it's held in portrait orientation. If the acceleration is largest in the third axis (tangent to the screen), it means that the phone is being held nearly horizontally or it's lying on some surface - better not change screen orientation then
But as i said - it's only true when the dominant acceleration is the gravitational one - the sensor can't tell it from other sources of acceleration like waving the phone around. If you run one of the g-sensor games or demos and try quickly moving the phone around the desk (keeping it horizontal at all times), you'll see that the game will interpret this movement as tilting the phone.
[/MORE DETAILED EXPLANATION]
And by the way, why is this thread in development and hacking?
mr_deimos said:
False. It's a three (and probably sometimes two) axis MEMS accelerometer - there are a few companies making those, but probably the most popular ones are analog devices' ADXL series. Similar device sits in wiimote (just as a secondary motion detection system, the more accurate one is camera+sensor bar).
Because these chips became really cheap recently, and are way more accurate, reliable, and robust than any mechanical sensors (in the same price ans size range), they're being shoved in every possible device You can find them in digital cameras (used to recognize if the photo is portrait or landscape and tag it accordingly), in hard drives (to detect mechanical shocks and protect the hdd by parking its head), in laptops (usually same as above plus to detect when the computer is falling down or other dangerous situations and protect the hard drives), in cell phones (you probably know this one's uses), in toys, portable media players, and lots of other stuff.
A more precise answer is that it detects acceleration in three axes, and from these values phone's orientation can be calculated.
[MORE DETAILED EXPLANATION]
It's rather simple - when the phone is normally handled (it's not free falling and it's not being waved around), the dominant acceleration detected by the accelerometer is the gravitational acceleration (-9.81m/s^2 in vertical axis). So, if most of the time acceleration detected along the vertical axis of the phone is bigger than one detected along horizontal axis, the phone is being held in landscape position. If the situation is reversed, it's held in portrait orientation. If the acceleration is largest in the third axis (tangent to the screen), it means that the phone is being held nearly horizontally or it's lying on some surface - better not change screen orientation then
But as i said - it's only true when the dominant acceleration is the gravitational one - the sensor can't tell it from other sources of acceleration like waving the phone around. If you run one of the g-sensor games or demos and try quickly moving the phone around the desk (keeping it horizontal at all times), you'll see that the game will interpret this movement as tilting the phone.
[/MORE DETAILED EXPLANATION]
And by the way, why is this thread in development and hacking?
Click to expand...
Click to collapse
How do you know this surplus of information? Was it from an engineering school / article / books / or phone dissection? How do you know this?
None of these answers made much sense, so I did a google search, found the following:
http://www.dimensionengineering.com/accelerometers.htm
poetryrocksalot said:
How do you know this surplus of information? Was it from an engineering school / article / books / or phone dissection? How do you know this?
Click to expand...
Click to collapse
The theory of operation is actually pre-high school level stuff - basic physics (you know, Newton's laws, and theory of gravity)
And the details - caught some of these at the engineering university, some from accelerometer datasheets. I had to interface one of them to a programmable microcontroller a while ago so i needed to do some research on my own
I just got a TP2 and is a bit confused as to the working of the G-Sensor. I have calibrate it (and it is switched on), but nothing happens when I turn the phone sideways - ie turning to landscape mode. Am I missing something or need to activate it somewhere else?
Thanks
stoutseun said:
I just got a TP2 and is a bit confused as to the working of the G-Sensor. I have calibrate it (and it is switched on), but nothing happens when I turn the phone sideways - ie turning to landscape mode. Am I missing something or need to activate it somewhere else?
Thanks
Click to expand...
Click to collapse
Hello, try to search on your programs, you will have "G-Config", it allows you to define which applications rotate.
Thanks very much. I searched but couldn't find any G-Config anyware in All programs. Only reference is the G-Sensor in All settings\System.
EDIT: Google reveiled G-Config to be a self written app. (just downloaded) So it's not a HTC app included in the ROM?

Motion Sensor Vs G Sensor

Lol this might be a dumb question but ive been lookin around and no answer... my logic tells me its the same thing but my curiosity keeps askin is there any difference? soo with that said is there any difference?
G1 Specs
Processor Qualcomm® MSM7201A™, 528 MHz
Operating System Android™
Memory
ROM: 256 MB
RAM: 192 MB
Dimensions (LxWxT) 117.7 mm x 55.7 mm x 17.1 mm
(4.60 in x 2.16 in x 0.62 in)
Weight 158 grams (5.60 ounces) with battery
Display 3.2-inch TFT-LCD flat touch-sensitive screen with 320 x 480 (HVGA) resolution
Special Features Digital Compass, Motion Sensor
Touch HD Specs
Model HTC Touch HD™ T8282
Processor Qualcomm® MSM 7201A™ 528 MHz
Operating System Windows Mobile® 6.1 Professional
Memory
ROM: 512 MB
RAM: 288 MB
Dimensions 115 mm x 62.8 mm x 12 mm
(4.35 in x 2.5 in x 0.47 in)
Weight 146.4 grams (5.164 ounces) with battery
Display 3.8-inch TFT-LCD flat touch-sensitive screen with 480 x 800 WVGA resolution
Special Features FM Radio, G-Sensor
What is the difference?
G-sensor is a gyroscope, in other words an orientation sensor.
motion sensor is more accurate, it MAY or MAY not have G-sensor's capability, this depends on the software implementation. but the hardware itself is capable of detecting and reacting to all kinds of movement.
G-sensor needs _relatively_ sudden movements to activate the gyroscope (think of a marble in box), if the phones (the box) is in landscape, and you tilt it to portrait, the gryo detects it (ie marble rolls to one side). However, if you keep the phone/box's orientation the same, and move the phone closer or further from you (assumign you ar eholding the phone): now if you move it slowly, the marbles won't roll, this is g-sensor. becaue it can't detect this movement. but if you suddenly jerk the phone/box, even if the orientation is the same, the g-sensor should detect it (ie the marble will move). ummm.. just like those dice games on iphone/itouch (if you 've seen the latest itouch commercial).
motion sensor detects all kinds of movements, it's only up to the software to decide if all functionalities are implented or only "up till" the G-sensor capabilities are implemented or something else. best example, G1's compass view, slow movement with the phone in the same orientation will pan around the map.
that being said even the motion sensor has its limits, if you move the phone uber slowly, i bet it won't detect the motion, unless it's military grade (read: 007 gadget ), if that's the case, then i don't think the phone would be $179 either
buggybug0 said:
G-sensor is a gyroscope, in other words an orientation sensor.
motion sensor is more accurate, it MAY or MAY not have G-sensor's capability, this depends on the software implementation. but the hardware itself is capable of detecting and reacting to all kinds of movement.
G-sensor needs _relatively_ sudden movements to activate the gyroscope (think of a marble in box), if the phones (the box) is in landscape, and you tilt it to portrait, the gryo detects it (ie marble rolls to one side). However, if you keep the phone/box's orientation the same, and move the phone closer or further from you (assumign you ar eholding the phone): now if you move it slowly, the marbles won't roll, this is g-sensor. becaue it can't detect this movement. but if you suddenly jerk the phone/box, even if the orientation is the same, the g-sensor should detect it (ie the marble will move). ummm.. just like those dice games on iphone/itouch (if you 've seen the latest itouch commercial).
motion sensor detects all kinds of movements, it's only up to the software to decide if all functionalities are implented or only "up till" the G-sensor capabilities are implemented or something else. best example, G1's compass view, slow movement with the phone in the same orientation will pan around the map.
that being said even the motion sensor has its limits, if you move the phone uber slowly, i bet it won't detect the motion, unless it's military grade (read: 007 gadget ), if that's the case, then i don't think the phone would be $179 either
Click to expand...
Click to collapse
in other words motion sensor is better than the g sensor n that is super crack juice i was a lil worried there cause i thought g sensor would be better for some reason but thanks alot now i know something i didnt... thanks =)
In general, these are the same thing. They use a part called an Accelerometer, which measures acceleration, or the forces exerted on a mass within a chip. The force of gravity pulls it in a certain direction with 1G of force, so that's how things like the iphone can detect what orientation it's in, by looking for which direction gravity is.
By shaking the device or moving it, you also exert forces on the mass inside, and cause it to register different forces in different directions, which are reported to the OS in 3 axis.
Notebooks use the same tech to know when to park the heads. If the accelerometer suddenly sees that there is no gravity anymore, it assumes that it is moving towards the ground and will then park the heads of the drive to prevent damage.
"Motion Sensor" and "G Sensor" are the same thing, just showing that the chip can detect when it's being moved.
Correct, motion sensor and G sensor refer to the same device (accelerometer).
There is no difference apart from the name.
I have looked in every menu as far as I know, and I do not find the compass anywhere.
There are actually two "motion" sensors on the G1.
The first is the accelerometer, similar to the iPhone. It detects motion by changes in gravity on three axes. This does not mean the phone has to make big movements to detect anything. The force of gravity is, in part, determined by the distance between two objects, so the phone does not have to move for the sensor to get a reading.
The second is a digital compass, I think that there's a Nokia that has one but the iPhone does not. This, as the name implies, reads the earth's magnetic field and determines which way the phone is pointing.
I'm working on an app that will use both of these to allow the user to examine a virtual 3D object.
Actually I finally found it. It is not called 'compass mode' as advertised. You go into maps - then street view. It will say searching I think .. then you touch the spot it tells you to and there you are .. walking down the street. I don't know how often the pictures are refreshed, but must be fairly recent because I can see that I need to get my lawn mowed !!! of course .. it seems I always need to do that with all the rain here in florida, but I would rather play with my toys.
theonlynickleft said:
Actually I finally found it. It is not called 'compass mode' as advertised. You go into maps - then street view. It will say searching I think .. then you touch the spot it tells you to and there you are .. walking down the street. I don't know how often the pictures are refreshed, but must be fairly recent because I can see that I need to get my lawn mowed !!! of course .. it seems I always need to do that with all the rain here in florida, but I would rather play with my toys.
Click to expand...
Click to collapse
Why you are in that screen hit menu and compass mode is in the bottom lower right corner and will react to your movements.
Thanks ... fouund it!

[Q] Is bearing (Compass) controlled by the GPS module?

I have a few apps that rely on an accurate compass (Geocaching, etc.). Not only is my Epic clueless as to the true heading, but it doesn't rotate as I do. In other words, if I'm facing east and turn around, the phone still reads east.
I know there are issues with the GPS, but I wonder if I have something else going on.
There is a separate magnetometer sensor, so the main compass functions that way. And most apps that show compass bearing use that.
Some apps may not align automatically by the compass bearing.
Make sure your magnetic compass is calibrated.
"Wave your phone around in a figure 8 pattern 4-5 times"
Thanks. I'm a dummy. I've never did the figure eight dance long enough. I figured you did it for a while and then hit OK. I continued until the prompt disappeared and it appears to be better.

Sensor to measure vital signs

Hi xda-developers!
I'm working on a application that measures the users heart rate, breathing and register movement.
I have already researched the field of existing sensors, and whats on it's way to release.
One of my biggest concerns is the use of an external sensor vs an integrated sensor in the smartphone - and thats why I need your expertise!
If I use an external sensor, what elements would help me store data about heart rate, breathing and movement? and is there a sensor you would recommend? am I better of using only the smartphone sensor?
One of the other things I have been thinking about is the datatransfer from sensor to smartphone.
I would like to get data day and night, with a sensor that is small and light-weight.
What transmission-type would you use? ANT+ or Bluetooth? or something different?
Oh, one last question:
How would you power a sensor like this?
Any help is appreciated and can't wait to hear your input and comments! :highfive:
- Ganlik
Ganlik said:
Hi xda-developers!
I'm working on a application that measures the users heart rate, breathing and register movement.
I have already researched the field of existing sensors, and whats on it's way to release.
One of my biggest concerns is the use of an external sensor vs an integrated sensor in the smartphone - and thats why I need your expertise!
If I use an external sensor, what elements would help me store data about heart rate, breathing and movement? and is there a sensor you would recommend? am I better of using only the smartphone sensor?
One of the other things I have been thinking about is the datatransfer from sensor to smartphone.
I would like to get data day and night, with a sensor that is small and light-weight.
What transmission-type would you use? ANT+ or Bluetooth? or something different?
Oh, one last question:
How would you power a sensor like this?
Any help is appreciated and can't wait to hear your input and comments! :highfive:
- Ganlik
Click to expand...
Click to collapse
In my opinion, I would like to say that the best option is a sensor with integrated bluetooth, because that will give a "generic" plus to the project (Every smartphone has bluetooth sensor) and i think that it will be easier to configure the conection (you mean datatransfer) between your project and the phone.
Regards and best of luck, it seems it's a good project

Some Questions about Moto Display

Hi all,
i love the moto display feature but i have some issues that make it less usable for me.
- on certain conditions the moto display seems to react to fast, while on other i had to wave 3-4 times until the screen was woken up. Does anybody know what makes the display not recognize the wave sometimes?
- i hate the fact that the notifications are an all or nothing feature. i might have 10 notifications, and i can only dismiss them all at once. But i want to dismiss onlyspecific ones and keep the rest on my lockscreen. Is this possible somehow?
- as the moto display dismisses all notifications at once, and the regular android lockscreen doesn't, creates situations where there are notifications on the drawer (which need to be dismissed manualls) vs. the Moto screen that doesn't show any notification.
Is there any way to make the dismissing of notifications work as on stock android (possibility to either dismiss all, or only specific ones).
I'm pretty sure its a proximity and light sensor of some sort, but other than that, I'm having the same issues as you.
Sent from my XT1254 using XDA Free mobile app
I believe that only the sensors on the top of the phone fact to the wave. I don't know what the bottom sensors do.
Why is it impossible to find a diagram listing the location and function of all of the sensors?
If you have many notifications and want to do each individually, then instead of using the moto display just hit the power button to go to the normal lockscreen.
pizza_pablo said:
I believe that only the sensors on the top of the phone fact to the wave. I don't know what the bottom sensors do.
Why is it impossible to find a diagram listing the location and function of all of the sensors?
Click to expand...
Click to collapse
Top sensor is for waving (as you said). Bottom sensors are there for when you pick the phone up. If you go to pick the phone up, once your hand covers those two sensors, the display lights up. I found this out somewhere on XDA because I had no idea what they did either lol.
you can disable the sensor, and it will work like the first generation moto x.
Still, the sensor works fine for me, they just takes a little time to turn on after the screen lights on (about 1, 2 seconds) so it's not instant.
chris23445 said:
Top sensor is for waving (as you said). Bottom sensors are there for when you pick the phone up. If you go to pick the phone up, once your hand covers those two sensors, the display lights up. I found this out somewhere on XDA because I had no idea what they did either lol.
Click to expand...
Click to collapse
Thanks!
I checked out the bottom sensors, and it appears that they do respond only to touch, as opposed to waving over. :good:

Categories

Resources