MMA7455 3-Axis Digital Accelerometer Module

Weight: 0.1 lb.



$14.95
USD


In Stock and Ready To Ship
Within 24 Hours

MMA7455 is a very low power 3 axis digital accelerometer from Freescale Semiconductors. It's micro machined nano structure is capable of measuring acceleration along its X, Y and Z axes. This chip has built in analog amplifiers, Analog to Digital Conversion circuit and an SPI/I2C capable bus interface. MMA7455 supports three sensitivity ranges, ±2g, ±4g, ±8g. MMA7455 can be configured to detect and measure motion pulses, taps and free fall along any of its axes. Two interrupt pins INT1 and INT2 can be configured to interrupt the CPU when any of these events occur.

 

  • Supports three axes

  • Selectable sensitivity (±2g, ±4g, ±8g)

  • High resolution (10bit) and low resolution (8bit) result registers

  • Low current operation

  • Sleep mode

  • Configurable interrupt pins

MMA7455 Datasheet

 

MMA7455 Breakout Module Pinout

MMA7455 Arduino Sample Sketch

 

  1. #include <Wire.h>
  2. #include <stdio.h>
  3.  
  4. #define MMA7455_I2C_ADDRESS 0x1D
  5.  
  6. //MMA7455 Registers
  7. #define MMA7455_XOUTL 0x00
  8. #define MMA7455_XOUTH 0x01
  9. #define MMA7455_YOUTL 0x02
  10. #define MMA7455_YOUTH 0x03
  11. #define MMA7455_ZOUTL 0x04
  12. #define MMA7455_ZOUTH 0x05
  13. #define MMA7455_XOUT8 0x06
  14. #define MMA7455_YOUT8 0x07
  15. #define MMA7455_ZOUT8 0x08
  16. #define MMA7455_STATUS 0x09
  17. #define MMA7455_DETSRC 0x0A
  18. #define MMA7455_TOUT 0x0B
  19. #define MMA7455_I2CAD 0x0D
  20. #define MMA7455_USRINF 0x0E
  21. #define MMA7455_WHOAMI 0x0F
  22. #define MMA7455_XOFFL 0x10
  23. #define MMA7455_XOFFH 0x11
  24. #define MMA7455_YOFFL 0x12
  25. #define MMA7455_YOFFH 0x13
  26. #define MMA7455_ZOFFL 0x14
  27. #define MMA7455_ZOFFH 0x15
  28. #define MMA7455_MCTL 0x16
  29. #define MMA7455_INTRST 0x17
  30. #define MMA7455_CTL1 0x18
  31. #define MMA7455_CTL2 0x19
  32. #define MMA7455_LDTH 0x1A
  33. #define MMA7455_PDTH 0x1B
  34. #define MMA7455_PW 0x1C
  35. #define MMA7455_LT 0x1D
  36. #define MMA7455_TW 0x1E
  37.  
  38. static FILE uartout = {0} ;
  39. static int uart_putchar (char c, FILE *stream)
  40. {
  41. Serial.write(c) ;
  42. return 0 ;
  43. }
  44.  
  45. void setup()
  46. {
  47. Wire.begin(); // join i2c bus (address optional for master)
  48. Serial.begin(9600); // start serial for output
  49.  
  50. fdev_setup_stream (&uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE);
  51.  
  52. // The uart is the standard output device STDOUT.
  53. stdout = &uartout ;
  54.  
  55. mma7455WriteReg(MMA7455_MCTL, 0x01);
  56. }
  57.  
  58. unsigned char mma7455ReadReg(unsigned char reg)
  59. {
  60. //Write register address first
  61. Wire.beginTransmission(MMA7455_I2C_ADDRESS);
  62. Wire.write(reg);
  63. Wire.endTransmission();
  64.  
  65. //Then read the data back
  66. Wire.requestFrom(MMA7455_I2C_ADDRESS, 1);
  67.  
  68. if(Wire.available())
  69. {
  70. return Wire.read();
  71. }
  72.  
  73. //Return zero if no data available
  74. return 0;
  75. }
  76.  
  77. void mma7455WriteReg(unsigned char reg, unsigned char value)
  78. {
  79. //Write register address first
  80. Wire.beginTransmission(MMA7455_I2C_ADDRESS);
  81. Wire.write(reg);
  82.  
  83. //And then write data
  84. Wire.write(value);
  85.  
  86. Wire.endTransmission();
  87. }
  88.  
  89. void loop()
  90. {
  91. printf("X = %u\n\r", mma7455ReadReg(MMA7455_XOUT8));
  92. printf("Y = %u\n\r", mma7455ReadReg(MMA7455_YOUT8));
  93. printf("Z = %u\n\r", mma7455ReadReg(MMA7455_ZOUT8));
  94.  
  95. delay(500);
  96. }

Comments

what port you connect it?

what port you connect it?

This chip supports both SPI

This chip supports both SPI and I2C protocol.The Arduino code above is for I2C though. More details about using I2C with Arduino can be found here at This board needs to be connected to the I2c pins of Arduino. Details about Arduino I2C port is available at http://www.arduino.cc/en/Reference/Wire

Problem

I connect and run but,Why x y z out 0 0 0 all time?

Re:Problem

Please check if CS is conencted to VCC. Please go through the datasheet carefully, the progrram may not work if the connections aren't right.

Re:Problem

OK. I can x y z is out 255 251 19 right.
It number of g or number anything?
thank you

Re:Problem

The sample program above will just print x,y and z only. Please see datasheet for more features.

hi dear i can read numbers in

hi dear
i can read numbers in hex from mma7455 but i can not relate between number and acceleration
please help me
sincerly yours