FreeIMU: an Open Hardware Framework for Orientation and Motion Sensing

FreeIMU is an ongoing research project which aims to design Open Hardware 9/10 DOM/DOF Inertial Measurement Units as well as easy to use Orientation and Motion Sensing libraries, built on top of the Arduino platform.
The goal of the FreeIMU Framework is to simplify the development of projects based upon the most powerful and new consumer grade inertial, magnetic and pressure sensors.

FreeIMU version 0.2 (left) and version 0.1 (right)

The main application of FreeIMU is orientation sensing: by reading the data from the various sensors is possible to compute precisely the orientation of FreeIMU in the space. Recent boards also feature an high resolution barometer allowing to precisely track the device altitude. This can be useful in many applications: human-computer interaction device prototyping, flying machines, robots, human movement tracking and everywhere orientation sensing is a key aspect.

As FreeIMU breakout the sensors interrupt pins, it's also possible to detect per axis single and double taps, free fall as well as activity or inactivity. This makes FreeIMU a very good choice for Human-Computer devices prototyping. Interrupts pins are also very useful if you are into interrupt based reading of the sensors, useful to develop high frequency interrupt based sensor reading.

Video presentation of FreeIMU

Older video presentations: FreeIMU v0.3, FreeIMU v0.1 and 0.2.

A true Open Hardware project

Open Hardware Logo

FreeIMU is a true Open hardware, released under the CC-BY-SA. You are free, actually encouraged, to use it for any purpose, to study and modify its designs, to make your own copies of FreeIMU and even sell your own FreeIMU based hardware. But, you will have to share your designs based on FreeIMU keeping attribution and sharing them using the same libre license.

On FreeIMU repository (see development section below) and from the downloads on this page, you have access to everything you need to build your own FreeIMU board. You have access to the schematics, the PCB designs and even the bill of material so that you can build your own FreeIMU.

Moreover, FreeIMU has been designed using KiCAD, an excellent libre PCB design software, so you don't have to rely on proprietary software to study or modify FreeIMU.

Getting FreeIMU

An assembled, tested and ready to use FreeIMU board can be bought from:

The FreeIMUs boards bought from the above shops financially support the project. The boards have been produced and assembled in Italy by reasonably paid workers in a safe environment in respect with European and Italian laws.

Build your own FreeIMU

If you have SMD soldering experience (or if you are up for experimentation) you can build your own FreeIMU. From the downloads below you have access to all the designs needed to have your FreeIMU PCB manufactured.

You can get cheap PCB with awesome quality from Dorkbot PDX and order the various components needed from you favorite electronic distributor: the Bill of Materials (BOM) files will tell you exactly which components you'll need for your FreeIMU.

The are various ways of soldering the board. If you only need a couple of boards done, tack flux, solder wire and hot air reflow station are enough to build your boards (Remember not to use hot air over the pressure sensor). See this video for good instructions. In case you are building more units, an SMD stencil with solder paste is the suggested method.

In case you need help, just post a comment below.

FreeIMU versions

FreeIMU version 0.1

FreeIMU v0.1

WARNING: Discontinued due to the phasing out of the HMC5843.

FreeIMU v0.1 is the simplest FreeIMU available. It contains the ADXL345 accelerometer, the ITG3200 gyroscope and the HMC5843 magnetometer, their respective capacitors and an additional 10uF capacitor to help keeping the power to the sensors stable. It doesn't have any voltage regulator nor any level translator so it needs to be connected to a 3.3V power source and the I2C level signals have to be 3.3V. When used on a 5V microcontroller, an I2C level converter and a voltage regulator are needed.

FreeIMU version 0.2

FreeIMU v0.2

WARNING: Discontinued due to the phasing out of the HMC5843.

FreeIMU v0.2 has the same sensors (ADXL345, ITG3200 and HMC5843) and size of v0.1 but I added an integrated voltage regulator (MIC5205) and a logic level converter (PCA9306). With these components it's extremely simple to use FreeIMU v0.2 on 5V boards like 16MHz Arduinos, just connect FreeIMU to the 5V, GND, SDA and SCL on Arduino and you are ready to go!

IMPORTANT: in version 0.2 sent to production there is a bug in the drill size of the connectors. The drill hole should have been 0.04" while it is actually 0.032". Consequence of this is that only rounded pins will fit inside the drill and standard squared pins won't fit. This is not really a problem as the big oval pad makes actually possible to use 90 deg squared pin arrays using the pad as a smd connector. The Kicad sources above and the gerbers marked with "Fixed" have this issue fixed. However they haven't been tested on production so double check them before send them to fabrication.

