Interfacing of Piezoelectric Sensor with Arduino
The tutorial, covers the working and interfacing of piezoelectric sensor with Arduino.
Hello geeks, Detecting and measuring vibration is importent for several applications like Decision making circuits or alarm circuits. The best method to detect vibration is Piezoelectric method. The Piezoelectric sensor is affordable sensing device for all electronic designers, Engineers and hobbyist. In this tutorial, we are talking about the working and Interfacing of piezoelectric sensor with arduino.
What is Piezoelectric Sensor?
Basically, piezoelectric sensor is a transducer which converts applied stress into some electrical energy. Simply it converts the energy from one form to another. Means, it converts physical stress into electrical energy. The Stress can be a force, pressure, acceleration or any touching potential. Not all materials have piezoelectric characteristics. There are various types of piezoelectric materials. Few examples of piezoelectric materials are natural available single crystal quartz, bone, artificially manufactured like PZT ceramic etc.
Here's a video of how to interface piezoelectric sensor.
Working of Piezoelectric SensorÂ
When stress applied to piezoelectric sensors, it produces a potential difference of same magnitude of force. So it can be easily used to convert mechanical energy into electrical energy. Piezoelectric sensors generates an analog output voltage.Â
There is also an inverse piezoelectric effect where applying a voltage to the material will cause it to change shape.
As a result, piezoelectric sensors are not normally suitable for measuring static pressure. The output signal will gradually drop to zero, even in the presence of constant pressure. They are, however, sensitive to dynamic changes in pressure across a wide range of frequencies and pressures.
Interfacing of Piezoelectric Sensor with Arduino
As we have to know what a piezoelectric sensor is, let’s look at Interfacing of piezoelectric sensor with arduino. Here we are trying to operate an LED when the pressure sensor detects enough force.
Hardware Required
- Arduino board.
- Piezoelectric pressure sensor.
- LED
- 2 MΩ resistor.
Circuit Diagram
The above diagram shows the hardware connections of Piezoelectric sensor interfacing with Arduino. Piezoelectric sensors have two output pins one is positive potential and other is at negative potential means ground. Positive potential pin connected with pin 3 analog channel of Arduino and negative potential pin connected to ground. A resistor of 2 mega ohm connected between them for protection purpose. A led connected to digital pin zero to check working of sensor output.
A threshold value of 100 is set to the circuit so that the sensor is not activated for vibrations less than the threshold. Using this, we can eliminate unwanted small vibrations. When the output voltage generated by sensor element is greater than the threshold value the LED changes its state i.e. if it is in the HIGH state it goes to LOW. If the value is lower than the threshold LED doesn’t change its state and remains in its previous state.
Code for Arduino
int sensoroutput = 3; // the analog pin connected to the sensor
int ledoutput = 0; // pin connected to LED
int THRESHOLD = 100;
void setup()
{
pinMode(ledPin, OUTPUT); // this function is used to declare led connected pin as output
}
void loop()
{
int value = analogRead(sensoroutput); // function to read analog voltage from sensor
if (value >= THRESHOLD) // function to check voltage level from sensor
{
digitalWrite(ledoutput, HIGH);
delay(100); // to make the LED visible
}
else
digitalWrite(ledoutput, LOW);
}
Application of Piezoelectric sensor
You will see many applications of piezoelectric transducer around you in daily usage things. Some of the major applications of this sensor are as follows,
- Motion detection
- Door knock sensor
- Acceleration measurement system
- force measurement system
- pressure measurement system
- Microphone used sound pressure to convert it into electrical form.
lighters for cigarette - testing of high voltage equipment’s And there are thousands of applications of piezo electric sensor
Â
Very good learning. Easy way of communication.