Skip to content

TinyLily Accelerometer Tutorial

Imagine a project with LEDs that flicker based on your movement -- this could be a rad scooter with lights alerting every passerby that you are too cool for school, or a dress that twinkles as you gracefully walk by.

You could even build a project that acts as an alarm sytem anytime someone decides to touch your cookie jar.

The project ideas are limitless with a wearable electronic this tiny that can sense movement. (It can sense temperature too!)

This tutorial will show you how to read data from the BMA250 Accelerometer using the TinyLily Mini Processor, so that you can make your projects sense motion.

If you have not already gone through the TinyLily Mini Processor Getting Started Tutorial, you should go through that now before continuing!


This TinyLily Sewable sensor board 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 TinyLily Accelerometer incorporates level shifters and a local power supply to ensure proper and safe operation over the entire TinyDuino operating voltage range up to 5V.

To learn more about theTinyDuino Platform,click here**

Technical Details
  • Washable
  • Four Sewtabs – 1.2mm in diameter, easy to use with standard conductive thread and needles
  • Robust Gold Finish – makes soldering easy and is non-corrosive (great for being able to wash projects!)

    Power Requirements

    • Voltage: 3.0V - 5.5V 


      • Dimensions: 14mm diameter(0.0.55 inches)
      • Max Height: 2.5mm (0.1 inches)
      • Ultra-thin 0.61mm (0.024 inches) PCB
      • Weight: .305 grams (0.0108 ounces)
      Pinout - Back of Board


      Hardware materials



      Hardware Assembly

      The communication used for the BMA250 is I2C, so we only need to make 4 connections between the TinyLily Mini Processor and the TinyLily Accelerometer:

      Hardware Connection Diagram

      • TinyLily Mini Processor + -- TinyLily Accelerometer VCC
      • TinyLily Mini Processor - -- TinyLily Accelerometer GND
      • TinyLily Mini Processor A4 (this is the SDA pin) -- TinyLily Accelerometer SDA
      • TinyLily Mini Processor A5 (this is the SCL pin) -- TinyLily Accelerometer SCL

      Once these connections are made, you just need to program the TinyLily Mini Processor.

      Upload Program

      To program the BMA250 to print out the sensor's 3 axes of direction as well as the temperature, download the Arduino sketch included under Materials/Software.

      Once you have downloaded the .zip file, unzip it and open the Arduino sketch in the Arduino IDE.

      MAke sure you have the correct Tools selections made based on your processor:

      • Board: "Arduino Pro or Pro Mini"
      • Processor: "ATmega328p (3.3V, 8MHz)"
      • Port: "COM##" - this is the port connected to the TinyLily via the MicroUSB cable

      Then you can upload the program and open the Serial Monitor to view the printed sensor data. Try moving the TinyLily Accelerometer around to view the changes!

      What's next?

      Knowledge is power, and now that you know how to read the sensor's data, you have the power to make a really cool project based on the motion detected by the BMA250 sensor on the TinyLily Accelerometer board.

      Using the current program, you can test the movement of the Accelerometer and note what movement you are interested in using or detecting. You can use a logic loop like this to control functionality based on specific movement:

      if(x < 200 && x > 100) // x direction is picking up a reading between 100-200
          // Do something dependent on this specific motion, like light an LED!


      Contact Us

      If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

      Thanks for making with us!