Objectives
- Interface a buzzer module with NodeMCU
Things
- NodeMCU board (quantity: 1 no.)
- Micro USB cable A to B (quantity: 1 no.)
- Breadboard (quantity: 1 no.)
- Buzzer module (quantity: 1 no.)
- Jumper wire – male to male (quantity: 3 no.)
- Arduino IDE on your computer
Let’s begin!
A buzzer is an audio signaling device. Buzzers can be categorized into active and passive ones. The difference between an active buzzer and a passive buzzer is: An active buzzer has a built-in oscillating source, so it will make sounds when electrified.
But a passive buzzer does not have such source, so it will not tweet if DC signals are used; instead, you need to use square waves whose frequency is between 2K and 5K to drive it. The active buzzer is often more expensive than the passive one because of multiple built-in oscillating circuits.
Interfacing buzzer module with NodeMCU
Final Code
To copy the code, right click on view raw at the bottom of the code, click on open link in new tab and then copy the code.