STEP 1 / 6ESP + IOT

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…

Circuit Atlas themed schematic for ESP8266 NodeMCU Door Status Monitor with Telegram Notifications
PROJECT#416
TRACKIoT
PARTS04
STAGES06
STEP 1 / 6 · Overview

Know the mission before touching a wire.

Understand what you are making, prepare the right tools, and make the workbench safe.

01

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
02

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.

03

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.
Ready to continue?
STEP 2 / 6 · Parts library

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.

NAMED PROJECT INVENTORY4 PART LINES
PARTTYPEQTYREADY
MESP8266: Best ESP8266 Development BoardsMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for ESP8266 NodeMCU Door Status Monitor with Telegram NotificationsMODULE LEARNING VIEW

ESP8266: Best ESP8266 Development Boards

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It 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.
P× 10kΩ resistorPASSIVE1
What's this?Image, role, pros, cons, handling & specifications
10kΩ axial through-hole resistorPASSIVE LEARNING VIEW

× 10kΩ resistor

A passive component sets current, voltage, timing, filtering, or signal behaviour without adding gain.

What it does here

Its 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.
BJumper wires for a breadboardBUILD1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for ESP8266 NodeMCU Door Status Monitor with Telegram NotificationsBUILD LEARNING VIEW

Jumper wires for a breadboard

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It 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.
MSchematic of ESP8266 with Reed SwitchMODULE1
What's this?Image, role, pros, cons, handling & specifications
Circuit Atlas themed schematic for ESP8266 NodeMCU Door Status Monitor with Telegram NotificationsMODULE LEARNING VIEW

Schematic of ESP8266 with Reed Switch

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It 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.
Ready to continue?
STEP 4 / 6 · Source code

Confirm the hardware-only control path.

This project does not include firmware in the source. The circuit itself provides the required behaviour.

01

How to connect

  1. Match every controller label to the circuit view and source pin map.
  2. Join grounds before signal wires when separate low-voltage supplies are used.
  3. 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.

02

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.

03

How to upload code

The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.

Ready to continue?
STEP 5 / 6 · Build

Assemble, deploy, test, and troubleshoot.

Use the complete source notes in build order, then pass the final checks before calling the project finished.

ASSEMBLY

Build in functional stages

  • Power and regulation
  • Controller or processing stage
  • Inputs and sensors
  • Outputs and loads
  • Enclosure and strain relief
TEST

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
TROUBLESHOOT

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
PROJECT-SPECIFIC BUILD NOTES

Follow the documented instructions.

These notes come from this project's source and remain in their original order.

01

Project overview

Project build note

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 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.

02

Project Overview

Project build note

In 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.

03

Parts Required

Project build note

ESP8266: 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.

04

Demonstration

Project build note

After 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.

Ready to continue?
PROJECT ACHIEVED

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.

ESP8266 NodeMCU Web Server: Control Stepper Motor (WebSocket) project thumbnail featuring ESP8266, NodeMCU, Stepper motor
NEXT IOT ADVENTURE

ESP8266 NodeMCU Web Server: Control Stepper Motor (WebSocket)

Ready to reuse what you learned in another project from the same track?

Start this project
Browse all 500 projects