Took delivery of a 3-axis MMA7361 accelerometer from the nice chap at for the princely sum of £6.20, and ordered a cheapy from HK for good measure.


Sparkfun had a data sheet so I plugged it in to my Arduino taking my best guesses and amazingly it worked first time! Little LED on and data on all 3 channels.

There are libraries available but I thought “how hard can it be” and wrote a really short sketch to display raw data over serial. It looks like this:

Accelerometer Test
Context: Arduino
Reads data from the MMA7361
and prints the raw values to the serial port

// define analog inputs for the 3 channels
const int xPin = A0;
const int yPin = A1;
const int zPin = A2;

// sleep and g scale select pins
const int sleepPin = 2;
const int gPin = 3;

// initialise variables for data
int xValue = 0;
int yValue = 0;
int ZValue = 0;

void setup() {
analogReference(EXTERNAL); // need to do this as using 3.3V from MMA7361 as reference
Serial.begin(9600); // start serial comms

// set pin modes for sleep and scale select, then write to them
pinMode(sleepPin, OUTPUT);
pinMode(gPin, OUTPUT);
digitalWrite(sleepPin, HIGH);
digitalWrite(gPin, LOW);

// read the values then write them to serial
void loop() {
int xValue = analogRead(xPin);
int yValue = analogRead(yPin);
int zValue = analogRead(zPin);
Serial.write(": ");
Serial.write(": ");

The next step is to vconvert these to voltages, which will just be a case of multiplying 3.3V (the accelerometers logic, used as a reference for the Arduino) by the reading value / 1024.

Next will be getting a value of g out of it, claims 800mV/g in the 1.5g sensitivity mode so should be straightforward but I’m not sure how linear the response is. Soon find out!

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>