Shop OBEX P1 Docs P2 Docs Learn Events
Reading data from a SignalQuest Inclinometer — Parallax Forums

Reading data from a SignalQuest Inclinometer

geometrixgeometrix Posts: 27
edited 2007-05-23 15:23 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-22 16:29
    Hello,

    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
  • PARPAR Posts: 285
    edited 2007-05-23 02:05
    geometrix said...
    All,

    I am trying to interface a SignalQuest Inclinometer with a Parallax BS2px.
    ...
    See http://www.signalquest.com/datasheets/SQ-SI-360DA_MEMS%20Inclinometer%20Datasheet.pdf·for more information regarding the SQ-SI-360DA
    It's not clear to me how this device connects to the Stamp (as contrasted to connecting it to a PC, which seems to be what the data sheet describes)?

    PAR
  • geometrixgeometrix Posts: 27
    edited 2007-05-23 12:18
    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
  • PARPAR Posts: 285
    edited 2007-05-23 15:23
    geometrix said...
    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
    Yes, but how do you connect the breadboarded 4 pins of the inclinometer to the BS2px? I.e., how are the inclinometer signal (Tx, Rx) line voltages and timing handled by the BS2?

    PAR·
Sign In or Register to comment.