Table of Contents

Interfacing Piezo electric sensor with Quarky

Example Description
Learn about the working principle of piezoelectric sensors, their applications, and how to interface them with Quarky using Pictoblox.
Introduction
Introduction

A piezoelectric sensor is a type of sensor that uses the piezoelectric effect to measure changes in pressure, acceleration, force, temperature, and other physical quantities. The piezoelectric effect is a phenomenon in which certain materials generate an electric charge in response to mechanical stress or deformation. This property makes piezoelectric sensors useful for a wide range of applications where accurate measurements of mechanical changes are required. Here’s how piezoelectric sensors work:

  1. Piezoelectric Material: Piezoelectric sensors are constructed using materials that exhibit the piezoelectric effect, such as quartz, certain ceramics, and some polymers. These materials have a crystalline structure that allows them to generate an electric charge when subjected to mechanical pressure or deformation
  2. Applications: Piezoelectric sensors find applications in various fields:
    • Pressure Sensing: Measuring changes in pressure in industrial, medical, and automotive applications.
    • Acceleration and Vibration Monitoring: Detecting vibrations and accelerations in devices, structures, and machinery.
    • Acoustic and Sound Detection: Capturing sound waves for microphones and other acoustic applications.
    • Force Measurement: Measuring forces in materials testing, robotics, and biomechanics.
    • Temperature Compensation: Piezoelectric materials can be used for temperature compensation in electronic components.

Piezoelectric Sensor Pinout, Working & Datasheet

Circuit Diagram

 

Code

  1. Open Pictoblox and create a new file.
  2. Goto boards and select Quarky.
  3. Add ” When Flag Clicked” from the event palette into the scripting area.
  4.  Add Forever ” block from the controls palette.
  5. From looks palette drag “say() ” block into the scripting area and place it inside the forever block.
  6. From Sensor palette of Quarky, Drag ‘Read analog sensor () at ()”  and place it inside the say block. Choose generic from the drop-down.
  7.  Your final script will look like this.

Output

Now to read the different changes from the sensor, hit the sensor with your punch and you will see the change in sensor value shown by your sprite.

OUTPUT Gifs will be updated soon.