<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.linksprite.com/index.php?action=history&amp;feed=atom&amp;title=Triple-Axis_Digital_Accelerometer</id>
	<title>Triple-Axis Digital Accelerometer - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.linksprite.com/index.php?action=history&amp;feed=atom&amp;title=Triple-Axis_Digital_Accelerometer"/>
	<link rel="alternate" type="text/html" href="https://wiki.linksprite.com/index.php?title=Triple-Axis_Digital_Accelerometer&amp;action=history"/>
	<updated>2026-09-10T13:03:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.linksprite.com/index.php?title=Triple-Axis_Digital_Accelerometer&amp;diff=2108&amp;oldid=prev</id>
		<title>Katherine.d: Created page with &quot;== Introduction  ==  Based on the excellent ADXL-345, this digital 3-axis accelerometer has excellent EMI protection. Its variable output makes it suitable for a wide range of...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.linksprite.com/index.php?title=Triple-Axis_Digital_Accelerometer&amp;diff=2108&amp;oldid=prev"/>
		<updated>2013-02-20T09:33:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Introduction  ==  Based on the excellent ADXL-345, this digital 3-axis accelerometer has excellent EMI protection. Its variable output makes it suitable for a wide range of...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Introduction  ==&lt;br /&gt;
&lt;br /&gt;
Based on the excellent ADXL-345, this digital 3-axis accelerometer has excellent EMI protection. Its variable output makes it suitable for a wide range of applications: &lt;br /&gt;
*	HDD shock protection&lt;br /&gt;
*	Vibration sensor&lt;br /&gt;
*	Game controller input&lt;br /&gt;
*	Robotics&lt;br /&gt;
*	Smart vehicles&lt;br /&gt;
*	Anywhere you need to obtain motion-sensing &amp;amp; orientation information.&lt;br /&gt;
The excellent sensitivity (3.9mg/LSB @2g) provids high-precision output up to ±16g. &amp;lt;br&amp;gt;&lt;br /&gt;
The sensor is utilizes a 4-pin Grove interface (3-5VDC) for easy connectivity with your standard Arduino device or Seeed Stalker.&lt;br /&gt;
&lt;br /&gt;
[[File:trip-axisanalog accelerometer.jpg | 400px]]&lt;br /&gt;
&lt;br /&gt;
== Features  ==&lt;br /&gt;
&lt;br /&gt;
*Wide power range DC3V to 5V &lt;br /&gt;
*Grove module &lt;br /&gt;
*3 axis sensing &lt;br /&gt;
*I2C digital interface &lt;br /&gt;
*High sensitivity&lt;br /&gt;
*Small, low-profile package: 14-Terminal LGA &lt;br /&gt;
*Low power 0.1 μA in standby mode at VS = 2.5 V (typical) &lt;br /&gt;
*10,000 g shock survival&lt;br /&gt;
*RoHS/WEEE lead-free compliant&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application Ideas  ==&lt;br /&gt;
&lt;br /&gt;
*Motion Sensor &lt;br /&gt;
*Shock detector &lt;br /&gt;
*Vibration sensor &lt;br /&gt;
*Toy car &lt;br /&gt;
*Robotics &lt;br /&gt;
*Disk drive Shock Protection&lt;br /&gt;
*Game Controller&lt;br /&gt;
&lt;br /&gt;
== Cautions  ==&lt;br /&gt;
&lt;br /&gt;
'''Notice:''' Before you got this sensor, we have tested it to ensure that the sensor is working right. Sometimes there might be a small offset of the sensor, but it is within the acceptable error range. You can set the offset register according to the chip's datasheet to regulate the sensor.&amp;lt;br&amp;gt;'''Warning:''' wrong operation can cause danger.&lt;br /&gt;
&lt;br /&gt;
== Schematic  ==&lt;br /&gt;
&lt;br /&gt;
[[Image:schematic.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Usage  ==&lt;br /&gt;
&lt;br /&gt;
The sensor communicates with the MCU via I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C interface. &lt;br /&gt;
&lt;br /&gt;
For the first use you should download the [https://s3.amazonaws.com/linksprite/sensor_pack/Triple-Axis_Analog_Accelerometer+/ADXL345_Driver_for_Arduino.zip ADXL345 Driver for Arduino.zip] and unpack into '''arduino-1.0\libraries''' in your Arduino installation folder. &lt;br /&gt;
&lt;br /&gt;
If you are using jumper wire to connect the sensor, make sure that the sensor's SDA pin is connect to the analog port A4 and the SCL pin is connect to A5. This two pins are used as the I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C interface at your Arduino.&amp;amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Programming  ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
//Arduino 1.0+ Only!&lt;br /&gt;
//Arduino 1.0+ Only!&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;Wire.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ADXL345.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ADXL345 adxl; //variable adxl is an instance of the ADXL345 library&lt;br /&gt;
&lt;br /&gt;
void setup(){&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  adxl.powerOn();&lt;br /&gt;
&lt;br /&gt;
  //set activity/ inactivity thresholds (0-255)&lt;br /&gt;
  adxl.setActivityThreshold(75); //62.5mg per increment&lt;br /&gt;
  adxl.setInactivityThreshold(75); //62.5mg per increment&lt;br /&gt;
  adxl.setTimeInactivity(10); // how many seconds of no activity is inactive?&lt;br /&gt;
 &lt;br /&gt;
  //look of activity movement on this axes - 1 == on; 0 == off &lt;br /&gt;
  adxl.setActivityX(1);&lt;br /&gt;
  adxl.setActivityY(1);&lt;br /&gt;
  adxl.setActivityZ(1);&lt;br /&gt;
 &lt;br /&gt;
  //look of inactivity movement on this axes - 1 == on; 0 == off&lt;br /&gt;
  adxl.setInactivityX(1);&lt;br /&gt;
  adxl.setInactivityY(1);&lt;br /&gt;
  adxl.setInactivityZ(1);&lt;br /&gt;
 &lt;br /&gt;
  //look of tap movement on this axes - 1 == on; 0 == off&lt;br /&gt;
  adxl.setTapDetectionOnX(0);&lt;br /&gt;
  adxl.setTapDetectionOnY(0);&lt;br /&gt;
  adxl.setTapDetectionOnZ(1);&lt;br /&gt;
 &lt;br /&gt;
  //set values for what is a tap, and what is a double tap (0-255)&lt;br /&gt;
  adxl.setTapThreshold(50); //62.5mg per increment&lt;br /&gt;
  adxl.setTapDuration(15); //625μs per increment&lt;br /&gt;
  adxl.setDoubleTapLatency(80); //1.25ms per increment&lt;br /&gt;
  adxl.setDoubleTapWindow(200); //1.25ms per increment&lt;br /&gt;
 &lt;br /&gt;
  //set values for what is considered freefall (0-255)&lt;br /&gt;
  adxl.setFreeFallThreshold(7); //(5 - 9) recommended - 62.5mg per increment&lt;br /&gt;
  adxl.setFreeFallDuration(45); //(20 - 70) recommended - 5ms per increment&lt;br /&gt;
 &lt;br /&gt;
  //setting all interupts to take place on int pin 1&lt;br /&gt;
  //I had issues with int pin 2, was unable to reset it&lt;br /&gt;
  adxl.setInterruptMapping( ADXL345_INT_SINGLE_TAP_BIT,   ADXL345_INT1_PIN );&lt;br /&gt;
  adxl.setInterruptMapping( ADXL345_INT_DOUBLE_TAP_BIT,   ADXL345_INT1_PIN );&lt;br /&gt;
  adxl.setInterruptMapping( ADXL345_INT_FREE_FALL_BIT,    ADXL345_INT1_PIN );&lt;br /&gt;
  adxl.setInterruptMapping( ADXL345_INT_ACTIVITY_BIT,     ADXL345_INT1_PIN );&lt;br /&gt;
  adxl.setInterruptMapping( ADXL345_INT_INACTIVITY_BIT,   ADXL345_INT1_PIN );&lt;br /&gt;
 &lt;br /&gt;
  //register interupt actions - 1 == on; 0 == off  &lt;br /&gt;
  adxl.setInterrupt( ADXL345_INT_SINGLE_TAP_BIT, 1);&lt;br /&gt;
  adxl.setInterrupt( ADXL345_INT_DOUBLE_TAP_BIT, 1);&lt;br /&gt;
  adxl.setInterrupt( ADXL345_INT_FREE_FALL_BIT,  1);&lt;br /&gt;
  adxl.setInterrupt( ADXL345_INT_ACTIVITY_BIT,   1);&lt;br /&gt;
  adxl.setInterrupt( ADXL345_INT_INACTIVITY_BIT, 1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop(){&lt;br /&gt;
  &lt;br /&gt;
  //Boring accelerometer stuff   &lt;br /&gt;
  int x,y,z;  &lt;br /&gt;
  adxl.readAccel(&amp;amp;x, &amp;amp;y, &amp;amp;z); //read the accelerometer values and store them in variables  x,y,z&lt;br /&gt;
&lt;br /&gt;
  // Output x,y,z values - Commented out&lt;br /&gt;
  Serial.print(x);&lt;br /&gt;
  Serial.print('\t');&lt;br /&gt;
  Serial.print(y);&lt;br /&gt;
  Serial.print('\t');&lt;br /&gt;
  Serial.println(z);&lt;br /&gt;
  delay(500);&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
  //Fun Stuff!    &lt;br /&gt;
  //read interrupts source and look for triggerd actions&lt;br /&gt;
  &lt;br /&gt;
  //getInterruptSource clears all triggered actions after returning value&lt;br /&gt;
  //so do not call again until you need to recheck for triggered actions&lt;br /&gt;
   byte interrupts = adxl.getInterruptSource();&lt;br /&gt;
  &lt;br /&gt;
  // freefall&lt;br /&gt;
  if(adxl.triggered(interrupts, ADXL345_FREE_FALL)){&lt;br /&gt;
    Serial.println(&amp;quot;freefall&amp;quot;);&lt;br /&gt;
    //add code here to do when freefall is sensed&lt;br /&gt;
  } &lt;br /&gt;
  &lt;br /&gt;
  //inactivity&lt;br /&gt;
  if(adxl.triggered(interrupts, ADXL345_INACTIVITY)){&lt;br /&gt;
    Serial.println(&amp;quot;inactivity&amp;quot;);&lt;br /&gt;
     //add code here to do when inactivity is sensed&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  //activity&lt;br /&gt;
  if(adxl.triggered(interrupts, ADXL345_ACTIVITY)){&lt;br /&gt;
    Serial.println(&amp;quot;activity&amp;quot;); &lt;br /&gt;
     //add code here to do when activity is sensed&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  //double tap&lt;br /&gt;
  if(adxl.triggered(interrupts, ADXL345_DOUBLE_TAP)){&lt;br /&gt;
    Serial.println(&amp;quot;double tap&amp;quot;);&lt;br /&gt;
     //add code here to do when a 2X tap is sensed&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  //tap&lt;br /&gt;
  if(adxl.triggered(interrupts, ADXL345_SINGLE_TAP)){&lt;br /&gt;
    Serial.println(&amp;quot;tap&amp;quot;);&lt;br /&gt;
     //add code here to do when a tap is sensed&lt;br /&gt;
  } */&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Support  ==&lt;br /&gt;
&lt;br /&gt;
If you have questions or other better design ideas, you can go to our [http://www.linksprite.com/forum/index.php forum]&amp;amp;nbsp;or [http://www.linksprite.com/ wish]&amp;amp;nbsp;to discuss.&lt;br /&gt;
&lt;br /&gt;
== Resources  ==&lt;br /&gt;
&lt;br /&gt;
*[https://s3.amazonaws.com/linksprite/sensor_pack/Triple-Axis_Analog_Accelerometer+/Grove_-_3-axis_digital_accelerometer-ADXL345_V1.0_Eagle_file.zip Grove_-_3-axis_digital_accelerometer-ADXL345_V1.0_Eagle_file.zip]&lt;br /&gt;
*[https://s3.amazonaws.com/linksprite/sensor_pack/Triple-Axis_Analog_Accelerometer+/ADXL345_Driver_for_Arduino.zip ADXL345 lib for Arduino.zip]&lt;br /&gt;
*[https://s3.amazonaws.com/linksprite/sensor_pack/Triple-Axis_Analog_Accelerometer+/Grove_3_axis_digital_accelerometer_ADXL345_demo_code.ino.zip Grove - 3-axis digital accelerometer-ADXL345 V1.0 Eagle file.zip]&lt;br /&gt;
*[https://s3.amazonaws.com/linksprite/sensor_pack/Triple-Axis_Analog_Accelerometer+/ADXL345_datasheet.pdf ADXL345 datasheet.pdf]&lt;br /&gt;
&lt;br /&gt;
== How to buy  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also  ==&lt;br /&gt;
&lt;br /&gt;
Other related products and resources.&lt;/div&gt;</summary>
		<author><name>Katherine.d</name></author>
		
	</entry>
</feed>