How to disable internal Arduino ATMEGA pullups on SDA and SCL with I2C bus

Last updated on Wed, 2011-12-07 13:50. Originally submitted by fabio on 2011-06-23 00:29.

Wire, the library available in the Arduino apis to communicate with devices on the I2C bus, as of the 022 version of the Arduino IDE, by default enable the internal pullups of the ATMEGA microcontroller.

As all 16MHz ATMEGA runs at 5V this means that with pullups enabled signals will have a 5 volt as logic level. Unfortunately, as many I2C devices runs at 3 Volts and aren't 5Volts tolerant, sending 5V signals to them is clearly a very bad idea. You may shorten your device life or even damage them irreparably.

Posted in:

Connecting Sparkfun ITG3200 breakout board to Arduino

Last updated on Thu, 2011-07-07 14:22. Originally submitted by fabio on 2011-06-22 13:07.

I've been asked how to connect a Sparkfun breakout board for the ITG3200 to an Arduino UNO. Here's a schematics of the connection. If you are using an Arduino Mega you'll have to use pins 20 (SDA) and 21 (SCL) instead of A4 and A5.

IMPORTANT: Remember that in order to use this setup you have to disable the internal pullups of the ATMEGA. Note that Wire will enable them by default.

Arduino Camp this weekend

Submitted by fabio on Wed, 2011-06-15 13:48.

This weekend (18-19 June 2011) I'll participate in the Arduino Camp Milano.. I'll bring there some of my projects: PALLA, FreeIMU and Femtoduino.

If you happen to be there, let me know. Looking forward knowing you in person.

Arduino Logo

QFN rework & reflow using hot air

Submitted by fabio on Tue, 2011-06-14 23:43.

This is myself reworking and reflowing a breakout board for the ITG3200. I use hotair gun and tack flux. Check it out!

p.s.: obviously inspired by this other video by, highly recommended.

Posted in:

Quaternion representation of the rotation of a sphere into plane displacement

Last updated on Thu, 2011-06-16 12:05. Originally submitted by fabio on 2011-06-14 16:52.

This is a mathematical problem I'm facing these days.. here you go.

I do have a sphere of known radius which does have a coordinate frame rigidly attached to it. Let's call the coordinate frame attached to the sphere XYZs. The sphere can be rotated and displaced arbitrarily with respect to a fixed coordinate frame (world) called $XYZ_w$. Let's be XYZw the coordinate frame of the world where X points the north, Z points the sky and Y is orthogonal to the other 2 axis.

I'm capable of knowing the orientation of the sphere with respect to the XYZw and I have such orientation represented using a quaternion which we'll call Qsw (that is the quaternion representing the orientation of XYZs with respect to XYZw). By knowing Qsw I can easily compute Qws (that is the quaternion representing the orientation of XYZw with respect to XYZs) by computing the quaternion conjugate of Qsw.

Now, let's suppose to place the sphere on a XYw plane, so that by rotating the sphere a displacement of XYZs with respect to XYw is produced. You can visualize this by thinking of placing a ball on a table and rotating it so that it moves on then table plane.

Now, the problem is, by being able to sample Qsw, getting to know the displacement of XYZs on XYw after an indefinite rotation.

This is a practical problem araised when using PALLA (as described in chapter 8 of my MoS thesis), a spherical device which contains an accelerometer, a gyroscope and magnetometer, from which doing a sensor fusion I'm able to compute it's orientation with respect to the world. Now, once placed it on a table with the user rotating it to displace it, I'd like to compute how much it is being displaced as described in math language above.

Of course, I'm not looking for the solution to the problem, I'm just looking for hints on possible paths to the solution.

Any suggestions?

MS5611-01BA Arduino library: first developments results

Last updated on Sun, 2012-09-09 18:08. Originally submitted by fabio on 2011-06-12 20:16.

I spent the last days working on the MS5611-01BA high resolution pressure sensor. I wrote an Arduino library for it which you can find on my bzr repository:

  • browse repository
  • download library
  • use bzr co to get a copy directly using bzr.
  • the MS5611 library is now part of the FreeIMU library. Please refer to the FreeIMU library for newer code.

The library comes associated with a Processing visualization sketch which you can use to visualize a the readings coming from the sensor using a graphical tool.

The results I've got so fare are pretty good. Precision is about 0.02-0.03 mbar and altitude estimation resolution is about 10-15 cm. Relative measurement of altitude using the sensor looks very good but I'm still looking for a better approach on absolute altitude estimation.

In the video below you find an example of my initial developments.

Breakout boards for sale

Last updated on Mon, 2011-06-20 11:09. Originally submitted by fabio on 2011-06-05 11:11.

I'm cleaning my workshop and I do have some breakout boards which I'm not going to use so I'd like to sell them if someone is interested. All of them are new and tested.

Here is what I have:

  • 6 5 4 3 2 1 breakout boards for ITG3200 25 euro SOLD OUT! Thanks!
  • 6 5 4 3 2 breakout boards for ADXL345 20 euro
  • 2 1 breakout boards for HMC5843 25 euro SOLD OUT! Thanks!
  • 1 breakout board for HMC5843 by Sparkfun (used a couple of times with male headers soldered) 25 euro SOLD OUT! Thanks!

Prices includes shipping to EU. If interested please contact me.

p.s. I'll keep this post updated with availability.

Various breakout boards for sale

FreeIMU is flying great!

Submitted by fabio on Tue, 2011-05-31 10:52.

My friend marco just published another video of his quadcopter flying using FreeIMU. Awesome result and I really like the GoPro HD video.

Posted in:

Visiting Fablab Italia

Submitted by fabio on Sun, 2011-05-29 12:01.

I recently had the opportunity to visit Fablab Italia, the fablab that has been established as part of the Stazione Futuro exhibition.

A Fab Lab (fabrication laboratory) is a small-scale workshop offering digital fabrication. Fablab Italia offers many useful tools to create your own project.

Fablab Italia offers:

Posted in:

FreeIMU and Unity 3D

Submitted by fabio on Sun, 2011-05-29 10:08.

My friend Bart from has just uploaded this very nice video where he used his FreeIMU v0.3.1 with Unity 3D to move the head of an human body model following the movements of his FreeIMU.

Is this the beginning of FreeIMU based human motion tracking? More to follow ;-)

Posted in: