LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control a gy-271/QMC5883L compas sensor using myrio labview?

MyRio-1900

Labview 2019

0 Kudos
Message 1 of 3
(418 Views)

The Good News is that the gy-271 chip is an inexpensive 3-axis magnetic compass sensor that can easily be interfaced to the myRIO as it is a 5V I²C device that needs only 5 connectors to interface to the myRIO.

 

I'm currently using the myRIO and its FPGA to sample from 16 A/D SPI chips (they have I²C versions as well, but I was more familiar with SPI).  Fortunately, we had the specs for the Chip, so we could implement the SPI protocol to configure the A/D, and programmed the Chip by sending the SPI commands it needed and simply MISO'ed 16 channels of data sampled at 10 kHz into the myRIO, where they were DMA'ed up into a Timed Loop (that clocked the A/D) and were Network-Streamed to the Host PC for saving to disk.

 

So far, however, I've not found specs for the gy-271 chip -- most kits wire it to an Arduino and make you write code for Arduino libraries that do all the fun stuff with SPI or I²C for you, then make you use VISA to read the data from Arduino.  What's the fun of doing that?  

 

Bob Schor

 

P,S.  You do realize, I hope, that this chip is a 3D magnetic compass, which is going to require some additional math to help you determine orientation (you need to know where "magnetic north" is, which depends on where you are).  I recall around a decade ago people were making chips with 3D linear accelerators (very good for determining "which way is up", among other things) + 3D angular accelerometers + (I think this is right, but it was 10 years ago ...) a 3D magnetic compass.  Don't remember how it was interfaced ...

0 Kudos
Message 2 of 3
(347 Views)

do you have the vi compass program for gy-271 myrio?

0 Kudos
Message 3 of 3
(327 Views)