FreeIMU version 0.3

FreeIMU v0.3

FreeIMU version 0.3 replaces the accelerometer and magnetometers used in v0.1 and v0.2 with the ADXL346 as accelerometer and the HMC5883L as magnetometer. The gyroscope is still the ITG3200. FreeIMU v0.3 integrates a voltage regulator (MIC5205) and a logic level translator (PCA9306) as well as all the pullups resistors needed.

FreeIMU version 0.3.1

FreeIMU v0.3.1 is a minor revision of FreeIMU v0.3. There have been some corrections in the silkscreen and the footprint of the HMC5883L have been made slightly bigger to make assembly easy. Everything else is just as in FreeIMU v0.3.

FreeIMU version 0.3.5

FreeIMU 0.3.5 top view

FreeIMU 0.3.5 is a small (22x20 mm) 9 degrees of measurement IMU MARG sensor featuring the BMA180 accelerometer, the ITG3200 gyroscope and the HMC5883L magnetometer.

FreeIMU 0.3.5 also has two additional subversions, FreeIMU 0.3.5_MS which features the MS5611-01BA high resolution pressure sensor and the FreeIMU 0.3.5_BMP which features the BMP085 pressure sensor.

FreeIMU v0.3.5 has an integrated voltage regulator (MIC5203) allowing you to plug it from 3V3 to 16V providing you 80mA of current which you can use to chain it to other 3V3 sensors or devices. By using the MIC5203, no tantalum caps are used in the whole design. Tantalum is not a good idea socially and environmentally.

The board has integrated 2K2 pullups resistors (which can be enabled or disabled by means of a solder switch) but doesn't have an integrated logic level converter. We decided to not include the LLC (which is present in my FreeIMU v0.2 and v0.3) as it adds considerable complexity in the design and schematics without being strictly necessary. In fact, given a properly configured software, it's a redundant part. Moreover the upcoming development of many 3V3 based control boards (eg: Multipilot 32) makes adding an LLC not a very far-seeing choice.

The IMU board is however compatible with my LLC board which can be stacked above the IMU, so that you can easily add the LLC protection keeping the amount of additional wires at the minimum.

The board, a part from the usual power and I2C connectors, breaks out the interrupt pins for all the three sensors. This should empower software developers to design interrupt based sensor reading and sensor fusion algorithms (opposed to the currently common polling based approach) which should provide possibility to shorten the cycle path of our algorithms.

FreeIMU version 0.3.5_MS

FreeIMU v0.3.5_MS

FreeIMU v0.3.5_MS is a variation of FreeIMU v0.3.5 which features the BMA180 accelerometer, the ITG3200 gyroscope, the HMC5883L magnetometer and the MS5611-01BA high resolution pressure sensor.

The board comes with a voltage regulator (MIC5203) and 2K2 pullups optionally disabled by using of a solder switch.

FreeIMU version 0.3.5_BMP

FreeIMU v0.3.5_BMP top view

FreeIMU v0.3.5_BMP is a variation of FreeIMU v0.3.5 which features the BMA180 accelerometer, the ITG3200 gyroscope, the HMC5883L magnetometer and the BMP085 pressure sensor.

The board comes with a voltage regulator (MIC5203) and 2K2 pullups optionally disabled by using of a solder switch.

FreeIMU version 0.4

FreeIMU v0.4.1

FreeIMU v0.4 features the MPU6050 gyroscope+accelerometer, the HMC5883L magnetometer and the MS5611-01BA high resolution altimeter.

The magnetometer is attached to the AUX I2C bus of the MPU6050 thus allowing it to be read directly by the MPU6050.

FreeIMU library

FreeIMU can be easily used on Arduino compatible boards using the Arduino FreeIMU library which implements sensor fusion MARG orientation filter enabling you to do easy and straightforward orientation sensing.

FreeIMU library - 2012/11/22
Use Arduino 1.0.1 IDE or later version.

Install the libraries as explained in the Arduino Libraries Reference section Contributed Libraries.
The FreeIMU library now supports all the versions up to v0.4. By default it's configured to be used on v0.4. In order to use on different boards, open the file FreeIMU.h and uncomment the correct version of your board.

The FreeIMU library also supports the following 3rd parties boards:

  • Sparkfun IMU Digital Combo Board - 6 Degrees of Freedom ITG3200/ADXL345 SEN-10121
  • Sparkfun 9 Degrees of Freedom - Razor IMU SEN-10736
  • Sparkfun 9 Degrees of Freedom - Sensor Stick SEN-10724
  • Sparkfun 9 Degrees of Freedom - Sensor Stick SEN-10183
  • DIYDrones ArduIMU+ V3
  • Generic MPU6050 Breakout boards (eg: GY-521, SEN-11028 and other MPU6050 wich have the MPU6050 AD0 pin connected to GND.)

