LSM303AGR eCompass
The LSM303 Multifunction “eCompass” sensor combines an Accelerometer and a Magnetometer. We’ll test it out and build a small compass with an OLED display.
Article with code: https://dronebotworkshop.com/lsm303agr
More articles and tutorials: https://dronebotworkshop.com
Join the conversation on the forum: https://forum.dronebotworkshop.com
Subscribe to the newsletter and stay in touch: https://dronebotworkshop.com/subscribe/
Today, we’re checking out an inexpensive yet useful sensor from STMicroelectronics and Adafruit, the LSM303AGR “Multifunction eCompass Sensor”. This little gem is both an accelerometer and a magnetometer, enabling it to sense direction, speed, and motion.
This device is actually two sensors in one, and you can program them independently. Both sensors are “MEMS” (Micro-Electro-Mechanical-System) sensors, and I’ll show you how they operate and what Adafruit libraries can be used with them.
I’ll also show you how to calibrate the Magnetometer to increase its accuracy. And we’ll run some sample sketches to make sure everything is working correctly.
After that, we’ll finish the video by building a compass or “eCompass” with an OLED display.
Here is the Table of Contents for today’s video:
00:00 – Introduction
01:23 – LSM303AGR Module
04:48 – LSM303AGR Hookup
05:34 – Using the Accelerometer
11:34 – Introducing the Magnetometer
15:14 – Calibrating the Magnetometer
22:20 – Using the Magnetometer
25:17 – Simple Compass
27:42 – OLED Compass
34:22 – Conclusion
This sensor is perfect for robotic and navigation applications, and as you’ll soon see, it is very easy to use.
I hope you enjoy the video!
Bill
source








