This demo will use EVAL-ADXL372-ARDZ shield along with Arduino Uno base board to create a impact measurement application, using the Arduino IDE.
The ADXL372_example project uses the EVAL-ADXL372-ARDZ shield which has an ADXL372 accelerometer. The ADXL372 is configured to operate in “Instant On” mode which means that the device is powered down, until the sensor records an impact event that triggers a threshold. Once that level is surpassed, the ADXL372 automatically goes into measurement mode to capture the rest of the impact event.
The ADXL372 is an ultralow power, 3-axis, ±200 g MEMS accelerometer.
The following is a list of items needed in order to replicate this demo.
The source code and include files of the ADXL372_example can be found here:
The Arduino Sketch is used to load the example into Arduino IDE. The project is composed of three main parts:
Configure the activity threshold in the ADXL372.h file.
#define ACT_VALUE 30 /* Activity threshold value */
Configure the inactivity value in the ADXL372.h file.
#define ACT_VALUE 30 /* Activity threshold value */
Set the Accelerometer activity Timer in the ADXL372.h file.
#define ACT_TIMER 1 /* Activity timer value in multiples of 3.3ms */
Set the Accelerometer inactivity Timer in the ADXL372.h file.
#define INACT_TIMER 1 /* Inactivity timer value in multiples of 26ms */
Configure the INT1 pin. (Depending on the ADXL_INT1_SELECT jumper the pin can be pin 7 for INT1_A and pin 6 for INT1_B)
#define ADXL_INT1_PIN 7
Configure the INT2 pin. (Depending on the ADXL_INT2_SELECT jumper the pin can be pin 5 for INT2_A and pin 4 for INT2_B)
#define ADXL_INT2_PIN 5
These two steps can also be done using the quick buttons on the Arduino sketch. Check out the image below for locations of the quick buttons.
Data is output using the USB cable from the Arduino to the PC. The USB port acts as a serial terminal to display the data being transmitted via UART. Opening the serial terminal window from the Arduino IDE is very easy, simply click on the button shown in the picture below.
You may need to configure the serial terminal depending on the current settings of the Arduino IDE. Make sure the settings are as follows:
Select COM Port Baud rate: 9600 Data: 8 bit Parity: none Stop: 1 bit Flow Control: none
The Arduino tools are easy to use, and there are many tutorials and users guides to help learn how to use the Arduino IDE.
For more information on how to use the tool basics, please check out the Arduino tutorials page.
To download the Arduino tools, check out the Arduino software page.
End of Document