5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10



PLUG Starter Kit For Arduino Project 22: Acceleration

Posted by Fiona Su on

Overview
This lesson you will learn about how to use a Triple Axis Acceleration module ADXL345 for tilt sensing.
Component Required
  • EASY plug control board*1
  • EASY plug ADXL345 Acceleration Module *1
  • EASY plug LED module *3
  • RJ11 cable*1
  • USB cable*1
Component Introduction

Keyestudio EASY plug ADXL345 Acceleration Module
The ADXL345 module is a low power, 3-axis MEMS accelerometer with high resolution (13-bit) and measurement at up to ±16g (gravitational force).
Digital output data is formatted as 16-bit twos complement, and is accessible through either a SPI or I2C digital interface.
The ADXL345 is well suited to measures the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion or shock.
  • Working Voltage: 2.0-3.6V
  • Ultra Low Power @2.5v: 40uA /working mode; 0.1uA / standby mode
  • Communication interface: I2C / SPI
  • Tap/Double Tap Detection ; Free-Fall Detection

Connect It Up
Connect the EASY Plug ADXL345 Acceleration module to control board using an RJ11 cable.

thumb

Upload the Code
Upload the code to your board to check the 3-axis acceleration data and the module's tilt information.

thumb

What You Should See
Open the Serial monitor to see the 3-axis acceleration data. See changes as you sway the Accelerometer.

thumb

Little Knowledge:
If you think the monitor’s result is too fast to see the data clearly, you can drag a Delay block to add into the source code. Shown below.
After that, upload the code again and open the monitor, you should be able to see the display data clearly.

thumb

Extension Experiment
Controlling Three LEDs
Hookup Guide
Connect the EASY Plug ADXL345 Acceleration module and three LED modules to control board using RJ11 cables.

thumb

Test Code
Upload the test code below to your board to check the 3-axis acceleration data and the module's tilt information.

thumb

What You Should See

thumb

Upload success, open the serial monitor, it prints out the value of X,Y,Z axis. Each axis controls a light. If the measured value is greater than 200, LED lights up.

thumb

thumb

thumb

All Tutorial

 Buy here>>EASY PLUG Super Starter Kit For Arduino STEM EDU

0 comments

Leave a comment

Please note, comments must be approved before they are published