Komponente

Die SunFounder ESP32 IoT leer kit kom met 320 stukke komponente wat gebruik kan word om verskeie projekte te leer. Die dokumentasie bladsy van SunFounder bied ‘n volledige lys van komponente wat in die kit ingesluit is. Vir hierdie projek benodig ons die ESP32 bord, die ESP32 kamera uitbreiding bord, ‘n broodbord, jumper drade, ‘n 1K ohm weerstand, ‘n aktiewe gonser en ‘n transistor.

Skema

Die skema wat gebruik word vir hierdie projek is getoon in die prent. Die gonser het ‘n positiewe en negatiewe terminaal waarvan die positiewe gekoppel is aan 3.3 volt en die negatiewe aan ‘n NPN transistor. Die emitter van die transistor is gekoppel aan grond en die basis is gekoppel deur ‘n 1K ohm weerstand na pen 14. Hierdie transistor dien as ‘n skakelaar wanneer ‘n ho sein of 3.3 volt ontvang word. Die weerstand dien as ‘n stroombeperking en skakel die transistor heeltemal aan. Die negatiewe sal gekoppel wees aan grond en die positiewe reeds gekoppel as die negatiewe aan grond gekoppel is, sal dit die gons laat klink. Die transistor wat gebruik word is ‘n S8050 transistor.

Kode

Die kode wat gebruik word om die gonser te laat klink is getoon hieronder. Die kode is geskryf in die Arduino IDE en gebruik die Arduino taal. Die kode maak gebruik van ‘n funksie genaamd tone() wat die gonser laat klink. Die kode stel ook die duur en die toonhoogte van die gonser.

Void setup() {

PinMode(14, OUTPUT);

}

Void loop() {

Tone(14, 1000, 500);

Delay(500);

NoTone(14);

Delay(500);

}

Toepassing

Die ESP32 Tutorial 13 – Arduino Beep met Aktiewe Gonser projek is ‘n eenvoudige projek wat gebruik kan word om ‘n gonser te laat klink. Dit kan gebruik word om ‘n waarskuwingstoon te skep of om ‘n alarm te skep. Dit kan ook gebruik word om ‘n musiekinstrument te skep deur vers

Kil weerstand en koppel dit hierdie, kant is emitter, so koppel, dit, hier, en die. Basis is hier, so koppel, dit, hier, en dan, ons, koppel, ons, gonser, hierdie, kant is positief, so koppel, dit, hier en dan, ons, koppel, ons, drade, hierdie, kant is positief, so koppel, dit, hier, en dan, ons, koppel, ons, drade, hierdie, kant is negatief, so koppel, dit, hier, en dan, ons, het, ons, bedrading, voltooi

Active Buzzer Overview

An active buzzer is an electronic device that produces sound when an electric current is applied. It is commonly used in alarm systems and other electronic devices. The active buzzer is composed of a piezoelectric element and a driver circuit. The piezoelectric element vibrates when an electric current is applied, producing sound. The driver circuit amplifies the sound produced by the piezoelectric element. The active buzzer is typically used in applications where a loud sound is required.

Components Required

The components required for this project include an ESP32 board, an active buzzer, a transistor, and a resistor. The active buzzer must have a PCB (printed circuit board) attached to the bottom. The transistor used should be able to handle a current of 15 amps or 1,500 milliamps. The resistor used should be a kilohm resistor. Additionally, wires and a breadboard will be needed.

Circuit Setup

The circuit setup for this project is relatively simple. First, the active buzzer should be placed on the breadboard. The positive pin of the buzzer should be connected to the collector of the transistor. The emitter of the transistor should be connected to ground. The base of the transistor should be connected to the ESP32 board. The kilohm resistor should be connected between the base of the transistor and the ESP32 board. Finally, the positive and negative wires should be connected to the ESP32 board.

Code

The code for this project is relatively simple. The code should begin by including the necessary libraries. Then, the pin connected to the base of the transistor should be declared as an output pin. The code should then include a loop that will turn the pin on and off at a certain frequency. This will cause the active buzzer to produce a beeping sound.

Testing

Once the circuit is set up and the code is uploaded, the active buzzer should begin to produce a beeping sound. If the active buzzer does not produce a sound, the circuit should be checked for any errors. Additionally, the code should be checked for any errors.

Overview of ESP32 Tutorial 13

The ESP32 Tutorial 13 is a comprehensive guide to setting up an Arduino Beep with an Active Buzzer using SunFounder’s ESP32 IoT Learning Kit. This tutorial provides step-by-step instructions on how to connect the components, as well as the necessary wiring for the buzzer and transistor. Additionally, the tutorial provides an overview of the resistor and the pins used for the connection.

Connecting the Components

To begin, the user should place the board near them and spread the pins out so that they can be inserted somewhere. The positive pin should be connected to the right pin, while the negative pin should be connected to the left pin. There are two empty pins in between. To test the connection, the positive pin should be connected to 5 Volts. The last pin should be connected to the left side, which is marked. When the connection is made, the buzzer should sound.

Wiring the Buzzer and Transistor

The transistor should be placed somewhere in three rows next to each other. The left pin should be connected to the right pin, which is the collector of the transistor. A 1K resistor should be bent and the middle wire, which is the base, should be inserted into the middle wire and placed somewhere on the left side. A blue wire should then be connected to the line where the resistor is connected. A black wire should be connected to the emitter, which is the last pin on the left side.

Connecting the Pins

