CTi Dynamic inclinometer interfacing with an Arduino Uno

CTi Inclinometer Sensor Interfacing with an Arduino Uno

Good day everyone,

I am busy designing a vehicle data collection system for my final year project and might need help regarding an inclinometer sensor (CTi TILT – 57A Dynamic Dual-Axis Inclinometer) to measure Roll & Pitch angles in degrees, accelerations, angular velocities, Internal temperature etc. But most importantly the Roll & Pitch.

I bought a TILT-57A dynamic inclinometer that communicates through USB interfacing using ASCII protocol. From there I have plugged into a male USB cable end from which I connect my four cables directly to the Arduino. (SPI protocol) but I'm still new to Arduino. I also use an external power supply to power the Inclinometer, since the Arduino does not supply enough current.

I am not sure how I can program and interface further so that I can at least see some data read from the sensor in the serial monitor using an Arduino uno. I have tried SoftwareSerial but I am too unfamiliar with Arduino software in general. I don't think I know what I am doing.

Here is some information on the serial interface and data format if it helps:

The TILT-57A uses the following ASCII format, very similar to the widely used NMEA 0183 protocol, for data output:
Inclinometer message: $CSEAG,U,αX,αY,AX,AY,AZ,GX,GY,GZ,TCC*

Which:
AX,AY,AZ: X, Y and Z accelerations in milli g (three-axis accelerometer data)
GX, GY, GZ: X, Y and Z angular velocities in deg/s (three-axis gyroscope data)
αX, αY: Roll & Pitch angles in degrees
T: Internal temperature in degrees Celsius
U: Device unit number
CC: Checksum (Two ASCII characters)
: Carriage return, and line feed characters

Within the inclinometer message, the temperature, accelerometer, gyroscope, or angle portion of the message may be turned on or off. See Section 8 for specific commands.

The inclinometer message may run in full at an output data rate of up to 500 Hz. With only 2 of the 3 data message portions turned on (accelerometer, gyroscope or angles), the inclinometer message may be run at an output data rate of up to 1 kHz. With only 1 of the 3 message portions turned on, the inclinometer message may be run at an output data rate of up to 2 kHz. When running at 1kHz and 2kHz, it is recommended that the other message portions (temperature and unit number) be turned off if they are not needed.

Is there a simplistic program that anyone can help me with just to extract the data and maybe print the lines in the serial monitor for example:
$CSEAG,1,+006.756,-003.813,+0116.53,-0065.42,+0981.42, ,+000.21,-000.16,-000.27,+29.7*68

I have already used the PC software created for the sensor (WinCTi-Tilt-57®), but my main goal is to be able to read and extract the data from the sensor to the Arduino Uno.

I would like to understand this better though. I am having difficulties writing a code to just basically read any data being sent from the sensor with an Arduino Uno, but the Arduino reads nothing.

Datasheets:

Code:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(8, 7); // RX, TX

void setup() 
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) 
  {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  //Serial.println("Failed");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Arduino Ready");
}

void loop() 
{ // run over and over
  if (mySerial.available() > 0) 
  {
    Serial.println(mySerial.read());
  }
  if (Serial.available()) 
  {
    mySerial.println(Serial.read());
  }

  delay(1000);
}

You probably need a 'USB host' shield or an Arduino with USB host capability.

Do you currently have an Uno or something else?

The inclinometer data sheet says that several different interfaces are available. You need to select the correct one and connect the Arduino and the sensor with appropriate wiring.

To use the sensor with Arduino and SoftwareSerial, the UART interface must be selected and correctly wired to the selected software RX and TX pins and ground. Voltage levels must be the same as the processor used (5V for the Arduino Uno).

This does not make sense. SPI has nothing to do with USB or UART serial.

From there I have plugged into a male USB cable end from which I connect my four cables directly to the Arduino. (SPI protocol)

I am currently setting up all my sensors up with an Arduino UNO, but for my final product I will be using the LattePanda Alpha to control and connect all my sensors together, which I think has USB Host capabilities.

I understand, thanks for directing me into the right direction, I will let you know if I'm starting to see the light at the end of the tunnel. I will do some research on how to select the UART interface.

And for the Voltage levels, the Arduino supplies 5V, 40mA of current, where the inclinometer is rated for 5V, 80mA of current, therefore I am injecting power from an external power supply to be able to power up the sensor (rated at 5V, 1A).

That is the absolute maximum that a digital output pin can supply, and most people recommend 20 mA or below.

The Arduino 5V output can supply 80 mA or more to power the sensor, unless is is powered through the barrel jack by more than about 10V.

If you use an external power supply, don't forget to connect all the grounds.

Noted! Thanks for the wisdom.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.