My HMC58X3 library is now fully compatible with the HMC5883L

Submitted by fabio on Wed, 2011-04-27 12:59.

I'm happy to announce that my libre Arduino Library for the HMC5843 and HMC5883L Honeywell magnetometers is now fully compatible with the HMC5883L. From version 0.2 on both the HMC5843 and HMC5883L will be supported.

By default the library assumes you are using the HMC5883L. In order to use the library with the HMC5883L you have to edit the file HMC58X3.h and uncomment the line "#define ISHMC5843".

The FreeIMU library has been updated to include support for the new HMC58X3 library.

A self balancing robot with FreeIMU and Arduino

Submitted by fabio on Sat, 2011-04-16 19:07.

My friend Danilo, just published a nice video of his project: a 2 wheels self balancing robot made with Arduino and FreeIMU! That's pretty cool!

Posted in:

Overclocking I2C to 800KHz with FreeIMU v0.3

Submitted by fabio on Mon, 2011-04-04 10:53.

I'm having some fun with my new Rigol DS1052E oscilloscope and the brand new FreeIMU v0.3 and it's integrated logic level converter.

I'm using the scope to stress test the I2C logic level converter and I found out that with Arduino and the Wire library hacking the code to overclock I2C to non-standard frequencies is actually extremely simple.

It's just a matter of changing the line

#define TWI_FREQ 100000L

in twi.h and upscale that to whatever you want by changing 100000L into eg 400000L or 800000L.

With FreeIMU v0.3, I've been able to reach the unbelievable speed of 800 KHz. Even at this speed, communication looks extremely stable and reliable. Also the quality of the signals through the logic level converter is still very good.

Of course, as all the sensors on FreeIMU v0.3 aren't designed for such speed, going so fast may actually damage the sensors and "woid your warranty". So, I wouldn't suggest trying this on your boards.

Here is a picture of the SCL signal scoped when running at 800KHz through the logic level converter. Cool!!!

FreeIMU SCL signal scoped when running at 800KHz through the logic level converter

Preview of FreeIMU v0.3

Submitted by fabio on Fri, 2011-04-01 18:01.

Ok, I'm back hacking after a couple of months of hard work on the thesis which has been completed and submitted to the committee. 7 or 8 April degree! I still have to realize all of this..

Well, after a couple of days of relax I'm back to my regular hacking and I've been able to assemble the very first FreeIMU v0.3.

FreeIMU is my libre inertial measurement unit which I developed during my thesis. For all the informations please visit FreeIMU project page.

FreeIMU v0.3 is the latest version of FreeIMU which includes the ADXL346, the HMC5883L and the ITG3200. Initial test have been successful but I'm testing it.

So, here you have a couple of pictures:

FreeIMU v0.3 top view

FreeIMU v0.3 bottom view

I also made a quick video of FreeIMU v0.3

In this revision, I made some changes in the components used for the voltage level translation. It seems that the results are great. This is the signal quality of the SCL line running at 400KHz through the integrated logic level converter of FreeIMU v0.3.

FreeIMU v0.3 scope

Femtoduino is Alive!

Submitted by fabio on Sat, 2011-01-29 17:22.

Femtoduino, my ultrasmall Arduino compatible board is alive! It's working great and looks really neat!

Here a presentation video of Femtoduino!

Posted in:

First picture of Femtoduino, the smallest, lightest Arduino compatible board ever

Submitted by fabio on Fri, 2011-01-28 18:39.

First picture of Femtoduino

This is the first picture of Femtoduino, an ultra small Arduino compatible board.

Manually assembled by me, including 0402 capacitors and reflowed using a reflow oven and a hot air gun.

Soldering went smooth, even easier than I tought.. but I'm having problems uploading the bootloader. I'm able to query the ATMEGA using avrdude but I always get a programmer out of sync error when doing the real bootloader upload..

This will require some investigation.

UPDATE 2011-01-29:

It looks like the ArduinoISP sketch that I'm using to burn the bootloader on the ATMEGA 328p has problems under Linux.. so I had to use Win and it burnt it perfectly fine. Expect a demonstration video tomorrow. ;-)

FreeIMU is alive!

Submitted by fabio on Wed, 2011-01-26 19:18.

Yeah! I soldered everything and all went smooth.. only a little bug.. the connectors have a 0.032" drill hole while it should be 0.04".. so, regular squared pins array wont fit inside. You can use rounded pins, female thin pins (as the one shown in the video below) or wires directly.

But everything works great. Communication on I2C running at 400Khz directly from Arduino through the on board I2C level converter.. works great!

Next days more tests, I'm expecially interested in having a look at how the I2C signals looks on a scope with or without the I2C level converter.. I'll also try to simulate some noise and using long wires to check what happens..

Here is a short video on the progresses done these days.

PCBs are here! Today is delivery day!

Submitted by fabio on Mon, 2011-01-24 22:18.

Finally, the PCBs are here! I received the PCBs from the 10th January and from the 22th December ... lot of cool stuff!

Here we have:

  • FreeIMU v0.1
  • FreeIMU v0.2
  • Femtoduino v0.1
  • Femtoduino Breakout Board v0.1
  • I2C level converter & voltage regulator v0.1
  • ADXL345 brekout board
  • HMC5843 breakout board
  • ITG3200 breakout board

All the PCBs I received


FreeIMU v0.1

FreeIMU v0.2 top

FreeIMU v0.2 bottom

Help me pushing writeTo and ReadFrom into Arduino Wire

Submitted by fabio on Sun, 2011-01-23 17:26.

If you ever worked with I2C in Arduino you probably have seen or have implemented yourself, the following code blocks:

When writing a value to one of the registers of the slave device:


When reading a value from the register of the slave device:


An I2C logic level converter/translator with integrated voltage regulator

Last updated on Mon, 2011-04-04 16:55. Originally submitted by fabio on 2011-01-07 13:20.

When using I2C to interface devices operating at different voltages, for example an Arduino running at 5 Volts and a sensor running at 3.3 Volts, it's usually a best practice to use a logic level converter/translator to translate one logic signal from one voltage to the other and vice versa.

There are devices which will work without problems even without a logic level converter (for example I used the ADXL345, the ITG3200 and the HMC5843 without it) but once you want to get very good precision it may be worth using a logic level converter. Moreover there are many devices which could get damaged if used without one.