Single and Double tap Detection with the ADXL345 Accelerometer
Arduino is an interesting language to play around and with experience, you can earn proficiency in it and build some advance and fascinating projects. The more time you devote in this field, you will learn more. Now, if you have an Arduino with little experience then you can give a shot to this project, which uses the ADXL345 3-axis accelerometer to detect single and double taps. It also blink a dual color i.e. red and green color LED depending onthe detection of single or double tap.
With this project, you can also learnabout Inter-integrated circuit protocol (I2C) and interrupts on the Arduino. There are two designated I2C bus pins available on the Arduino in the form of data and clock. The Arduino IDE also comprises of an I2C library i.e. Wire.h along with other protocols. Further, the ArduinoUno pins 2 and 3 can be arranged as hardware interrupts.
The hardware used in this project includes Arduino Uno, ADXL345 3-axis Accelerometer, Breadboard, 9v power supply cable, I2C wires (5v, SCL, SDA, 0v), Interrupt wires, Jumper wires and two-color LED. You can start building the project by grounding the LED through a 150ohm resistor where the middle pin is ground. Next, the LED is connected to pins 4 and 5 on the Arduino.
The breadboard rails are powered with the Arduino and the power supply cable is attached to it along with the I2C wires. The power and ground wires is connected to the breadboard power rails along with the SDA and SCL lines to the designated SDA and SCL pins on the Arduino. Here, the SDA and SCL lines are data and clock respectively. The interrupt wires are now coupled with pins 2 and 3 on the Arduinoalong with the ADXL345. The construction part of the project ends by connecting 9v power supply.
As the project comprises of large number of functions on the ADXL345, a library was essential to keep everything organized. You can find the library here and sketch here.
For other details, follow the link below -:
Filed Under: Reviews