Using buzzer by the ESP32 board

ESP32 05-11-24
290 0

Tutorial plan

1- Definition of Buzzer

2- Components Needed to command a buzzer by ESP32 card

3- Circuit Setup

4- Programming the ESP32 with micropython

Definition of Buzzer

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.

Components Needed to command a buzzer by ESP32 card

To command a buzzer with an ESP32 microcontroller, you’ll need the following components:

ESP32 Microcontroller:

ESP32 card

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

Jumper wires to connect the buzzer to the ESP32's pins.

Breadboard (Optional):

Breadboard

Useful for setting up a prototype.

Circuit Setup

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.

Programming the ESP32 with micropython

Here’s a sample code with micropython to create a simple beep sound on the buzzer every 2 seconds :

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

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.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info