# Piezo Sensor Experimentation

3,394

16

1

Did you know that you could use the speaker in an old phone to detect if someone is knocking on your door? Here we will explain how Piezos work and give some examples of how they could be used.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: How Does the Piezo Work?

Inside the Piezo, there are crystals. These crystals are normally in electronic equilibrium. However, the moment the Piezo starts to vibrate, the crystals are no longer in equilibrium, and they emit a small electric charge. This effect is called piezoelectricity. The more vibration, the more voltage it emits. This ability is used to detect vibration by reading the voltages coming from the Piezo.

This phenomena also works in reverse. By sending small voltages to the Piezo, the crystals will start to vibrate and make soundwaves. This means that the Piezo can be used as both an input, detecting knocks, vibrations and sounds, and also as an output, making sounds.

## Step 2: The Different Types of Piezos

There are many different ones, but they generally work in the same way. We have been looking at these different sensors. Basically, the difference between them is what direction you mount them, and the direction of the vibrations you want to detect. Also, some of them are a bit more sensitive others. The ones with the thin film detect vibrations perpendicular to the film, and these could also be used as accelerometers.

## Step 3: The Relationship Between Applied Force and Registered Voltage

We did a lot of testing to find the relationship between the force applied and readings from the arduino, but the results seemed very unstable. We tried smoothing/averaging (link to code) the readings, but the results still seemed very little accurate, and at times completely random. We also used a potentiometer (link) to vary the threshold above which readings were recorded, but it did not help with stabilizing the readings.

One knock takes place over a period of time. As we used little or no delay (1 millisecond), we read several values in one knock. The values showed in the points in the graph above is taken by adding together all the different readings from one knock. The readings could be all whole numbers between 0 and 1023, and a typical reading was (0, 200, 65, 2, 1, 0), creating a value of 268 in the graph.

An important factor in registering the values, is the amount of time from the beginning to the end of the knock. If you apply a large amount of force to the sensor, but in a long a mount of time, the registered voltage values will still be small. If the impact takes place over a short period of time, the values will be higher.

Conclusion of tests: The sensors are not very accurate. They should be used to detect that a knock has taken place, rather than the amount of force used in a knock. That is, unless you are looking for an average of the readings of several knocks with the same force and impact duration.

According to the manufacturers of our sensors, the relationship between the applied force and registered voltage is linear. However, from our experience, the accuracy does not seem to be very good.

## Step 6: What Is This Technology Used for Today?

Piezoelectricity is used in a lot gadgets that are used in our every day life, for example

• Speakers
• Microphones
• Watches
• touch screens in ATM machines
• cigarette lighters
• earthquake monitors

## Step 7: Where Could the Technology Be Used?

The sensor could either be used in an analog or a digital way. Using the Piezo to create small voltages for an LED is an analog way of using it, and using it as a sensor for a microcontroller is a digital way of using it.

Here are some analog ways of using it:

• The Piezo could be used as a small generator for an LED. There is a lot of potential using this technology in children’s and babies’ toys. It is cheap, and with a relatively small risk of something breaking. The educational effect it could have on children is huge. For example, using it as a tool for learning, for approximately two year-olds, would be very interesting. This is about the time children learn about cause and effect, and that every action has a reaction. Children this age rund around turn on and off faucets all the time and light switches all the time, and they think it is great. Creating a simple toy, for example a hammer that gives off a small flash of light when you use it, would be interesting. Or maybe even a toothbrush that lights up, making brushing your teeth fun!
• Since the technology is so small and cheap, it could be implemented into objects that normally would not permit any use of technology. Take a bottle of beverage in the supermarket for example: Wouldn’t it be cool to see a light flash on the lid of your milkshake when you are shaking it? Or, if we introduce a capacitor into the circuit, the LED could make a larger flash after you have shaken the milkshake for a certain amount of time?

Here are some digital ways of using it:

• On any simple electronic device with few number of buttons, the buttons could be replaced by gently tapping the device. A subtle tap on the device would turn it on, and another tap would turn it off. Maybe two consecutive taps could mean “volume up”, and three taps “volume down”.

• Maybe it would be interesting to use the Piezos as sensors to give machines human capabilities. For example a pat on the back could increase the performance of a machine?

• If someone would knock on your door, the doorbell would ring.

• In China it is normal to use fans on hot days. The movement in the fan indicates that the person using it is hot, and this information could be used to make something happen, for example turning room temperature down or start an electrical fan.

## Step 8: Example: Create a Doorbell Using an Old Phone

You need:

• an arduino
• a Piezo speaker/sensor

Here you can find the code and fritzing wiring setup of the project.

## Recommendations

• ### Internet of Things Class

22,792 Enrolled