Compass using a Uno

I want to build a compass using the Uno. Can someone recommend a good sensor?

Have a look at the websites of Adafruit and Sparkfun and Pololu. Search for 'magnetometer' or '9-dof'.
It is not possible to answer your question. It depends on how much money you want to spend, if a sensor with a build-in processor is okay (easier but not for all situations okay), which Arduino board you use, if you want tilt-compensation, and so on.

Thanks for your suggestions Koepel. I found Adafruit lsm 303AGR for $8.95 or the TDK InvenSence icm 2094 9 dof imu for $14.95.

I will be using the Arduino Uno board. I will use a data logger to save the data. Eventually the compass will be paired with a gps sensor, and wind direction and velocity sensor mounted to a radio controlled model barge. The device will be used to map out the wind on Sprecles Lake in SF Golden Gate park as a function of time and location.

Sounds like a good project!

The Adafruit LSM303AGR Accelerometer Magnetometer and the Adafruit TDK InvenSense ICM-20948 9-DoF IMU modules are made compatible with 5V and 3.3V Arduino boards, so that is okay for your Uno board :smiley:

Have you heard about magnetic inclination ?
The magnetometer sensors measure the magnetic force in 3D. That is not pointing towards the horizon, it is pointing down into the earth or up into the sky.
There is good websites, but I can't find it right now :cry:

When I look at the map at the Wikipedia Magnetic Dip page, then I think that San Francisco has a dip of 60°. If I'm right, then that means that the magnetic force is pointing downwards into the earth at 60 degrees.

I found "Interfacing GY-511 LSM303 3D Compass And Accelerometer with Arduino". What do you think of the GY-511 LSM303?

Some GY-511 modules have 2k2 pullup resistors around the level shifter. That is too much pullup and the module is no longer within the specifications of the I2C bus.

If you mention something or find something, can you give a link to it ?

Sorry Koepel, I am new to Arduino. Here is the link to the "Interfacing GY-511 LSM303 3D Compass And Accelerometer with Arduino"

That is such a module with the wrong pullup resistors. They are the four resistors with "222".
In the sketch, they use the LSM303 Pololu library. Pololu do not sell the LSM303 anymore. They have now, for example, this: https://www.pololu.com/product/2738/. Pololu uses 10k resistors around the level shifter, that is normal.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.