At this point, three wires should be ready and the positive pin should be connected to 3.3 Volts since the buzzer shown is 5 Volts. It can be connected to either 5 Volts or 3.3 Volts, but it is recommended to connect it to 3.3 Volts. The ground should be connected to the second pin, which is marked, and the blue wire should be connected to the line where the resistor is connected. Finally, the black wire should be connected to the emitter.

Buzzer word afgeskakel en dan het ons nog n vertraging van drie millisekondes en dan gaan ons terug na die lus en nou het ons nou nou die program geskryf.

Hardware Setup

The ESP32 IoT Learning Kit is equipped with a 14-pin active buzzer. This pin is connected to the ESP32 board and can be used to generate beeps. To begin, connect the active buzzer to the ESP32 board by connecting the positive pin of the buzzer to pin 14 of the ESP32 board.

Writing the Code

In order to generate a beep with the active buzzer, the code must be written in the Arduino IDE. To begin, open the Arduino IDE and open the project by clicking on the Learn tab on the left side. Then, click on the Download button. Follow the instructions given in the first lesson and open the project. The project is located in the ESP32 Starter Kit Main folder, under the C folder, and is called 3.1 Beep.

Defining the Pin

Once the project is open, define the pin 14 as an integer type buzzer pin by using the constant value. This value cannot be changed once the program starts running. Next, define the pin mode as an output pin. This will enable the buzzer to be turned on and off. The pin 14 can be typed in as 14 or the pin can be selected from the drop-down menu.

Creating the Loop

The code must include a loop that will run from 0 to less than 50, which is 49. This loop will run 50 times and each time it increments, the code will explain what to do. Within the loop, set the digital write of the buzzer pin to high. This will cause the buzzer to turn on. Then, delay for three milliseconds. After three milliseconds, set the digital write of the buzzer pin to low. This will turn off the buzzer. Then, delay for another three milliseconds before returning to the loop.

Uploading the Code

Once the code is written, it must be uploaded to the ESP32 board. To do this, click on the Upload button in the Arduino IDE. This will compile the code and upload it to the board. Once the code is uploaded, the active buzzer will beep 50 times.

Ek sal dit kies en klik op okay.

ESP32 Tutorial 13 – Arduino Beep with Active Buzzer

The SunFounder’s ESP32 IoT Learning kit provides a comprehensive platform for users to explore the capabilities of the ESP32 board. In this tutorial, we will be looking at how to create a beep sound with an active buzzer. This tutorial will require the use of the Gonser program, which is included in the kit.

Setting Up the Active Buzzer

The active buzzer is connected to the ESP32 board via the GPIO pins. The GPIO pins are labeled on the board and the active buzzer should be connected to the pin labeled “Gonser”. Once the active buzzer is connected, the Gonser program can be used to create a beep sound.

Using the Gonser Program

The Gonser program is used to generate a beep sound with the active buzzer. The program is simple to use and requires only a few steps. First, the user must select the ESP32 board from the “Tools” menu. Then, the user must select the port that the board is connected to. This can be done by clicking on the “Device Manager” option in the “Tools” menu. Finally, the user must enter the code to generate the beep sound. The code is as follows:

“`

Gonser is af en ons hou dit vir 3 millisekondes af daarna kom dit hier en dit gaan en dit word een en twee drie en totdat. Dit 50 is as dit. 50 50 is nie. Minder nie as 50 sal die lus uitgaan en dan het ons 1. Sekonde vertraging die program, bereik hier en die lus sal terugkom en hierdie lus vir lus herhaal

“`

Testing the Beep Sound

Once the code has been entered, the user can test the beep sound by pressing the “Run” button. If the code is correct, the active buzzer should generate a beep sound. The sound should last for three milliseconds and then repeat until the code is stopped. If the sound is not generated, the user should check the code and the connections to ensure that everything is correct.

Kode suksesvol opgelaai.

Components

For this project, you will need the SunFounder ESP32 IoT Learning Kit, an active buzzer, and a few other components. The active buzzer is a small device that produces a sound when an electrical signal is applied to it. It is powered by the ESP32 board and can be used to create simple beeps and tones.

Circuit Setup

The circuit setup for this project is fairly simple. Connect the positive pin of the active buzzer to pin 25 of the ESP32 board and the negative pin to the ground pin. This will allow the ESP32 to control the active buzzer and produce the desired sound.

Coding

The code for this project is also quite straightforward. The first step is to include the necessary libraries. The Arduino IDE comes with the necessary libraries for the ESP32 board, so you don’t need to install any additional libraries.

Next, you need to define the pin that the active buzzer is connected to. This is done by using the following line of code:

Int buzzerPin = 25;

Now, you need to set up the pin as an output pin. This is done by using the following line of code:

PinMode(buzzerPin, OUTPUT);

Finally, you need to write the code that will make the active buzzer beep. This is done by using the following line of code:

Tone(buzzerPin, 1000);

This code will make the active buzzer beep at a frequency of 1000 Hz. You can adjust the frequency to produce different sounds.

Testing

Once you have uploaded the code to the ESP32 board, you should hear a beep coming from the active buzzer. If you don’t hear a beep, then you may need to check your connections and code.

This project demonstrates how to use an active buzzer with an ESP32 board. The components required for this project are an

In this tutorial, we have looked at how to create a beep sound with an active buzzer using the SunFounder’s ESP32 IoT Learning kit. We have seen how to set up the active buzzer and how to use the Gonser program to generate the beep sound. Finally, we have tested the beep sound to ensure that it is working correctly.

In this tutorial, you learned how to use an active buzzer with the ESP32 board. You learned how to connect the active buzzer to the ESP32 board and how to write the code to make it beep. With this knowledge, you can now create projects that involve sound.

Share.
Exit mobile version