The problem
Checking an empty letterbox every day is a small annoyance that adds up — and important letters sit unnoticed for days. The fix is trivial in concept: detect the drop event and notify the owner. This project builds that as a complete IoT prototype: an IR sensor inside a model letterbox watches the slot, an ESP32 timestamps every drop, pushes an instant alert to the owner's Telegram, sounds a local buzzer, and drives an SG90 servo that raises a physical "MAIL" flag on the box. A second sensor state tracks whether the box has been emptied, so the flag and the "mail waiting" status clear only when the owner actually collects the post. The whole event history is retrievable from the Telegram bot.
Detects each arriving letter as a break in the beam, debounced so one letter counts once.
Follow the working sequence
How it works
- The IR sensor beam across the letterbox slot is broken when a letter drops through; the interrupt wakes the ESP32.
- Firmware debounces the event (ignoring flutter from a slowly sliding letter) and records the arrival timestamp.
- The ESP32 connects over Wi-Fi and pushes a Telegram alert: "Mail arrived at HH:MM, DD MMM".
- The SG90 servo rotates to raise the MAIL flag, and the buzzer sounds a short arrival tone.
- The "mail waiting" state stays active — on the flag, the bot status and the event log — until the collection sensor detects the box being opened and emptied.
- On collection, the flag lowers, the status clears, and the collection event is timestamped in the log.
- The owner can query arrival history or current status anytime with Telegram commands.
Tech stack:
- ESP32 development board (Wi-Fi)
- Arduino IDE (C/C++ firmware)
- IR break-beam / reflective sensor module for drop detection
- SG90 micro servo for the MAIL flag
- Active buzzer module
- Telegram Bot API over HTTPS
- Model house door + wooden letterbox prototype rig
- 5 V supply with battery-backup option
| Parameter | Value |
|---|---|
| Controller | ESP32, deep-sleep between events, wake on sensor interrupt |
| Drop sensor | IR beam-break module, debounced in firmware |
| Collection sensor | Lid/door state sensor (reed/IR) |
| Flag actuator | SG90 micro servo, approximately 180° travel |
| Alert channel | Telegram bot over Wi-Fi (HTTPS) |
| Local alert | Active buzzer, short arrival tone |
| Event log | Timestamped arrivals + collections in on-board flash |
| Power | 5 V supply; battery backup supported (design target: weeks in sleep) |
Project features
- [Mail-drop detection] An IR sensor inside the letterbox slot detects each arriving letter or parcel as a break in the beam, debounced so one letter counts once.
- [Instant Telegram alert] Every detected drop pushes a Telegram message to the owner with the exact date and time of arrival.
- [Physical MAIL flag] An SG90 servo raises a small flag on the box when mail arrives — visible from the street without checking a phone.
- [Collection tracking] Opening the box to collect mail is detected by a second sensor state; the flag lowers and the "mail waiting" status clears only on collection.
- [Local buzzer] A buzzer sounds briefly on each arrival for in-home notification alongside the Telegram alert.
- [Event history] Every arrival and collection is timestamped and stored on-device, retrievable anytime with a Telegram command.
- [Low-power design] The ESP32 sleeps between events and wakes on the sensor interrupt, so a battery-backed deployment lasts weeks (design target).
What is included
- Working prototype: model house door, wooden letterbox with IR sensor, servo flag, ESP32, buzzer
- Complete ESP32 firmware (interrupt wake, debounce, Telegram alerts, servo control, event log)
- Telegram bot creation and setup guide
- Wiring diagram and connection table
- Sensor positioning and debounce tuning guide
- Project report PDF (background, event-driven IoT design, methodology, working, results)
- PPT presentation for final review
- Viva Q&A preparation document (interrupts, deep sleep, IR sensing, servo control, Telegram API)
Limitations & prerequisites
- Telegram alerts need Wi-Fi at the letterbox; the flag and buzzer work locally without it.
- Very thin postcards can occasionally pass without breaking the beam cleanly — sensor positioning is tuned in the setup guide to minimize this.
- The servo flag is a demo-scale indicator; a weatherproof outdoor deployment needs an enclosure (listed as future scope).
- Battery life in the "weeks" range is a design target for the sleep-based firmware, not a measured claim — actual life depends on arrival frequency and Wi-Fi signal.
- The model letterbox demonstrates the concept at desk scale, not full postal size.
Frequently Asked Questions
How does it detect the mail?
An IR sensor beam crosses the letterbox slot. When a letter drops through and breaks the beam, the ESP32 wakes on the interrupt, debounces the signal, and registers one arrival event.
What does the owner receive?
An instant Telegram message with the arrival timestamp, e.g. "Mail arrived at 10:42, 22 Sep". The owner can also ask the bot for the event history or current mail-waiting status.
How does it know the mail was collected?
A second sensor watches the box lid/door. Opening it to take the mail clears the "mail waiting" state, lowers the servo flag, and logs the collection with a timestamp.
What if the Wi-Fi is down?
The local side keeps working: the flag raises, the buzzer sounds, and the event is logged with its timestamp. The Telegram alert is sent when connectivity returns.
How long does the battery last?
The design target is weeks, because the ESP32 sleeps between events and wakes only on the sensor interrupt. Actual life depends on how often mail arrives and on Wi-Fi conditions — stated as a target, not a measured figure.
Is this project suitable for a final-year project?
Yes — for IoT & Embedded programs. It is a tidy event-driven IoT build: interrupts, deep sleep, sensor debouncing, servo actuation and cloud messaging in one demonstrable system. Suitable for B.E./B.Tech final-year projects in IoT & Embedded.
Components & software requirements
- ESP32 development board (Wi-Fi)
- Arduino IDE (C/C++ firmware)
- IR break-beam / reflective sensor module for drop detection
- SG90 micro servo for the MAIL flag
- Active buzzer module
- Telegram Bot API over HTTPS
- Model house door + wooden letterbox prototype rig
- 5 V supply with battery-backup option
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.