Note for FreeIMU v0.1 and 0.2 users: from April 2011 the default magnetometer configuration is for HMC5883L. In order to use the library with HMC5843 (v0.1 and v0.2) edit the file HMC58X3.h and uncomment the line #define ISHMC5843.

FreeIMU Processing Programs
The FreeIMU library comes with Processing visualization demos. In order to use them, Download and install Processing. Copy the folders within the processing folder of the FreeIMU library archive into your Processing sketchbook.
Remember to change the Serial port address in the Processing code to match the address used by arduino on your system.

Ports to Other platforms

FreeIMU library on PIC 24 microcontroller by Hari Nair hair [dot] nair [at] gmail [dot] com. Author notes: 1. assumes a 6MHz crystal is attached and x4PLL internally, so Fosc = (6x4)/2 = 12 Mhz 2. trivial to use the internal FRC oscillator, instead of FNOSC_PRIPLL in the configuration words, use FNOSC_FRCPLL. This will give you Fosc = (8x4)/2 = 16MHz, but of course with less precision. 3. transmits ascii quaternion data at 38400baud. This does slow down the sampling rate. Without the quaternion print, the code completes in less than 10mS, so the sampling rate is exactly 100Hz as set by the timer.

FreeIMU library on NXP LPC1343 Cortex m3 processor by Hari Nair hair [dot] nair [at] gmail [dot] com. More details and possibility to contact the author on the FreeIMU community development forum.

Have you ported the FreeIMU library to other platforms? Please let me know and I'll list your work here!


A calibration GUI application is available. The software is currently in alpha state, however many people are already using it.

The calibration, when properly executed, drastically improve the orientation sensing performance of the FreeIMU framework. If you are experiencing drifting or inconsistent results, your sensors may need to be calibrated using the Calibration GUI.


There is now a FreeIMU Community website, which has been set up to become the central point of interaction between users of the FreeIMU framework. This is the place where you can get help, join others in developing new features, discuss IMUs applications and much more.

Previously we used FreeIMU answers on Launchpad as well as comments on Fabio's website for supporting users, however we decided to create an ad-hoc website to facilitate information gathering and collaboration between people.

Development, Bug Reports and Suggestions

Development of FreeIMU boards and libraries can be followed on FreeIMU project page on Launchpad which also hosts our software and hardware repository.

Suggestions or bug reports can be made on the FreeIMU Community, in the development forum.Previously bug reports were posted on the Launchpad bug reporting interface but that's not used anymore.

FreeIMU repository holds all the various library sources as well as design files and schematics. Everything is revisioned meaning that all the changes are logged and annotated.

The contents of the repository are available using Bazaar (bzr) with the command:
bzr co lp:freeimu

Never used bzr before? Not a big deal, it's very similar to git, svn or others. You may wanna have a look at the cheatsheet to have an overview of the commands available or read more documentation on bzr.

Alternatively, in case you have problems setting up bzr on your system, you can simply get the latest repository contents from here. The resulting file is a .tar.gz archive which can be opened with the excellent 7zip under Windows. Mac and Linux users shouldn't have problems opening such files.

The files on the repository can also browsed from a browser here. A list of recent changes is available here.

FreeIMU users videos

Here some videos made by FreeIMU users on their projects using FreeIMU.

rtsdrums flies like crazy with FreeIMU on his quadcopter.. check out the triple flip!

Warthox testing indoor FreeIMU v0.4r3 on one of his quadcopters.

Warthox stress test FreeIMU v0.3.5_MS on one of his quadcopters.

Chris uses FreeIMU on his VTOL EDF Tricopter powered by the MultiWii software.

Danilo Del Console uses FreeIMU in a 2 wheels self balancing robot.

Francesco Ferrara uses FreeIMU for a camera stabilization system.

Francesco Ferrara with his super fast implementation of the AHRS algorithm capable of displaying the rotating cube at 333Hz with FreeIMU! Great work!

Marchino65 with his first test with FreeIMU and the FreeIMU library on Arduino. The cube is spinning pretty good!

Francesco Ferrara in his first flight with FreeIMU on his very young quadcopter project called Simplo.

Help with MP 6050

Submitted by Gene (not verified) on Sat, 2012-06-16 05:08.

