![Image](http://www.hobbycomponents.com/images/forum/HCTICI0006_400_300.jpg)
See our Tiny Circuits Range Here.
Description:
This Tinyshield features the high performance and low power Bosch BMA250 3-axis accelerometer. The BMA250 allows measurement of accelerations in three perpendicular axes and thus senses tilt, motion, shock, and vibration in your projects. There is also an integrated temperature sensor built in.
Even though the BMA250 is designed to run at 1.8V – the Accelerometer TinyShield incorporates level shifters and a local power supply to ensure proper and safe operation over the entire TinyDuino operating voltage range up to 5V.
You can also use this shield without the TinyDuino – there are 0.1″ spaced holes for power, ground, and the two I2C signals along the side of the TinyShield to allow you to connect a different system.
Specification:
Model number: ASD2611
Ultra compact size and weight (smaller than a US Quarter!)
Square Version: 20mm x 20mm (.787 inches x .787 inches)
Max Height (from lower bottom TinyShield Connector to upper top TinyShield Connector): 5.11mm (0.201 inches)
Weight: TBD grams (TBD ounces)
Bosch BMA250 Accelerometer
3-axix (X, Y & Z)
Digital resolution: 10bit
Resolution: 3.9mg
Measurement ranges: +-2g, +-4g, +-8g, +-16g
Sensitivity: 2g: 256LSB/g, 4g: 128LSB/g, 8g: 64LSB/g, 16g: 16LSB/g
Zero-g offset (over lifetime): +-80mg
Bandwidths: 1000Hz… 8Hz
Low Power: 139uA @2kHz data rate
I2C Mode used
Arduino pins A4 and A5 are used by this shield
Built in level shifters and linear power supply to allow your TinyDuino to run up to 5.0V operation
Schematic:
Example Sketch:
Code: Select all
//-------------------------------------------------------------------------------
// TinyCircuits Accelerometer TinyShield Example Sketch
// Using Bosch BMA250 in I2C mode
//
// Created 6/30/2013
// by Ken Burns, TinyCircuits http://Tiny-Circuits.com
//
// This example code is in the public domain.
//
//-------------------------------------------------------------------------------
#include <Wire.h>
#define BMA250_I2CADDR 0x18
#define BMA250_RANGE 0x03 // 0x03 = 2g, 0x05 = 4g, 0x08 = 8g, 0x0C = 16g
#define BMA250_BW 0x08 // 7.81Hz (update time of 64ms)
int AccelX;
int AccelY;
int AccelZ;
float AccelTemperature;
void setup()
{
Wire.begin();
Serial.begin(9600);
BMA250Init();
}
void loop()
{
BMA250ReadAccel();
// Print out the accelerometer data
Serial.print("x: ");
Serial.print(AccelX);
Serial.print(", y: ");
Serial.print(AccelY);
Serial.print(", z:");
Serial.print(AccelZ);
Serial.print(", t: ");
Serial.print(AccelTemperature);
Serial.println("degC");
delay(100);
}
void BMA250Init()
{
// Setup the range measurement setting
Wire.beginTransmission(BMA250_I2CADDR);
Wire.write(0x0F);
Wire.write(BMA250_RANGE);
Wire.endTransmission();
// Setup the bandwidth
Wire.beginTransmission(BMA250_I2CADDR);
Wire.write(0x10);
Wire.write(BMA250_BW);
Wire.endTransmission();
}
int BMA250ReadAccel()
{
uint8_t ReadBuff[8];
// Read the 7 data bytes from the BMA250
Wire.beginTransmission(BMA250_I2CADDR);
Wire.write(0x02);
Wire.endTransmission();
Wire.requestFrom(BMA250_I2CADDR,7);
for(int i = 0; i < 7;i++)
{
ReadBuff[i] = Wire.read();
}
AccelX = ReadBuff[1] << 8;
AccelX |= ReadBuff[0];
AccelX >>= 6;
AccelY = ReadBuff[3] << 8;
AccelY |= ReadBuff[2];
AccelY >>= 6;
AccelZ = ReadBuff[5] << 8;
AccelZ |= ReadBuff[4];
AccelZ >>= 6;
AccelTemperature = (ReadBuff[6] * 0.5) + 24.0;
}