Arduino, Cpp.
1 piezo, 1 Arduino UNO, 1 breadboard, jumpers, 1 LED, 2 resistors — 1 of 220 ohms and another of 1 Mohm. Follow the schematic diagram: Now the programming: // These constants won't change: const int ledPin = 6; // LED connected to digital pin 6 const int knockSensor = A0; // The piezo is connected