Accelerometer Blob – Prototype Overview

Published by frenoy on

In this post, we’re going to take a quick look at the accelerometer blob prototype and cover all the information you need to use it in your projects. We’re also going to interface it to a Piksey Pico and create a demo sketch to obtain and output the acceleration values for the X,Y & Z axes to the serial terminal.

Use Case:

As the name suggests, the accelerometer blob measures acceleration and can be used in projects that need to detect acceleration, motion or orientation (among other uses). The blob uses the LIS3DH accelerometer chip from ST Microelectronics and it has proven to be quite popular over the last few years.


The blob can be directly interfaced with a 5V microcontroller using the I2C interface as it contains a 5V to 3.3V LDO regulator as well as the necessary level shifters for the SDA/SCL lines.

The LDO can supply a maximum current of 250mA and this needs to be kept in mind if it is used to provide power to any other modules.

We will primarily be using the I2C interface for communication but you can also use the SPI bus by providing the appropriate level shifting. The ADC and interrupt pins have also been made available for use, as can be seen on the silkscreen.


As can be seen above, the silkscreen provides the pin out of the blob. For this demo we only need to connect the following pins:

  • Connect SDA to A4
  • Connect SCL to A5
  • Connect 5V & GND to the appropriate pins on the microcontroller

By default, the blob uses 0x19 as the I2C address. If the SDO pin pulled to ground, then the address becomes 0x18. This is useful if there are 2 accelerometer blobs on the same I2C bus.

Here’s an image of the assembled prototype that’s connected to a Piksey Pico using a breadboard.

Installing the Library:

We will be using the Sparkfun LIS3DH library for this demo and you will need to install it using by following the instructions in the link below:

The Sketch:

The sketch is pretty straightforward and the initial setup is shown below:

#include "SparkFunLIS3DH.h"
#include "Wire.h"

LIS3DH blobAXCL;    //Defaults to the following: Address:0x19, Sample Rate: 50Hz, Acceleration Range: 2G

void setup() 
  delay(100);       //short delay to allow for proper boot-up. 
  Serial.println("Boot Success: Hello World! \n");
  blobAXCL.begin(); //Call the setup function. This talks to the accelerometer blob and sets everything up for use.

We start by including the necessary libraries and we then create an object called “blobAXCL”. We set up the serial port for communication and then wait for 100ms to let everything power up correctly. We then print a message on the serial terminal to make sure the communication is OK and call the setup function which initializes the LIS3DH chip.

After completing the above, we are ready to obtain and print the acceleration values from the LIS3DH. This is shown below:

Serial.print("\nAcceleration Values (G):\n");

Serial.print(" X: ");
Serial.println(blobAXCL.readFloatAccelX(), 4);

Serial.print(" Y: ");
Serial.println(blobAXCL.readFloatAccelY(), 4);

Serial.print(" Z: ");
Serial.println(blobAXCL.readFloatAccelZ(), 4);

delay(1000);    //wait for sometime as we don't want to flood the serial terminal.

We simply print out a serial message followed by the data from the accelerometer. The one second delay is used to limit the amount the data that is sent to the serial terminal. Without this, the serial terminal would most likely get overwhelmed very quickly.

You can upload the sketch and open up the serial monitor from within the Arduino IDE (Tools->Serial Monitor). Please make sure you select the correct baud rate as per your sketch: 57600 in this case. You will start to see the serial messages on the screen. If you hit the reset button, you will be able to view all the messages including the boot success one. This is shown below:

In this way, you can use the accelerometer blob for any of your sketches. We will be releasing a custom library when the blob launches officially, but for now, you will either have to communicate with it directly or use a 3rd party library as shown above.

Categories: Piksey Pico