KY-012
KY-012 is Active Piezo-Buzzer module manufactured by Joy-IT.
- Part of the KY-012-Joy comparator family.
- Part of the KY-012-Joy comparator family.
description
1 3 Pinout 2 4 Code example Arduino 2 5 Code example Raspberry Pi 2
Pictures
Technical data / Short description
This Buzzer creates a sound with a frequency of 2,5k Hz.
The active Buzzer-module doesn't need a square wave, unlike the passiv module (KY-006), to create a sound. If it gets a minimum Voltage of 3.3V at its signal pin, the buzzer will create the square wave by itself.
Export: 16.06.2017
Copyright by Joy-IT
- Published under CC BY-NC-SA 3.0
Page 51 of 214
KY-012 Active Piezo-Buzzer module
Pinout
Code example Arduino
In this example, you will see how the buzzer will be ON for 4 seconds and then will be OFF for 2 seconds. int Buzzer = 13; void setup () { pin Mode (Buzzer, OUTPUT); // Output pin initialization for the buzzer } void loop () //Main program loop { digital Write (Buzzer, HIGH); // Buzzer will be on delay (4000); // Waitmode for 4 seconds digital Write (Buzzer, LOW); // Buzzer will be off delay (2000); // Waitmode for another 2 seconds in which the buzzer will be off }
Connections Arduino:
Sensor Signal Sensor [N.C] Sensor GND
= [Pin 13] = = [Pin GND]
Example program download:
KY-006-RPI_PWM
Code example Raspberry Pi
In this example, you will see how, with a defined output pin, the buzzer will be ON for 4 seconds and then will be OFF for 2 seconds. import RPi.GPIO as GPIO
Export: 16.06.2017
Copyright by Joy-IT
- Published under CC BY-NC-SA 3.0
Page 52 of 214
KY-012 Active...