Reading data from a SignalQuest Inclinometer
geometrix
Posts: 27
All,
I am trying to interface a SignalQuest Inclinometer with a Parallax BS2px. I am a novice and I do not know how to parse the bytes from the inclinometer. In dual axis mode, the SignalQuest SQ-SI-360DA Solid State MEMS Inclinometer serial packet format is:
byte 2: X tilt (high byte, 16-bit unsigned integer)
byte 3: X tilt (low byte, 16-bit unsigned integer)
byte 4: Y tilt (high byte, 16-bit unsigned integer)
byte 5: Y tilt (low byte, 16-bit unsigned integer)
In pseudocode, I really want to do the following:
FOR I=1 TO 10
··READ·X TILT HIGH
· READ X TILT·LOW
· READ Y TILT HIGH
· READ Y TILT LOW
· PAUSE 500
NEXT I
I am going to end up storing the data in an array and then calculating a moving average between the initial data and the next time I go through this FOR/NEXT loop....and so on and so forth.
How do I read the angle information from the inclinometer?· Once I read the X tilt high, X tilt low, Y tilt high, and Y tilt low, do I need to do any special calculations in order to acquire the pitch and roll in degrees?
See http://www.signalquest.com/datasheets/SQ-SI-360DA_MEMS%20Inclinometer%20Datasheet.pdf·for more information regarding the SQ-SI-360DA
Thanks,
Neal
I am trying to interface a SignalQuest Inclinometer with a Parallax BS2px. I am a novice and I do not know how to parse the bytes from the inclinometer. In dual axis mode, the SignalQuest SQ-SI-360DA Solid State MEMS Inclinometer serial packet format is:
byte 2: X tilt (high byte, 16-bit unsigned integer)
byte 3: X tilt (low byte, 16-bit unsigned integer)
byte 4: Y tilt (high byte, 16-bit unsigned integer)
byte 5: Y tilt (low byte, 16-bit unsigned integer)
In pseudocode, I really want to do the following:
FOR I=1 TO 10
··READ·X TILT HIGH
· READ X TILT·LOW
· READ Y TILT HIGH
· READ Y TILT LOW
· PAUSE 500
NEXT I
I am going to end up storing the data in an array and then calculating a moving average between the initial data and the next time I go through this FOR/NEXT loop....and so on and so forth.
How do I read the angle information from the inclinometer?· Once I read the X tilt high, X tilt low, Y tilt high, and Y tilt low, do I need to do any special calculations in order to acquire the pitch and roll in degrees?
See http://www.signalquest.com/datasheets/SQ-SI-360DA_MEMS%20Inclinometer%20Datasheet.pdf·for more information regarding the SQ-SI-360DA
Thanks,
Neal
Comments
The device has both Serial and analog outputs. I would recommend using the Serial output for now. Seems that is done through pin 2 (TX) and pin 3 (RX) with pin 1 being the ground (common). It appears to send a 10 byte packet after warm-up to indicate it is ready. These packets are going to be the key. I would probably send them into Scratch Pad RAM using the SPSTR formatter on the SERIN and for 10 readings at 10 bytes that would be 100 bytes of the Scratch Pad RAM (you have 126 on a BS2px). You could then do the calculations across all 10 readings by offset and drop the results into a variable before moving to the next parameter. The datasheet should help with the specifics or the serial packets. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
PAR
This device can be hooked up to a PC with a cable and an executable LabView file for $150. The inclinometer has 18 pins. I will likely only need to use 4 pins: 1, 2, 3, and 5 (ground, transmit,receive, and Vcc). I can press the inclinometer chip into the breadboard on the Board of Education and use only those 4 pins.
--Neal
PAR·