ESP8266 NodeMCU Door Status Monitor with Telegram Notifications
Notifications In this project, you'll use an ESP8266 NodeMCU board and a magnetic reed switch to keep track of the state of a door. When the door is opened or closed, you'll get a message…

Know the mission before touching a wire.
Understand what you are making, prepare the right tools, and make the workbench safe.
Project details
ESP8266 NodeMCU Door Status Monitor with Telegram Notifications is a iot project. Notifications In this project, you'll use an ESP8266 NodeMCU board and a magnetic reed switch to keep track of the state of a door. When the door is opened or closed, you'll get a message…
- Source pages
- 971-976
- Named parts
- 4
- Build goal
- Working, tested prototype
Tools you need
- Digital multimeter
- Wire stripper and side cutters
- Soldering iron with a fine tip
- Current-limited bench supply
- Computer with a data-capable USB cable
Use eye protection, good lighting, and a clean insulated surface throughout the build.
Safety precautions
- Disconnect every power source before changing a connection.
- Check component polarity, pinout, and supply voltage twice.
- Use a current limit for the first power-up.
- Keep liquids, loose metal, and uninsulated wires away from the bench.
Gather, identify, and understand every part.
Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.
What's this?Image, role, pros, cons, handling & specifications

ESP8266: Best ESP8266 Development Boards
A programmable controller that reads inputs, makes decisions, and drives the project's outputs.
What it does hereIt is the control centre and must use the documented board, pin map, supply, and logic level.
Buy / compare this part ↗Advantages
- Reprogrammable and reusable
- Large learning ecosystem
- Complex behaviour remains changeable
Limitations
- GPIO voltage and current are limited
- Some pins affect boot or communication
- Loads normally need a driver
Handling
- Disconnect power before rewiring
- Avoid static discharge
- Never power motors, relays, or pumps directly from GPIO
Specifications to verify
- Use the exact model, value, package, and rating listed for ESP8266: Best ESP8266 Development Boards; similar-looking parts are not always interchangeable.
- Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
What's this?Image, role, pros, cons, handling & specifications
PASSIVE LEARNING VIEW× 10kΩ resistor
A passive component sets current, voltage, timing, filtering, or signal behaviour without adding gain.
What it does hereIts exact value and tolerance determine how the surrounding stage behaves.
Buy / compare this part ↗Advantages
- Simple and dependable
- Low cost
- Easy to measure before installation
Limitations
- A wrong value can stop or damage the circuit
- Ratings must not be exceeded
- Polarized parts require correct orientation
Handling
- Measure unclear values
- Observe capacitor polarity
- Avoid overheating leads while soldering
Specifications to verify
- Use the exact model, value, package, and rating listed for × 10kΩ resistor; similar-looking parts are not always interchangeable.
- Confirm value, tolerance, power or voltage rating, polarity, and package size.
What's this?Image, role, pros, cons, handling & specifications

Jumper wires for a breadboard
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Jumper wires for a breadboard; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

Schematic of ESP8266 with Reed Switch
A programmable controller that reads inputs, makes decisions, and drives the project's outputs.
What it does hereIt is the control centre and must use the documented board, pin map, supply, and logic level.
Buy / compare this part ↗Advantages
- Reprogrammable and reusable
- Large learning ecosystem
- Complex behaviour remains changeable
Limitations
- GPIO voltage and current are limited
- Some pins affect boot or communication
- Loads normally need a driver
Handling
- Disconnect power before rewiring
- Avoid static discharge
- Never power motors, relays, or pumps directly from GPIO
Specifications to verify
- Use the exact model, value, package, and rating listed for Schematic of ESP8266 with Reed Switch; similar-looking parts are not always interchangeable.
- Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
Connect one verified path at a time.
Explore the named components and standardized signal flow, then use Source Check to verify exact physical pins, values, and topology before applying power.
Trace this circuit.
ESP8266 NodeMCU Door Status Monitor with Telegram Notifications: interactive parts, standardized terminals, responsive anchored wires, student explanations, and the original circuit reference in one shared system.
Trace before wiring
Follow power, ground, inputs, processing, and outputs in that order. Never guess a pin from package shape alone.
Connect with power off
Make short, labelled connections and share a common ground only where the schematic requires it.
Inspect every joint
Check continuity, polarity, adjacent shorts, and loose connections before the first power-up.
Open all source diagrams and build views 5 visuals





