GY-26-USART is a low cost digital compass module. The working principle is utilizing magnetoresistive sensor sensing the Earth's magnetic field component to get an azimuth angle. It communicates with host computer through UART. Output format is ASCII. Solid state compass design, means stable operation, high accuracy and advanced hard iron compensation function. It can overcome surrounding magnetic interference. Baud rate is optional.
The product has three working modes: Normal mode, continuous mode and calibration mode.
You can choose UART or IIC communication to use it.
We have little information on this module, have something to contribute, drop us a note.
ᄋ ᄆ5 degrees heading accuracy ᄋ Advanced hard iron calibration ᄋ Very low operating voltage3~5VDC) ᄋ DC single supply operation ᄋ Small size (26.5mm X26.5mm X 11.5mm)
1. Declination Angle
It is the angle between magnetic north and true north. Declination angles of different place are
different, even at the same place declination angles varies with the time. When we use compass for
navigation, we get directions relative to magnetic north. So we can get directions relative to true
north through declination angle compensation. For example, the current direction counted by
compass is north by east 30 degrees and the declination angle is 5 degrees. So the direction relative
to true north is 35 degrees (30+5=35).
2. Installation Angle
There is an arrowhead on the compass module and its used to denote direction. When installed, it
requests that forward direction of the object surveyed is consistent with the arrowhead. So the
direction counted by the compass is the right direction. If installing direction is not consistent with the
arrowhead, there is an included angle and it is the deviation angle. Only after we compensate for it, the
compass outputs the true direction.
3. Calibration
Its also called hard iron compensation. All digital compasses must be calibrated before being used.
Once hard iron conditions chang, the magnetic field conditions will be change too. At this time,
angle information counted by the compass will be inaccurate. In order to remove the influence, its
necessary to calibrate the compass.
4. Calibrating methods and functions
When magnetic field changes, angle information counted by compass will be inaccurate. This time it is
necessary to calibrate the compass to remove the influence.
Methods:
Send 0xC0 command, and then rotate the compass two times slowly, equally and flatly, slowly, fast will not work.
One cycle needs more than one minute. Then send 0xC1 command to finish calibration.
1. Parameters
Baud rate: 9600bps
Parity bit: N
Data bits: 8
Stop bit: 1
2. Output format of the module,8 bytes included in each frame
(1) Byte0:0x0D (ASCII: enter)
(2) Byte1:0x0A (ASCII: new line)
(3) Byte2:0x30~0x33 (ASCII: hundreds of angle 0~3)
(4) Byte3:0x30~0x39 (ASCII: tens of angle 0~3)
(5) Byte4:0x30~0x39 (ASCII: bits of angle 0~3)
(6) Byte5:0x2E (ASCII: decimal point of angle)
(7) Byte6: 0x30~0x39 (ASCII: decimal of angle)
(8) Byte7: 0x00~0xFF (calibrate sum)
Byte7= the lower 8 bits of (Byte0+ Byte1+ Byte2+&&Byte6)
Example: <0x0D-0x0A-0x33-0x35-0x39-0x2E-0x36-0x1C> = 359.6
3 Commands sent to the module:
(1) 0x31: measure the angle (return the value of the angle)
(2) 0xC0: start calibration
(3) 0xC1: end calibration
(4) 0xA0-0xAA-0xA5-0xC5: reset to factory settings
(5) 0xA0-0xAA-0xA5-IIC_ADDR: change the IIC bus address
(6) 0x03-DECL_high: set the high 8 bits of declination angle
(7) 0x04-DECL_low: set the low 8 bits of declination angle
Example1: send 0xC0 to the module, return 0x0D
<0x0D-0x0A-0x30-0x30-0x30-0x2E-0x30-0x05>, which means calibration successful.
Example2: send 0x030x000x040x64 sent to the module.
<0x0D-0x0A-0x30-0x30-0x30-0x2E-0x30-0x05> which means the declination angle been
changed to 10.0 degrees successfully.
Address information:
When using the IIC communication, the module is similar to a 24C04EEPROM. The communication is
very simple. The addresses of the data in the module are shown in the following table.
Address in the module and its meanings:
0x00 not used
0x01 high 8 bits of the angle
0x02 low 8 bits of the angle
0x03 high 8 bits of the declination angle
0x04 low 8 bits of the declination angle
0x05 not used
0x06 not used
0x07 Level value calibration
Commands(sent to the module through IIC)
Command function:
0x00+ 0x31 angle measure
0x00+ 0xC0 Start calibration
0x00+ 0xC1 End calibration
0x00+0xA0+0xAA+0xA5+0xC5 Reset to the factory settings
0x00+0xA0+0xAA+0xA5+IIC_ADDR Change the IIC address
0x03 + DECL_HIGH Change the high 8 bits of declination angle
0x04 + DECL_LOW Change the low 8 bits of declination angle
Change the IIC address
The IIC address of the module can be changed. The default factory address of the module is
0xE0.When powering the module, the Led blinks according to its address.
Address Blinking times:
0xe0 0
0xe2 1
0xe4 2
0xe6 3
0xe8 4
0xea 5
0xec 6
0xee 7
0xf0 8
0xf2 9
0xf4 10
0xf6 11
0xf8 12
0xfa 13
0xfc 14
0xfe 15
Command
Send Xget angle
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
0x0D 0x0A 0x30~0x33 0x30~0x39 0x30~0x39 0x2E 0x30~0x39 0x00~0xFF
Send Xget temperature
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
0x0D 0x0A 0x30~0x33 0x30~0x39 0x30~0x39 0x2E 0x30~0x39 0x00~0xFF
Send X#Calibration
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
0x0D 0x0A 0x30 0x30 0x30 0x2E 0x30 0x05
Send X#finish Calibration
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
0x0D 0x0A 0x30~0x33 0x30~0x39 0x30~0x39 0x2E 0x30~0x39 0x00~0xFF
Send X!X!!X!X#Restoring Factory Calibration
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
0x0D 0x0A 0x30 0x30 0x30 0x2E 0x30 0x05
Send XCompass bearing high 8bit
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
0x0D 0x0A 0x30 0x30 0x30 0x2E 0x30 0x05
Send XCompass bearing low 8bit
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
0x0D 0x0A 0x30 0x30 0x30 0x2E 0x30 0x05
1. All the parameters of the module are tested with the standard 5V power supply, so we advise you to use the
power with little to no ripple.
2. When using the module, it has to be kept level so that it can get the accurate results.
3. The module can be connected with SCM or some other device with the right interface, but it can not be
connected to the serial port of the computer directly (TTL level ins and outs not RS232). However, you can use a USB to serial module to
connect it to the computer.
Validate your login
Sign In
Create New Account