Development of Digital Compass Based on AVR Microcontroller and MEMS Accelerometer- Magnetometer Module LSM303DLHC

2019;
: pp. 12 - 26
1
Lviv Polytechnic National University, Ukraine
2
Lviv Polytechnic National University, Ukraine
3
Lviv Polytechnic National University, Ukraine
4
Lviv Polytechnic National University, Ukraine

In the paper, the digital compass based on AVR  microcontroller has been developed using MEMS accelerometer-magnetometer LSM303DLHC. The structure and hardware of the digital compass have been developed. The calibration algorithms of the accelerometer and magnetometer of the LSM303DLHC module have been described. The calculation algorithm of the pitch and roll angles has been described. The heading calculation algorithm of the digital compass without tilt compensation and with tilt compensation has been described. The operation algorithm and embedded software of the digital compass have been developed. The model and prototype of the digital compass have been created. The simulation and operation test of the developed digital compass have been performed.

  1. Electronic resource: https://www.st.com/content/st_com/en/products/mems-and-sensors/e- compasses.html
  2. Electronic resource: https://www.memsic.com/magnetic-sensors/ 
  3. Compass.” [Online]. Available: http://en.wikipedia.org/wiki/Compass[2] “Lodestone”. [Online] .Available: http://en.wikipedia.org/wiki/Lodestone
  4. Electronic resource: https://en.wikipedia.org/wiki/Earth%27s_magnetic_field
  5. Electronic resource: https://www.livescience.com/32732-how-does-a-compass-work.html
  6. Grygorenko V., “Cypress application note – magnetic compass with tilt compensation-an2272”. [Online].Available: http://www.cypress.com/?docID=221.
  7. Application note AN4248: “Implementing a Tilt-Compensated eCompass using Accelerometer and Mag-netometer Sensors”, 2012, http://cache.freescale.com/files/sensors/doc/app_note/AN4248.pdf.
  8. Application note AN3192: “Using LSM303DLH for a tilt compensated electronic compass” https://www.pololu.com/file/0J434/LSM303DLH-compass-app-note.pdf.
  9. Electronic resource: https://www.st.com/en/mems-and-sensors/lsm303dlhc.html
  10. Electronic resource: https://www.st.com/resource/en/datasheet/DM00027543.pdf