Custom MMA8451Q SeeedStudio Twig

Lastnight wired up a SeeedStudio Grove system compatible twig based on one of the MMA8451Q breakout boards I bought. It has two connectors one for the I2C interface the other for the two interrupt lines which the device has.

MMA8451Q SeeedStudio Twig

I can read acceleration values from the device and once I have the 14bit 2s complement value conversion thouroughly tested I will add code to to configure the interrupt functionality.

Need to make connector leads a bit longer on V2…

Netduino and MMA8451Q I2C

After an hour mucking around trying to figure out why my new MMA8451Q accelerometer breakout board was returning odd values I stumbled across this post which lead to this post. Then I went back to the device data sheet and found the key paragraph I had missed

A LOW to HIGH transition on the SDA line while the SCL line is high is defined as a stop condition (STOP). A data transfer is always terminated by a STOP. A Master may also issue a repeated START during a data transfer. The MMA8451Q expects repeated STARTs to be used to randomly read from specific registers.

After implementing the approach suggested in this post I can now reliably read registers on the device.

This appears to be applicable for the MMA8451Q, MMA8452Q and MMA8453Q devices.

MMA8451Q Breakout board

Finally got some time to try out the MMA8451Q breakout board that arrived last week.

I’m using my Seeedstudio Grove Base Shield, 1 x Grove Universal 5cm cable, 1 x Grove Screw Terminal and 4 x jumper wires to build a test harness for the breakout board. Once I have got the I2C connectivity & device configuration sorted I’ll connect up the two interrupt outputs on the MMA8451Q in a similar way.

Bodged up MMA8451Q connectivity

Bodged up MMA8451Q connectivity

MMA7660FC & ADXL345 I2C Accelerometer read rates

Based on this USGS information I need to ensure a sufficiently high sampling rate to ensure the data collected is useful. Most earthquake waves appear to have a frequency of < 20Hz so taking Nyquist in account I need to be sampling at least at 40Hz.

In a tight loop doing nothing but communicating with the accelerometer I read X,Y & Z acceleration values then averaged the results over 10 lots of 10000 readings.

MMA7660FC – 6 bit acceleration value in 1 byte for each axis 650 RPS.

ADXL345 – 10 bit acceleration value in 2bytes for each axis 435 RPS

Netduino Plus using a SeeedStudio Grove Base ShieldMMA7660FC twig & ADXL345 twig.

The devices also have configurable acquisition rates & in some cases FIFOs for queuing readings which I need to look at some more

MEMS Accelerometers – Issues

The BMA180 looked ideal with good sensitivity etc. but I was wondering why the Bosch accelerometer page only had a flyer and no data sheet.

The device has been discontinued so I need to do further research. I think the Kionix KXCJ9 or Freescale MMA8451 are worth a look

Also considering an integrated Gyroscope + Accelerometers device like the InvenSense MPU 6000 series and only using the accelerometers.

MEMS Accelerometers – Options

Have ordered an Analog Devices ADXL345 Seedstudio twig and the specs look positive.

Next range of sensors to look at is from Bosch (BMA180 most probably) I’ll have to see what I can get on a breakout board, but I will most probably need a logic level convertor as well.

Seeedstudio have a wish list might see if I can get them interested….

Need to do this without blowing the toys budget as I paid provisional tax tonight