I fell on your youtube video; very limpid and nice.Thanks for all the efforts you've put in this. I am a super newbie who was given an arduino mega and and the invensense MP 6050 to work with. Could you provide with info (header kits and all)on how to interface with it as you did for the FreeIMUs. Iam trying to get position data from sensors for a moving car.

Per favore, prima grazie!!!!

Do you have the sensor in a

Submitted by fabio on Tue, 2012-06-19 00:55.

Do you have the sensor in a breakout board or are you going to design a board for it?

Help with a schematic ?

Submitted by Rick Eis (not verified) on Fri, 2012-06-15 18:01.

Thank you for sharing your amazing ideas and work.
I purchased the following; A Pro Mini, a MPU6050, HMC5883L and a MS5611 (see exact items below) I am hoping it possible to use these off the shelf individual components and your software to build a quad copter. Am I dreaming? If it is possible, can you help me get started with a wiring schematic or point me in the right direction?
Thank you again for all your contributions,

Richard Eis

Arduino Pro Mini 328 - 5V/16MHz

MPU6050 gyroscope+accelerometer

HMC5883L magnetometer a

MS5611-01BA high resolution altimeter.

I can tell you it's possible,

Submitted by Mickey (not verified) on Sun, 2012-06-17 05:37.

I can tell you it's possible, but you have a lot of work ahead if you want to do everything by your self. So about the wiring:
First you can look on the free IMU schematics and you'll know how the wire the MPU6050, HMC5883L and the MS5611-01BA. So what you've left is to wire them to the Arduino - which is very simple, I believe Versano explained it in one of the last movies (it's mainly I2C bus).
But, you wanted a quadcopter and not just an IMU, so first you need to get:
(go to hobbyking)
- Quadcopter frame
- 4x Brushless motors (about 1000 - 1400KV 10-15A)
- 2x CW & 2x CCW Propellors (like 10x4.5)
- LiPo 2 or 3 Cells with more than 2000mA (depends how much flight you want)
- 4x 18A or more ESCs

this is only on the nutshell, you will need to read a lot on how to do it exactly, you'll need to generate using the Arduino 4 PWM, with 20ms period each, in order to communicate with the ESCs which determines motors thrust. You'll also need to write a PID to control them. You need a wireless communication (don't go on Bluetooth) you can use WiFi at ad-hoc.


Off the shelf components and FreeIMU

Submitted by Rick Eis (not verified) on Sun, 2012-06-17 06:15.

Hey thanks Mickey,
Actually, I have a quad and fly with an APM2 board. I just want to learn more.
I looked at the free IMU schematics but do not understand how the boards are connected to each other and the arduino.
Thanks again and any help understanding the schematics would be appreciated.
Thanks again,

OK its very simple: look at

Submitted by Mickey (not verified) on Sun, 2012-06-17 06:58.

OK its very simple:

look at the schematics first page (
The connector which connects the IMU to your Micro-controller board is on the upper right corner (CONN_8):

1. VIN: Do you use a 3.3v regulator? if not forget the Vin.
2. GND: goes to the Micro's ground.
3. VCC: must to be equal to 3.3v !! do not connect it to greater voltage source. make sure the 3.3v source is from the same GND source (2).
4. SDA*: this is I2C data line and goes to your Micro's SDA.
5. SCL*: this is I2C clock line and goes to your arduino's SCL.
6. INTA: this is interrupt line of the MPU-6050 you don't really need it to use the MPU-6050 but it's always good to connect it to one of your Arduino's INT inputs which you are not using, maybe you will use it in the future...
7. FSYNC: this is a synchronization clock line, don't use it if you not understand it's purpose. (read MPU-6050 datasheet if you want to learn more)
8. INTM: the same as (6) for the Magnetometer (you don't really need it too).

(*) NOTE: this is very important, in order to use I2C interface (SDA & SCL) you must make sure you connect them to with pull-up resistors (2.2K) to the 3.3v source but only once! I don't know if these line already connected on your Micro board, if so you don't need to connect them again. this is why you can see at Fabio's schematic SPST switch - he gives you the choice in case they are already connected on your external board (in your case APM2).

How you are going to solder them if I may ask?


Connecting, Pro Mini 328,MPU6050,HMC5883L and MS5611-01BA

Submitted by Rick Eis (not verified) on Sun, 2012-06-17 07:46.

Hey thanks again Mickey,

I do not plan to use my APM2 with this project in any way.

I bought these other individual components to learn about them and the associated software. And yes, I would like to use them and FreeIMU to run my quad copter.

And you say,"You'll also need to write a PID to control them." hasn't this been done already ?

Thanks again,


Yes it has been done on a

Submitted by Mickey (not verified) on Sun, 2012-06-17 10:29.

Yes it has been done on a specific simple platforms like the arduino, I just gave you a direction in general if you want to build quadcopter from scratch using other platforms (micro-controller, FPGA,..)

Thanks Mickey for the help

Submitted by fabio on Mon, 2012-06-18 10:36.

Thanks Mickey for the help you gave to Rick Eis.. Rick, let us know if you still need help.

Sorry: upper left not upper

Submitted by Mickey (not verified) on Sun, 2012-06-17 07:02.

Sorry: upper left not upper right...

Understanding the schematics for off the shelf components

Submitted by Rick Eis (not verified) on Tue, 2012-06-19 01:31.


This is a link to the wiring diagram I think representing your page 1 of your schematics.

Does it look good so far?

Thanks again for your help,


Yes, it looks ok. But you

Submitted by fabio on Tue, 2012-06-19 10:35.

Yes, it looks ok. But you will need capacitors on the MIC5203.. google for its datasheet. You'll find examples of good connections.

Thank you for helping with your schematics

Submitted by Rick Eis (not verified) on Thu, 2012-06-21 02:48.


How is this? This is on your page 5 of 5...I just wasn't there yet :)

I am not sure I understand the sw101 on page 1? And my HMC5883 breakout board does not have all the connections as on your page 4 of 5. Will it still work?

So I do not understand how to connect the speed controls etc

Thanks again,


SW101 is a solder switch,

Submitted by fabio on Thu, 2012-06-21 10:55.

SW101 is a solder switch, enabled by default in FreeIMU v0.4.3, which enables/disable on board pullups for the I2C bus. The MPU6050 breakout board from sparkfun has 10K pullups on it, enabled by default, so you won't need to add anything for that.

The HMC5883L does seems connected right in your schematics.

Speed controls?

Schematic for individual sensors with Arduino Pro Mini

Submitted by Rick Eis (not verified) on Fri, 2012-06-22 16:11.

Hi Fabio,

In the email above, I was asking how to connect up the speed controls etc. What I am looking for is something like this;

Only I was hoping to use your software and the sensors as in the schematic you have been helping me with.

Does this make sense?



Yes, that's a pretty common

Submitted by fabio on Sat, 2012-06-23 18:47.

Yes, that's a pretty common setup when developing quadcopters.. and you can use it a FreeIMU with the FreeIMU library if you want to experiment.

If you instead are looking for something more ready to fly, you can have a look at the MultiWii project, which has support for the FreeIMU and everything else you need to control a quadcopter.

Magnetometer calibration.

Submitted by Manu (not verified) on Thu, 2012-06-14 14:58.

Hi Fabio,

As I commented few days ago my FreeIMU (4.3) drifts in yaw.

After read your comments about this problem I thought that my HMC5883L could need a calibration, so I have been working on a calibration method for it. It's based on the procedure specified on the datasheet that uses the self test mode.

Also I have been working in a library for the MS561101BA following the i2cdev source conventions. It includes the temperature compensation algorithm that it's described in the datasheet.

I have tested them in the FreeIMU an works fine.

I have sent it to Jeff Rowberg, the author of the i2cdev library. Maybe he will include them in next releases of his library.

But I have to confess that I'm confused about this matter and maybe you could help me. I have read in the specification that the MPU6050 includes a propietary fusion sensor algorithm and embedded algorithms for run-time bias and compass calibration. No user intervention required.

So, I understand that the chip is self-sufficient and should be doing the work, isn't it?. It should be plug&play ... but, almost in my case looks like Plug&Pray. :-)

I would not want to use another algorithm.

Any idea?, Any additional information about these mysterious algorithms?

Best regards.

MPU6050 - Half-truths.

Submitted by Manu (not verified) on Wed, 2012-06-20 16:44.

Finally I have solved my questions about the DMP (Digital Motion Processor).

Copy from

The whole point of this chip is that the main MCU doesn't have to handle the processing load of converting the raw readings into orientation and acceleration. Without that feature there's no reason to buy this chip over any other gyro and accelerometer.

- It's actually slightly cheaper to buy a dedicated MCU and discrete gyro/acc packages. The real cost saving of the DMP is not having to write the software it runs.

However, there's nothing whatsoever in the Invensys published docs - not even a 'compiled' form that I could squirt straight into the chip without knowing any details about it.


The HCM5883L isn't supported and this is the response from Invensense:

"DMP of today is a closed system and was intended to be a hardware accelerator to perform special tasks such as sensor fusion and lower power gestures and such. Making a solution that is compass and MCU agnostic would require a re-engineering of the architecture something we may consider doing in the future. "

"Also, if you believe that you bought our parts with the intent of using it one way, and it doesn’t meet your needs please go ahead and plan for returning these parts and get a refund for it. You would need to send an email to sales [at] invensense [dot] com to initiate this process."


So, by now, it isn't possible to take advantage of the DMP in the FreeIMU. So, we need other sensor fussion algotithm running in the MCU, as Fabio had coded in his library.

There are a lot of pilot moving to the ST iNemo. Maybe is the base for Freeimu 5.x?.

Best regards

Hi, Install only Fabio's lib

Submitted by Mickey (not verified) on Sun, 2012-06-17 05:47.


Install only Fabio's lib and then try File -> Examples -> HMC58x3 -> HMC58x3_textcal

It will helpfully calibrate your magnetometer.
I can tell from experience that even the most advanced IMU don't eliminates the Yaw drift. UAV's and Airplanes are using Navigation Satellite Systems. Make sure that you don't have a magnetic field source around your IMU. I have a guitar amplifier in my room that cause my IMUs go crazy.


multiple FreeIMU sensors?

Submitted by Chris (not verified) on Tue, 2012-06-12 23:31.

Are all the I2C addresses changeable on the board so that I could connect 2 of these to an Arduino Mega? I want to put them in the hands of a robot to track arm movements.

Yes, of course. FreeIMU

Submitted by fabio on Wed, 2012-06-13 00:47.

Yes, of course. FreeIMU v0.4.3 allows you change the I2C address of the MPU6050. On the bottom of the board you have a solder jumper. By default there is a track connecting the address selection pin of the MPU6050 to GND. If you cut this track and solder the opposite side of the jumper, the MPU6050 will get the other I2C address.

This allows you to connect 2 FreeIMUs to the same I2C bus. Note however that the FreeIMU library use the HMC5883L, connected to the AUX I2C bus of the MPU6050, in bypass mode meaning that the magnetometer also work on the main bus. So, if you plan to use the FreeIMU library, you'll have to be prepared for modifiying it to use MPU6050 master capabilities. The MultiWii project uses the MPU6050 master capabilities so it can be used as example.

Another option can be using I2C multiplexers, which allows to use as many FreeIMU as you wish.

FreeIMU_quaternion on a maple mini(STM32F103) ARM processor

Submitted by Wagner Sartori Junior (not verified) on Tue, 2012-06-12 02:11.

I made FreeIMU_quaternion on a maple mini(STM32F103) using ARM processor and ChibiOS.

I'm using FreeIMU v0.4r3.

This is great news! Thanks

Submitted by fabio on Tue, 2012-06-12 10:56.

This is great news! Thanks for your contribution! Congratulations!

Wow, it really seems that you almost rewrote everything from scratch... shouldn't the Maple be almost Arduino compatible?
What sensor fusion frequency do you get with this setup?

Btw, I'd like to blog about this, is there any chance you could make a video demonstrating your setup?

Updated frequency

Submitted by Wagner Sartori Junior (not verified) on Mon, 2012-06-18 00:59.

Great news,

I did some code optimizations and I'm using the available interrupts of both HMC5883L/MPU6050. I'm getting >500Hz frequency right now.

Code is up2date on my github repository. I'll post a youtube video soon as I have some more spare time.

Wow! That's a lot! Looking

Submitted by fabio on Mon, 2012-06-18 10:40.

Wow! That's a lot! Looking forward seeing a video of that! ;-)

Does that microcontroller has DMA? If so, that may even increase the speed!

Maple and chibios

Submitted by Wagner Sartori Junior (not verified) on Tue, 2012-06-12 16:59.

libmaple is arduino compatible, however I'm using a maple mini board with chibios directly.

arm processor is 32-bits so all int operations has to be casted to work properly.

I'm getting 33Hz. It's too slow comparing with the guy that know 333Hz on a simple arduino(16Mhhz vs 72Mhz), maybe because of serial printing operation. I don't know what that guy do to achieve 333Hz, maybe he's printing raw values from the sensor and doing all calculations on computer side.

I'll try more optimizations later.

Magnetometer calibration status

Submitted by Manu (not verified) on Thu, 2012-06-07 16:52.

Hi Fabio,

Yesterday I have recived my FreeIMU 4.3. I have connected it to an Arduino Uno board as you describe in the video and I have ran the cube aplication without problems.

But I have found that, after some movements, it drifts in yaw direction. I have read the similar comments and I guess that I need to calibrate the magnetometer.

Is there some update about this matter?. Have you finished the calibration tools?.

Ahhh, thank you for share you work. It's great.

gyro problem

Submitted by Bence (not verified) on Sun, 2012-06-03 09:56.

Hi Fabio!
First of all, I want to say thank you for this huge work you've made with this IMUs! Several years ago I was looking for a good IMU for my project. I am studying mechatronic engineering in University of Miskolc,Hungary and I'm designing an UAV.
I found a board on ebay: 10 DoF L3G4200D, ADXL345, HMC5883L, BMP085.
I noticed that, this module is like your 0.35BMP FreeIMU, except the gyro, you used ITG3200. Do you think is it possible that this module :an work with your libary after some modifications?
This is the module:
Best wishes!

Bence Balla

Of course. You just have to

Submitted by fabio on Sun, 2012-06-03 10:22.

Of course. You just have to write code that reads from your gyroscope and feed it into the sensor fusion algorithm you find in FreeIMU.cpp.

it's done

Submitted by Bence (not verified) on Wed, 2012-07-18 23:03.

Hi Fabio!
I just want to tell thank you for your FREEIMU project and the encouragement with that ebayboard. The l3g4200d gyro works fine with the "home-made itg3200 look-like copy" libary.
Have a nice day!

Nice to hear that! Would you

Submitted by fabio on Thu, 2012-07-19 09:32.

Nice to hear that! Would you share your working code so that other people may benefit from it?

Sure! How's that?

Submitted by Bence (not verified) on Thu, 2012-07-19 17:44.

Sure! How's that?

freeIMU 04 and arduino mega

Submitted by Lucio (not verified) on Sat, 2012-06-02 19:47.

Dear Fabio,
I'm trying to connect the freeIMU with arduino mega 2560 using the sparkfun LLC. I don't know very well the correct schema of connections to do, please give me some hints. In my mind a possible schema is

freeIMU LLC Mega
SDA -> TX0 RX1 <- SDA
SCL -> RX0 TX1 <- SCL

but also between LLC and MEGA

3.3V LLC 3.3V MEGA

I have selected the correct freeIMU version in freeIMU.h but the results in the terminal are ever and only the crazy string with no sense. What's wrong? :-)



Hi Lucio, can you post a

Submitted by fabio on Sat, 2012-06-02 20:01.

Hi Lucio, can you post a picture of your connections? I'm not sure I follow your schematics.

freehand drawing - more useful schema

Submitted by Lucio (not verified) on Mon, 2012-06-04 16:10.

Hi Fabio,
I have tried to draw a very simple schematics about my setup. I hope this is more useful to understand my issue.

Thanks in advance.



I have missing the new file.

Submitted by Lucio (not verified) on Mon, 2012-06-04 16:12.

I have missing the new file.

You should to connect the LV

Submitted by Bobotus (not verified) on Mon, 2012-06-04 16:36.

You should to connect the LV (Low voltage side of level converter) to FreeIMU 3.3v output and also connect FreeIMU GND (ground) to Arduino GND (Ground).

I have a sparkfun level converter, and I'm using TX1&TX0 in Chan1 for SCL and TX1&TX0 in Chan2 for SDA. Basically the way MultiWii suggests: (Lowr right-hand corner)

Hope this helps.

Hi Bobotus, thank you for

Submitted by Lucio (not verified) on Mon, 2012-06-04 19:52.

Hi Bobotus,
thank you for help. Unfortunately arduino+freeIMU doesn't work yet. I have followed your suggestions and schema but without any results. Could you (or someone else) tell me where in the freeIMU code I can find the arduino pins mapping?



I2C Pins and baud rate

Submitted by Bobotus (not verified) on Mon, 2012-06-04 21:10.


Quick Google "Arduino SDA SCL" provides site as info on where the I2C pins are found on your arduino board. You can't map them. The pin locations depend on your hardware.

You said something about a "crazy string" on serial monitor. Are you sure you have the baud rate correct? If unsure, check the tutorial video for info:

Thank you Bobotus for the

Submitted by Lucio (not verified) on Mon, 2012-06-04 23:05.

Thank you Bobotus for the suggested reading. I'm a little bit less confusing now. I have uploaded a screenshot of crazy strings ( I don't know what kind of tests I could do to point out my error(s). Do you have some hints for? I'm using the last version of Arduino IDE (1.0.1) and didn't replace the Wire.h because with the current version the freeIMU code compiles without any error. Moreover, trying to change Wire.h occurs various errors during the compile phase.

Thanks in advance.

Replacing/modifying Wire.h

Submitted by fabio on Tue, 2012-06-05 08:31.

Replacing/modifying Wire.h isn't needed anymore with IDE 1.0.1.

The screenshot you are sending looks very strange.. are you sure you are using the correct serial port?

flawed serial monitor

Submitted by Lucio (not verified) on Tue, 2012-06-05 20:06.

I have just found the problem! I have tried to use Terminal (typing command screen /dev/tty-usbmodem441 115200) on my mac in place of serial monitor embedded in arduino IDE and the crazy strings are disappeared! Below the screenshot to confirm my results. Wow...

P.S.: do you note the error in the low left corner? It appear when try to use Processing example provided with freeIMU library. Some idea to solve it?



That's a good sign.. the

Submitted by fabio on Tue, 2012-06-05 22:13.

That's a good sign.. the output you get from the serial is exactly what you should get.. so this means that the connection is fine and the board too. You may wanna ask for help directly on the Arduino forum, maybe there's something else we didn't think about.

Regarding the Processing problem, I never saw that issue. I'd suggest googleing the error message and see if something comes up.. if not, try asking on the official forum.

Good luck ;-)

about correct serial port

Submitted by Lucio (not verified) on Tue, 2012-06-05 17:36.

Hi Fabio,
the Arduino IDE automatically recognizes the Arduino when I plug in the usb. Moreover I have written the simplest Hello world example and send it on serial port but it works fine. I have also checked all pins both on LLC and freeIMU with the tester, and tomorrow I'll complete the check with the oscilloscope. I don't know what else check (hardware and/or software). Any suggestions?

Thanks a lot.


Thank you Bobotus for the

Submitted by Lucio (not verified) on Mon, 2012-06-04 23:04.

Thank you Bobotus for the suggested reading. I'm a little bit less confusing now. I have uploaded a screenshot of crazy strings ( I don't know what kind of tests I could do to point out my error(s). Do you have some hints for? I'm using the last version of Arduino IDE (1.0.1) and didn't replace the Wire.h because with the current version the freeIMU code compiles without any error. Moreover, trying to change Wire.h occurs various errors during the compile phase.

Thanks in advance.

You can download two photos

Submitted by Lucio (not verified) on Sat, 2012-06-02 20:25.

You can download two photos from my account. I'm not sure that these photos are very informative...:-)

freeIMU questions

Submitted by zencuke (not verified) on Thu, 2012-05-31 14:19.

I finally got my FreeIMU 4.0 and have been playing around. I looked at the code and wonder. Why does AHRSupdate calculate the error term based on magnetometer data only to overwrite it with a calculation based on the accelerometer. Wouldn't it be faster if the order of these was reversed. I.e. check for valid accelerometer data first and only if there is none calculate based on the magnetometer.

// Compute feedback only if accelerometer measurement valid (avoids NaN in accelerometer normalisation)
if((ax != 0.0f) && (ay != 0.0f) && (az != 0.0f)) {
//Use magnetometer measurement only when valid (avoids NaN in magnetometer normalisation)
} else if((mx != 0.0f) && (my != 0.0f) && (mz != 0.0f)) {

Also I like the smaller form factor but how do people attach this board now that the mounting holes have been removed. I'm having trouble getting the alignment right.

I guess not.

Submitted by zencuke (not verified) on Mon, 2012-06-04 16:15.


Answered my own question.

Submitted by zencuke (not verified) on Fri, 2012-06-15 20:09.

I guess I'm talking to myself here but what the heck. ;-)

I finally figured out that in the FreeIMU lib the accelerometer error is added to the magnetometer error rather than overwriting it. In skimming the code I missed that second time the error terms are set it is with += rather than +.

My original issue is that when I run either processing demo the orientation drifts around. If I just let it sit on the table it drifts and finally settles with the correct orientation but this can take as much as a minute or two. Since nothing is moving the sensor readings shouldn't be changing so I'm a little confused about what is going on.

Any suggestions about how to debug this. I guess it is time to look at the raw sensor readings and figure out what exactly is drifting.

Sorry for not replying

Submitted by fabio on Sat, 2012-06-16 00:31.

Sorry for not replying before.. looks like I missed your comments. Sorry for that.

That's very strange what you are seeing.. drifting caused by uncalibrated magnetometer usually is in the 10-15 degrees, not a minute or so of drifting.

Please post a piece of the raw output of your board...

Also.. are you using the board near sources of electro magnetic interferences? Like speakers, lamps, iron tables, etc...

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a personal or company website insert its address in the form .
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <small> <del> <img> <h2> <h3> <h4> <b> <video> <sub> <sup>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.
  • You may use [inline:xx] tags to display uploaded files or images inline.
  • You may insert videos with [video:URL]
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

More information about formatting options