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 blinks a dual color i.e. red and green color LED depending on the detection of a single or double tap.
Single and Double Tap Detection with the ADXL345 accelerometer Circuit Connections
(Image Courtesy: barretsprojects)
With this project, you can also learn about 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 Arduino Uno 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.
Single and Double Tap Detection with the ADXL345 accelerometer Circuit (Image Courtesy: barretsprojects)
The breadboard rails are powered by the Arduino and the power supply cable is attached to it along with the I2C wires. The power and ground wires are 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 Arduino along with the ADXL345. The construction part of the project ends by connecting the 9v power supply.
As the project comprises of a 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