A buzzer is an electromechanical or electronic device that produces a loud sound when activated, often used as an alert or signal. There are two main types of buzzers:
1- Electromechanical Buzzers: These use mechanical components that vibrate when an electric current passes through, generating sound.
2- Electronic Buzzers: These use piezoelectric elements or electronic circuits to create sound without moving parts, which makes them more durable.
Buzzers are commonly found in alarms, timers, household appliances, and electronic devices, serving as audible indicators for various functions or alerts.
To command a buzzer with an ESP32 microcontroller, you’ll need the following components:
ESP32 Microcontroller:
The main control unit that will send signals to the buzzer.
Buzzer:
A small electromechanical or piezoelectric buzzer to produce sound. Choose an active buzzer if you want it to beep on a simple HIGH signal from the ESP32, or a passive buzzer if you want to control the tone by generating specific frequencies.
Connecting Wires:
Jumper wires to connect the buzzer to the ESP32's pins.
Breadboard (Optional):
Useful for setting up a prototype.
1- Connect the positif terminal (+) of the buzzer to a IO23 pin on the ESP32.
2- Connect the negatif terminal (-) of the buzzer to GND.
Here’s a sample code with micropython to create a simple beep sound on the buzzer every 2 seconds :
1 2 3 4 5 6 7 8 9 10 |
import time from machine import Pin buzzer=Pin(23,Pin.OUT) while True: buzzer.value(1) #the buzzer sounds time.sleep(2) # wait 2s buzzer.value(0) #the buzzer stops ringing time.sleep(2) # wait 2s |
Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.
Zaouiet Kontech-Jemmel-Monastir-Tunisia
+216 92 886 231
medaliprof@gmail.com
Robotic site created by MedAli-Teacher info