Categories

Wednesday, November 26, 2014

Windows IoT on Galileo – Connecting Adafruit 10DOF IMU Breakout Part - 1


This blog explain you on how to connect the Adafruit 10DOF IMU (A combo board provides 3-axis gyro, 3-axis compass, barometric pressure and temperature sensors) to Galileo Gen 1 board using Windows IoT. I bought this sensor board for some other purpose but I found it is also Arduino compatible, so I tried with Galileo and succeeded.

Components
  • ·         Intel Galileo Gen1
  • ·         Visual studio 2013 with Windows IoT SDK (Visit: windowsondevices.com for more details) and Galileo C++ SDK NuGet Package is required.

  
Interfacing
10DOF IMU board is connect to Galileo through I2C interface. It needs 5V power and SDA and SCL is also 5V pins. See the below block diagram for the connectivity.

Figure 1) Galileo gen 1 with Adafruit 10 DOF IMU wiring


Figure b) Galileo Gen 1 with 10 DOF IMU module

How to make it work
Since this module has the combination of sensors, you can find the each sensor source code separately from the Adafruit’s github. Here is the links,
https://github.com/adafruit/Adafruit_Sensor (only Adafruit_Sensor.h is required)

Building
I created a “Galileo Wiring App” application and included the required .cpp and .h files, which I downloaded from the above listed Adafruit github. I did few modification to resolve some compilation errors and just mapped the code from tester.pde file to main.cpp of my application since it is following the same ArdunioSketch.
This application read the data from sensors and print it on serial port. I used the debug UART for printing messages. Since it is mapped for kernel debugger you have to do some changes in bcd file as mentioned in the topic Allow UART to be used for HardwareSerial (This will change it from kernel debugger use)”  to use it as a serial port in OS. This port is COM2, HardwareSerial Serial1 Object is mapped to COM2. I changed the source code to use this port.

I also noticed that the carriage return (\r) is missed in the println() and caused the printed messages unaligned. So I just added the ‘\r’ on the below code in the path “\packages\Microsoft.IoT.Galileo.Arduino.1.0.6\build\native\include\print.h”. Of course it is part of the “Galileo C++ SDK” package.



Testing
Set the serial port terminal application (I am using Tera Term) for the baud rate 115200, 8bit, Parity N, Stop bit 1 and Flow control as N. Run the application from Visual studio through remote debugger. Here is the output on Tera Term.

Figure 3) Application sending sensors data to serial port continuously


Source code
You can find the source code of this application from the below codeplex link.
I am a WinCE guy and Of course this my first experience with Galileo/Ardunio wiring application development and it took less than an hour for this work. It is really a cool stuff. Enjoy  !!!.




No comments:

Post a Comment