Control a Buzzer Remotely Using NodeMCU ESP8266 and KiwisIoT Platform
by prakatheeshwaranR in Circuits > Arduino
56 Views, 0 Favorites, 0 Comments
Control a Buzzer Remotely Using NodeMCU ESP8266 and KiwisIoT Platform
In this project, I built a simple IoT-based buzzer control system using a NodeMCU ESP8266, a buzzer, and the KiwisIoT platform.
The idea is very simple. Instead of controlling the buzzer directly from the NodeMCU, I wanted to control it remotely from an IoT dashboard.
The NodeMCU connects to Wi-Fi and communicates with the KiwisIoT platform. When the dashboard sends a value of 1 through Control Channel 0, the buzzer turns ON. When the value changes to 0, the buzzer turns OFF.
This is a simple beginner project, but it also demonstrates the basic idea behind remotely controlled alarms, warning systems, and other IoT devices.
Supplies
- NodeMCU ESP8266
- Buzzer
- Jumper wires
- USB cable
- Wi-Fi connection
- Arduino IDE
- KiwisIoT platform
Circuit Connection
The circuit is very simple.
NodeMCUBuzzer
D2-Positive (+)
GND-Negative (-)
Connect the positive terminal of the buzzer to the D2 pin of the NodeMCU and connect the negative terminal to GND.
If you are using a larger buzzer that requires more current than a GPIO pin can safely supply, drive it through a suitable transistor rather than directly from D2.
Setting Up KiwisIoT
I created a dashboard in KiwisIoT and used Control Channel 0 for controlling the buzzer.
The control logic is:
The NodeMCU continuously maintains its connection with KiwisIoT and listens for these control values.
Arduino Code
#include <KiwisIoT.h>
// Wi-Fi Details
const char* ssid = "YOUR_WIFI_NAME";
const char* pass = "YOUR_WIFI_PASSWORD";
// KiwisIoT Dashboard Topic
const char* topic = "YOUR_DASHBOARD_TOPIC";
KiwisIoT kiwisiot(ssid, pass, topic);
// Buzzer connected to D2
#define BUZZER_PIN D2
void onControl(String ch, String val) {
// Listen only to Control Channel 0
if (ch != "0") return;
Serial.print("Channel: ");
Serial.println(ch);
Serial.print("Value: ");
Serial.println(val);
// Value 1 = Buzzer ON
if (val == "1") {
tone(BUZZER_PIN, 1000);
Serial.println("Buzzer ON");
}
// Value 0 = Buzzer OFF
else if (val == "0") {
noTone(BUZZER_PIN);
Serial.println("Buzzer OFF");
}
}
void setup() {
Serial.begin(115200);
delay(1000);
pinMode(BUZZER_PIN, OUTPUT);
// Keep buzzer OFF initially
noTone(BUZZER_PIN);
Serial.println("KiwisIoT Buzzer Control");
Serial.println("Channel 0");
Serial.println("Value 1 = ON");
Serial.println("Value 0 = OFF");
kiwisiot.begin();
}
void loop() {
// Keep the KiwisIoT connection active
kiwisiot.run();
}
Testing the Project
After uploading the code, I opened the Serial Monitor at 115200 baud.
Once the NodeMCU connected to Wi-Fi and KiwisIoT, I tested the control from the dashboard.
When KiwisIoT sends:
the buzzer starts making a sound.
When it sends:
the buzzer stops.
This confirmed that the NodeMCU was receiving commands from the KiwisIoT dashboard correctly.
How It Works
KiwisIoT Dashboard → Wi-Fi → NodeMCU ESP8266 → D2 → Buzzer
The ESP8266 receives the control value from KiwisIoT.
If the received value is 1, the program generates a tone on D2 and turns the buzzer ON.
If the value is 0, noTone() stops the signal and the buzzer turns OFF.
Applications
This simple project can be expanded into several real-world IoT applications, such as remote alarms, door alerts, machine warning systems, water-level alerts, security notifications, temperature warnings, and sensor-triggered buzzers.
Instead of manually sending 1 and 0, the buzzer could eventually be triggered automatically when a connected sensor detects a specific condition.
Conclusion
This project helped me understand how a physical output device can be controlled remotely using NodeMCU ESP8266 and KiwisIoT.
Even though a buzzer is a simple component, connecting it to an IoT platform makes it possible to build much more useful remote alert and notification systems.
The basic concept is simple:
Value 1 → Buzzer ON
Value 0 → Buzzer OFF
This makes the project a good starting point for learning IoT device control with the ESP8266.
In the Instructables editor, add a real photo of your completed NodeMCU + buzzer circuit as the cover, then put your circuit diagram in Step 2, KiwisIoT dashboard screenshot in Step 3, Arduino code in Step 4, and a working-result photo/video in Step 5. Instructables supports documenting projects with text, images, video, and files.