Confirm the hardware-only control path.
This project does not include firmware in the source. The circuit itself provides the required behaviour.
How to connect
- Match every controller label to the circuit view and source pin map.
- Join grounds before signal wires when separate low-voltage supplies are used.
- Keep motors, relays, pumps, and other loads on a suitable driver and external supply.
Common mistakes
Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.
Troubleshoot
Disconnect loads, continuity-test one path at a time, then test with a current limit.
Software preparation
No IDE, board package, library, or firmware upload is required for this project.
If you add a programmable controller as an extension, document its pin map separately.
How to upload code
The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.
Assemble, deploy, test, and troubleshoot.
Use the complete source notes in build order, then pass the final checks before calling the project finished.
Build in functional stages
- Power and regulation
- Controller or processing stage
- Inputs and sensors
- Outputs and loads
- Enclosure and strain relief
Power up safely
- Inspect unpowered continuity first
- Apply the lowest safe current limit
- Measure supply rails before signals
- Add one load at a time
- Record expected and actual results
Work from simple to complex
- Confirm power, ground, polarity, and orientation
- Compare each pin with the source
- Test inputs separately from outputs
- Replace only one variable at a time
- Power off before every correction
Follow the documented instructions.
These notes come from this project's source and remain in their original order.
Project overview
Project build noteNotifications
In this project, you'll use an ESP8266 NodeMCU board and a magnetic reed switch to keep track of the state of a door. When the door is opened or closed, you'll get a message in your Telegram account. As long as your smartphone can connect to the internet, you'll get a message no matter where you are. The Arduino IDE will be used to programme the ESP8266 board.
Project Overview
Project build noteIn this project, we'll make a Telegram Bot that will send you messages when a door's status changes. We'll use a magnetic contact switch to tell when something has changed.
A magnetic contact switch is essentially a reed switch that has been encased in a plastic casing so that it can be easily applied to a door, a window, or a drawer to determine whether or not it is open or closed. This allows the switch to detect whether or not the object being monitored is open or closed. When a magnet is close to a switch, the circuit is closed, which means the door is shut. When the door is open and the magnet is far from the switch, the circuit is open. Look at the image below. We can connect the reed switch to a GPIO on the ESP8266 to see when its state changes. Telegram: An Introduction Telegram Messenger is an instant messaging (IM) and voice over IP (VoIP) service that runs in the cloud. You can easily put it on your computer or phone (Android or iPhone) (PC, Mac, and Linux). There are no ads and it is free. You can make bots that you can talk to using Telegram. "Bots are applications made by third parties that run inside Telegram. Users can talk to bots by sending them messages, commands, and inline requests. You use HTTPS requests to Telegram Bot API to control your bots. The Telegram bot will talk to the ESP8266, which will then send messages to your Telegram account. When the state of the door changes, you'll get a message on your phone (as long as you have access to the internet). Creating a Telegram Bot 1. Download and install Telegram from Google Play or the App Store. 2. To make a Telegram Bot, open Telegram and follow the steps below. First, look for "botfather" and click on BotFather, as shown below. Or, go to this link on your phone: t.me/botfather. 3. The next window should pop up, asking you to click the "Start" button.
4. To make your bot, type /newbot and follow the instructions. Name it and give it a user name. Door Sensor is the name of mine, and ESPDoorSensorBot is my username. 5. You will get a message including a link to access the bot and the bot token if your bot is successfully created. This message will be sent to you if your bot was successfully formed. Save the bot token because you'll need it so that the ESP8266 can talk to the bot. Sending a Message to the Bot Before it is able to send you messages, your Telegram Bot must first receive a message from your Telegram account that it can read and respond to. 1. Go back to the chats tab and type the username of your bot into the search field. 2. Choose your bot to start talking. 3. Click the link that says "Start." Universal Telegram Bot Library To talk to the Telegram bot, we'll use Brian Lough's Universal Telegram Bot Library, which gives a simple way to talk to the Telegram Bot API. Follow the steps below to put the latest version of the library in place. To get the Universal Arduino Telegram Bot library, click here. Click Sketch > Include Library > Add.ZIP Library... Add the library that you just got. Important: Don't use the Arduino Library Manager to install the library because it might install an old version. Library for ArduinoJson
You also need to put the ArduinoJson library in place. Follow the steps below to put the library in place. Skech > Include Library > Manage Libraries. Look for the word "ArduinoJson." Put the library in place. We are using version 6.15.2 of the ArduinoJson library.
Parts Required
Project build noteESP8266: Best ESP8266 Development Boards 1 The Magnetic Reed Switch 1× 10kΩ resistor 1 Jumper wires for a breadboard Schematic of ESP8266 with Reed Switch We connected the reed switch to GPIO 4 (D2), but you can connect it to any GPIO that works.
Demonstration
Project build noteAfter adding your network credentials, bot token, and user ID to the sketch, you can upload it to your ESP8266. Go to Tools > Board and choose your
ESP8266 board from the list. Then, go to Tools > Port and choose the COM port that the ESP8266 is connected to. Open the Serial Monitor at 115200 bauds to see if the changes are picked up. You can test the magnetic reed switch by sticking it to your door with Velcro. Now, you'll get a message in your Telegram account when someone opens or closes your door.
You built ESP8266 NodeMCU Door Status Monitor with Telegram Notifications.
You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.
Browse all 500 projects