Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Based Piezo Sensor Analog Reader

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based Piezo Sensor Analog Reader

Circuit Documentation

Summary of the Circuit

This circuit is designed to read analog values from a piezo sensor and output the readings to a serial monitor. The piezo sensor is interfaced with an Arduino UNO microcontroller. The sensor's signal is conditioned through a 1kΩ resistor, and a 20MΩ resistor is used to provide a reference to ground. The Arduino UNO is programmed to read the analog voltage from the sensor, convert it to a digital value, and print this value to the serial monitor at a baud rate of 9600 bps. The circuit operates with a simple loop that includes a delay of 100 milliseconds between readings.

Component List

Arduino UNO

Piezo Sensor

Resistor (1kΩ)

Resistor (20MΩ)

Wiring Details

Arduino UNO

Piezo Sensor

Resistor (1kΩ)

Resistor (20MΩ)

Documented Code

/*
 * Piezo - Simple
 * This sketch reads the analog value from a piezo sensor connected to pin A0
 * through a 1kΩ resistor and prints the value to the serial monitor.
 */

void setup() {
  // Initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

void loop() {
  // Read the input on analog pin A0:
  int sensorValue = analogRead(A0);
  // Print the sensor value to the serial monitor:
  Serial.println(sensorValue);
  // Wait for 100 milliseconds:
  delay(100);
}

Filename: sketch.ino

This code is written for the Arduino UNO microcontroller. It initializes serial communication in the setup() function and continuously reads the analog value from pin A0 in the loop() function. The read value is then printed to the serial monitor, and the loop includes a 100-millisecond delay before repeating.