Accelerometer BMA250 Sensor Wireling Tutorial
This Wireling 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.
Technical DetailsBosch BMA250 Accelerometer Specs
- 3-axis (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: 32LSB/g
- Zero-g offset (over lifetime): +-80mg
- Bandwidths: 1000Hz… 8Hz
- Low Power: 139uA @2kHz data rate
- Voltage: 3.0V - 5.5V
- Current: 139uA (Normal Mode). Due to the low current, this board can be run using the TinyDuino coin cell option
- A5/SCL - I2C Serial Clock line
- A4/SDA - I2C Serial Data line
- A(x)/INT - Interrupt Pin
- Note: (x) corresponds to the Wireling port
- 10mm x 10mm (.394 inches x .394 inches)
- Max Height (from lower bottom of Wireling to upper top Wireling Connector): 3.63mm (0.143 inches)
- Weight: 1 gram (.04 ounces)
- Raspberry Pi and any other cables you'll need!
- Wireling Pi Hat
- (1) Wireling Cable
- Accelerometer Wireling
- Python 3 (Python 2 is not supported!)
- All Python packages mentioned in the Pi Hat setup tutorial (tinycircuits-wireling, Adafruit-Blinka, adafruit-circuitpython-ads1x15, and adafruit-circuitpython-busdevice)
- Python package (distribution page)
- Accelerometer Python example
Plug your Wireling into the port you plan on using! The default in the included program is port 0.
If you want to use a different port, you just need to change the port value in the program mentioned later.
Install the necessary Python package:
pip3 install tinycircuits-bma250
Then you can download (above under Software) the Accelerometer Sensor Wireling Python example:
# BMA250 Example # Reads all sensor data from accelerometer (X, Y, Z, Temp) and prints # Written by: Laverena Wienclaw for TinyCircuits import tinycircuits_wireling import tinycircuits_bma250 import time # Enable power to pi hat and wirelings wireling = tinycircuits_wireling.Wireling() wireling.selectPort(0) # Select port (0-3) labeled on the Pi Hat # Sensor init: See tinycircuits_bma250 for reg definition descriptions bma250 = tinycircuits_bma250.BMA250(0x03, 0x08) while True: bma250.readSensor() print("X: %0.1d" % bma250.X) print("Y: %0.1d" % bma250.Y) print("Z: %0.1d" % bma250.Z) print("Temp: %0.1f" % bma250.Temp) time.sleep(2)
Navigate in the terminal to the directory with the file parent to the examples folder.
Once the program is running, you should see the sensor values print out:
X: 65 Y: 204 Z: 142 Temp: 25.5
Move the sensor around to see the values change, or put a finger down on the sensor lightly to see the temperature increase.
Thanks for making with us!