Trying To Build A Basic Compass Or Heding Indicator With Digital Readout For A Tractor!

Hi all,

New here! With a friend who is an electrical engineer we are trying to make a compass or heading indicator (Arduino based) with a digital readout that can be used on a tractor. AS you can imagine most compasses, cell phone, Garmin etc. become very inaccurate when near the vehicle.

He has tried one with a magnetometer but it is pretty inaccurate when near the vehicle despite trying to calibrate. Also tried an accelerometer/gyro and it seems to give a readout when moved but then the readout is wrong when rotated back to the starting point.

All I am trying to accomplish is something that will show a heading such as when going North that is “0” then when you turn 180 degrees to go South it shows “180”. The whole idea of this unit is to be able to drive straight and parallel paths in a field!

I imagine we are not using the best chip for this and also have some to learn on the Arduino programming and calibration.

Thank you for any initial advice, suggestions etc. for someone trying to learn and build a useful device!

A magnetometer can work, but it must be very carefully calibrated in its final mounting place. The simplest calibration approach is 2D calibration, but it works only if the system is approximately level, and requires rotating the entire assembly (tractor and all) 360 degrees about the vertical axis, one or more times, in order to estimate the offsets. This method is actually used on large ships, and is built into some handheld GPS units that have a magnetometer.

With a consumer grade magnetometer you will be doing well to get +/- 3 degrees accuracy.

See https://www.vectornav.com/resources/ine … alibration

For very accurate navigation in the field, most people use RTK GPS guidance systems.

Thank you for the response.

Basically all I really need is something that can tell me a course over ground.

For instance, if I go “North” along a fence line for 2000 feet I then set over to the east by 50 feet maybe and then go South. I need that South pass to be as Parallele to the North pass as possible.

Something like a directional gyro/heading indicator would be fine as I don’t actually need a compass.

On my first pass I could set it to “0” for Nosth, or any direction for that matter, and then when I turn south it would show me “180” or if I turn East it would show 90.

A compass in my phone has been highly inaccurate as has been a handheld GPS with compass (Garmin Etrax).

My friend tried a GY-521 MPU-6050 3 axis gyroscope and accelerometer.

It would show a turn from north to east of ~90 degrees but turning it back to North it was way off.

Anyway, this is all a project to try and get some type of a guidance, COG device for smaller tractors at a reasonable price!!

A compass in my phone has been highly inaccurate as has been a handheld GPS with compass (Garmin Etrax).

Of course. Both need to be calibrated in place by the method I mentioned.

Ok, thanks. That was one thing I had not tried yet.

I did calibrations just standing out in an open area. Have been meaning to try the calibration while seated on the tractor!

Unfortunately, the entire tractor, with permanently mounted magnetometer, has to be rotated in a circle.

Who knows, maybe a nearby auto dealer has a show turntable that could handle the tractor.

I was thinking about driving in a circle but maybe that’s not good enough!

Wait till the pond freezes over and drive the tractor into the middle.

Cut a circumference suitable to hold the weight of the tractor in the ice.

Rotate the tractor on its ice turntable and perform the calibration.

Extra credit: use the tractor’s own takeoff power.

In the spring, use the newly calibrated compass to direct the recovery crane crew to the farm to remove the sunken tractor from the muck.

Exactly what would happen!!

Once we try out the cheap GPS thing my friend ordered we may look at seeing what your RTK base station might be able to offer!

The first rendition didn’t have ‘suitable to hold the weight of the tractor’ written in Step 2 and the crane crew had to rely on directions from an uncalibrated compass that spring.

I was thinking about driving in a circle

That is certainly worth a try! Let us know how well it works.

A friend of mine worked on a 260 ft oceanography research vessel and described how the captain would turn the entire thing around a couple of times using the thrusters, just to calibrate the compass.

I had a old truck with a electronic compass built in. I would periodically have to drive it in a circle a few time to recalibrate the compass in that. The traffic circle down the street worked just fine.