Questions tagged [magnetometer]

Anything related to magnetometers, i.e. hardware measurement devices used to measure the intensity and/or the direction of a magnetic field. Many smartphones embed a magnetometer which is used as the sensing device in the implementation of electronic compass applications.

Anything related to magnetometers, i.e. hardware measurement devices used to measure the intensity and/or the direction of a magnetic field. Many smartphones embed a magnetometer which is used as the sensing device in the implementation of electronic compass applications.

See Wikipedia about magnetometers.

258 questions
0
votes
1 answer

Android magnetic sensor

I'm developing a compass for Android OS. When I use TYPE_MAGNETIC_FIELD, some devices have this sensor, some devices don't. I don't know how to handle this problem. Should I not support these devices or use another sensor approach. Can you give me…
0
votes
1 answer

Mapping a magnetometer data in python

I'm hacking my way through Python; Right now I'm trying to get the heading of a robot using a magnetometer using Python. The problem is I want to be able to set "North" by mapping the degree based values onto my own set. If I were programming the…
C. Thomas Brittain
  • 376
  • 1
  • 5
  • 12
0
votes
1 answer

magnetic absolut shaft encoder calibration

I have an absolute magnetic shaft encoder. I want to use it in order get the azimuth angle of that a motor. I want get values from the encoder but I want to know it is aligned to the magnetic north or it is irrelevant? So if the 0 angle at the shaft…
kyrpav
  • 756
  • 1
  • 13
  • 43
0
votes
1 answer

Determine the direction of a GPS coordinate

I am trying determine the direction of a target location based on its GPS coords in relation to Magnetic North or True North. Based on where my phone is currently located, as determined by Android location services, how do I know which direction the…
0
votes
1 answer

Android magnetometer returning non-smooth data

I am building an Android application which logs the degrees of the compass of the device into a file. There are two methods that get this degrees: Method 1: SensorManager mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); Sensor…
duncanportelli
  • 3,161
  • 8
  • 38
  • 59
0
votes
3 answers

How to implement an iOS metal detector app?

I want to implement a Metal Detector app which will react to a magnetic field in the phones surroundings. How do I read the magnetic field readings from the magnetometer on the iPhone? Does anyone have sample code for accessing the magnetometer…
user-123
  • 874
  • 1
  • 13
  • 34
0
votes
2 answers

Why can't I read the device's deviation from the magnetic North with this code?

OK the code is now working, but it still needs work. The values I get are "sticky", they are not stable (the magnetic North seems to move a bit every time I try to return to it), and I need to shake the device a bit in order to refresh/wake-up the…
user1073400
0
votes
3 answers

Why am I getting 0 degrees from magneticField property the whole time?

I'm trying to get the device's declination from the magnetic North in degrees, by relying solely on the device's magnetometer. This is the code I've written but I just get 0 degrees.. What am I doing wrong ? CMMotionManager…
user1073400
0
votes
1 answer

how to retrieve location from accelerometer and magnetometer in android

I want to retrieve the location and speed from accelerometer and magnetometer in the android device, I can currently get the speed from accelerometer, but how do I correlate it with the location from the magnetometer sensor, using both speed sensor…
dme
  • 11
  • 1
  • 3
0
votes
1 answer

Custom compass calibration view like Compass app has

I want to make compass like native compass app has with such calibration view. This method tell you that need to calibrate your hardware - (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager But how to get…
rowwingman
  • 5,589
  • 7
  • 33
  • 50
0
votes
1 answer

What is the reference magnetic field of my iPhone user's location?

I've been told that Apple ported the World Magnetic Model into their iOS. The model itself comes from the National Geophysical Data Center, and on their website you can enter your coordinates to get a value (among others) for the intensity of the…
daveyjoe
  • 31
  • 1
0
votes
1 answer

Magnetometer for Compass on iPod Touch 4G

I understand that it is not possible to get magnetic heading readings from the CoreLocation framework on an iPod Touch 4G, but it is possible to produce magnetometer readings using the CoreMotion framework. I also understand that I need to use…
Liam George Betsworth
  • 18,373
  • 5
  • 39
  • 42
-1
votes
1 answer

Connect MPU 6050 and HMC 5883L to i2c bus of Arduino Nano

I'm trying to connect the MPU 6050 module and HMC 5883L module for my IMU of the Autonomous Car. But there is one i2c connection in Nano (A4, A5). When I run the code for MPU 6050, it shows the results. the code is here. The circuit diagram…
-2
votes
1 answer

Digital compass without a magnetic field sensor?

How is it possible, that a Phone can have a digital compass but no magnetic field sensor? In the German data speciation below there a two different sensors: magnet field sensor (Magnetfeldsensor) and compass (Digitaler Kompass) listed. The Huawei P9…
Hannes Hofer
  • 1
  • 1
  • 2
-2
votes
1 answer

NullPointerException when using a fragment to get values from another class

I am a beginner in android and having some problem in handling NullPointerException.I need to pass the magnetometer reading values in an array from one class to a fragment. Here is the magnetometer class: public class Magnetometer implements…
1 2 3
17
18