connecting Freescale MMA7260Q accelerometer

Hi everyone! I'm a newbie in electronics and arduino, so excuse me if I write strange or stupid things.

This is my problem: I'm trying to connect a Freescale MMA7260Q accelerometer ( to a standard Arduino duemilanove.

The sensor works with 3.3v, and has 2 control pins for selecting its sensibility and a sleep pin (sleep mode is activated with LOW value).

I followed this tutorial:

but instead of connecting the sleep pin to a digital out of the Arduino I used the 3.3V out, just to give it a try.

I wrote some straight lines of code to send values for X axis in order to see the sensor behaviour in Matlab:

void setup()

void loop()
  int x = analogRead(0);

but what I get is a random output; by moving the sensor I don't get any meaningful response.

This is my setup:

you can see that the sensor is not soldered to the strips and that I'm quite messy with the links :-/ But I don't see errors in the connections.

1) Any ideas? Did I do something wrong?

2) what if I want to control the sleep pin with an Arduino digital out? How do I scale the 5V digital out to 3.3v? Can I just use resistors?

Thanks in advance :)

Truly random, or just wobbling around some value?

wobbling around 300 or so. Telling the truth is starts around 700, then slowly decreases to 300... sometimes it suddenly goes to 0 or slightly more (just for a sample).



I doubt you're still looking but I just stumbled across this (not my work, on someone's blog) and it might help with software stuff.