More Steps ahead…

Well, as most of my friends know; I’ve moved from ITWorx to TEData, but this didn’t cause my personal plans and agenda to shift or drift, however, it imposed some delays on it a bit…

Anyway, two months ago, a friend of mine has put my hands on one of a kind board, that holds a microcontroller along with 4 other chips, triple-axis accelerometer, triple-axis magnetometer, dual-axis gyroscope, and a single-axis gyroscope…

The microcontroller exports the output from the sensors using the serial port (FTDI 3.3V) …

Having this, I need to:

  • Power up the board
  • Interface the board with the RS232 PC serial port
  • Parse the accelerometer output to something meaningful
  • Plot the board orientation based on the accelerometer output
  • Parse the gyroscope output to something meaningful
  • Add heading to the previously drawn plot relative to the initial heading (based on the gyroscope)
  • Use the accelerometer/gyroscope information to tilt-compensate the magnetometer readings and obtain the magnetic heading of the board

Me and my best friend managed to build a level shifter to allow the board to interface with RS232 serial port, and even power it up with the DTR pin from the serial port, eliminating the need for an external power supply for the board…

Level Shifter:

13072010252 13072010257

The board, and the board mounted on the level shifter:

21072010260 21072010261

I know, the board it UGLY, but hey, the last time I built a circuit was almost 11 years ago, I didn’t do any soldering nor PCB design since then…

Anyway, the accelerometer always gives a reading even while not moving at all, those readings represent the static acceleration resulting from earth’s gravity, and it should always measure 9.8m/sec/sec …

So,to parse the output from the accelerometer, I used vector analysis to obtain the board tilting relative the ground…


Considering the output from the accelerometer as a vector g=(X,Y,Z), it has a magnitude of mag

Assuming the angles between x-axis, y-axis, z-axis and the gravity vector are theta, phi and gamma respectively, then:

theta phi gamma

Built a python script to plot the platform (inspired by a video I’ve seen on youtube) …




This is totally different from the works of these guys, it doesn’t require re-programming of the microcontroller, it processes all the data on the PC, and the way it calculates and plots the data it completely different …

However, I’ve learned a lot by reading their code …

I’ll keep you posted with the updates as soon as there’s anything new…



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: