In this blog, we will see what is an accelerometer and how to interface the ADXL335 accelerometer sensor with Arduino UNO.
In this blog, mainly we will see what is an accelerometer and how to interface the ADXL335 accelerometer sensor with Arduino UNO.
You might have seen in smartphones that when you rotate the device the screen changes its orientation, it's nothing but an accelerometer. So we will also be covering how accelerometer sensor works, it's types and applications. Let's move to the introduction part of the accelerometer.
Introduction of Accelerometer
Cameras and smartphones these days use an accelerator consisting of an axis-based motion sensor. They can detect earthquakes as well. It’s an electromechanical device measure acceleration forces. The force can be static or either dynamic. Acceleration, as we all know, is the measurement of the change in velocity upon a given time.
A laptop hard drive also uses an accelerometer. Suppose when a laptop falls, the accelerometer detects and turns off the hard drive to prevent it from being damaged to prevent data loss. An accelerometer also helps the automotive industry in airbag technology, in detecting crash and inflating the airbag almost in milliseconds of time.
It also helps in calculating the gravitational pull and checking the angle and tilt device. By this way, it also detects how the device is moving. Geolocation catching uses an accelerometer. Such as in google maps. It gives GPS the proper coordinates whenever the device moves during navigation.
The rotation of a phone I.e portrait or landscape is also identified by accelerometer. Or if you’re moving uphill or coming downhill.
In short, we can say its a device that calculates changes in gravity acceleration. They help in calculating changes in vibration, tilt, and acceleration.
So now that we've learned basics of accelerometer we will move to its working.
How does Accelerometer Sensor Work?
[caption id="attachment_661531" align="aligncenter" width="599"] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1.0 working of typical accelerometer sensor[/caption]
At rest accelerometer measures 1g that is equal to earth’s gravitational pull 9.81 meters per second. Some of the accelerometers work on piezoelectric effect which can calculate small changes in voltage while some other calculates the change in capacitance of two components.
A basic accelerometer consists of multiple axes, two to determine most two-dimensional movement with the option of a third for 3D positioning. Many smartphones and cameras these days use three-axis models, whereas cars basically use two-axis to determine the moment of impact. Accelerometers are sensitive, they even manage to measure even the tiniest of the changes in acceleration. Accelerometer senses static or dynamic forces of acceleration.i.e static forces such as gravity and dynamic forces such as vibrations and movement.
Nowadays accelerometer can measure multiple axes as many as 3 axes. Basically, accelerometer consists of internal capacitive plates, some are fixed while others are attached to minuscule springs that move internally as acceleration force act upon the sensor. As plates will move the acceleration can be determined by changing capacitance.
The piezoelectric accelerometer can be centered around piezoelectric materials. These tiny crystal structures output electrical charge when placed under mechanical stress. The fixation is as dumped mass on a spring. When it moves/accelerates the displacement of mass takes place. This displacement value helps calculating acceleration.
Piezoelectric accelerometers have single crystals. On the application of stress, these crystals generate a voltage to calculate velocity and orientation.
While Capacitive accelerometers use silicon element. Here it senses changes in capacitance when acceleration happens. This change transforms into a voltage to measure the velocity.
Now after knowing the working of accelerometer your clarity on the topic might have increased, so lets now go to the types of an accelerometer.
Types of Accelerometer
There are two types of accelerometer:
(i) AC response (ii)DC response
DC Response
DC response can measure up to zero hertz which helps in calculating gravity vector. Non-DC accelerometers have an intrinsic decay function that results in an insignificant error during numeric integration, especially over long-duration events.
AC Response
AC response is AC coupled so they can’t calculate static accelerations like gravity and sustained accelerations. They are highly sensitive they can go down to 0.1 Hertz. Accelerometers also have applications in vibration testing due to their wide frequency response and high SNR( Signal to noise ratio).
1. compression mode
These accelerometers consist of crystal elements that emit charge when under compressive force. The internal sensing element uses mass coupled to crystal for sensing. accelerometers are kept in the suitable body, stainless steel which enables the sensor to be robust meaning it can withstand harsh environments. The sensor has an electrical connection that can be either a sealed cable or a plug socket.
These accelerometers also have Scientific and industrial applications.
I.e- Automotive, aerospace, medical, maintenance, process control, etc…
2. Shear mode
The shear mode also uses sensing crystals, these crystals lie in between a center post and seismic mass.
When this type of accelerometer is under acceleration, the mass causes shear stress on the sensing crystal. Using piezoelectric sensors, the stress applied to crystals will result in a proportionate electrical output. Built-in signal conditioning circuitry of sensors or directly the electrical connector for charge model types transmit electrical output.
These accelerometer use sensing crystals isolated from the base and housing, this means that they excel in rejecting thermal transient and base bending effects. They are also smaller in size, promoting higher frequency response.
3. Capacitive accelerometer
These types of accelerometers sense a change in electrical capacitance in relation to acceleration. The sensing element of the capacitive accelerometer consists of two parallel plate capacitors acting in differential mode.
These parallel capacitors operate in a bridge circuit they have two fixed capacitors that alter the peak voltage generated by an oscillator when the sensor is under acceleration. The detection circuit detects the peak voltage which is fed to a summing amplifier to process the output signal.
As we know the types now, let's interface an accelerometer with Arduino.
Accelerometer Sensor Interfacing with Arduino UNO (adxl335)
[caption id="attachment_662977" align="aligncenter" width="599"] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1.1 Adxl335 Module[/caption]So now let's Interface an Accelerometer sensor module with Arduino to check it's working.
1. Things Required
[caption id="attachment_661538" align="aligncenter" width="599"] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1.2 Things required[/caption]2. Software Required
3. Connection Diagram
[caption id="attachment_662980" align="aligncenter" width="599"] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1.3.ADXL335 Pinout[/caption] [caption id="attachment_661580" align="aligncenter" width="599"] Â Â Â Â Â Â Â Â Â Â 1.4 Adxl335 accelerometer sensor interfacing with arduino[/caption]
4.Program
See the real time working of this code in this video.const int xpin = A0;
const int ypin = A1;
const int zpin = A2;
void setup()
{
Serial.begin(9600);
}
void loop() {
int x = analogRead(xpin);
delay(50);
int y = analogRead(ypin);
delay(50);
int z = analogRead(zpin);
delay(50); Serial.print(x-322);
Serial.print("\t");
Serial.print(y-320);
Serial.print("\t");
Serial.print(z-263);
Serial.print("\n");
}
So now as we've seen the types of accelerometer, we should know its practical area, where it is applied in real-life scenarios.
Application
- Mobile phones use an accelerometer to check the rotation of devices and play games.
- Smart bands/Smartwatches use accelerometer which detects running, walking, climbing, etc...
- Automotive vehicles use an accelerometer to detect collisions and open airbags in an instant.
- GPS systems use the accelerometer for navigation and checking the speed of moving objects.
- Cameras use an accelerometer for image stabilization to capture clear photographs.
- RC Drones use an accelerometer for balancing and stabilization.
- Used in laptop hard drive to shut it off when the laptop is on free fall.
- Game controllers also use an accelerometer. Such as PSP, XBOX
- Used to measure earthquake activity and aftershocks.
- Used in the Internal Navigation System (INS). That is, measuring the position, orientation, and velocity of an object in motion without the use of any external reference.
- Used in video games like PlayStation 3, so as to make the steering more controlled, natural and real.
- Used in measuring the depth of CPR chest compression.
So above mentioned were the practical applications of an accelerometer. So Now let's come to the conclusion of this blog and things we learned from this blog.
Conclusion
We learned from the basics of an accelerometer, what it is actually, and how it works. Where it is applied, and how to interface with Arduino, etc... I think it is a technology that will be in the tech market for a long haul. What are your thoughts on this?