Uncategorized

Smart Mailbox Flag System

A solar-powered, LoRa-enabled smart mailbox flag that detects mail delivery and mailbox access events, relays messages to the homeowner’s phone via a home gateway, and includes a PIR-triggered LED light for convenience.


Table of Contents

URS
Physics
Free Body Diagram
Design
BOM
Electronics
Code
Modeling
Fabrication
Guides
Notes
Contact


URS

User Requirement Specifications

ConstraintsApproachAchieved
Must detect mailbox openingUse PIR sensor inside mailbox
Must detect flag positionUse tilt or reed sensor
Long battery lifeSolar panel + sleep modes
Notify user on phoneLoRa → Wi-Fi gateway → app
LED for illuminationPIR-activated white LED
Waterproof and outdoor safeIP65+ rated enclosure or coating
Cost under $30BOM optimization

Physics

  • Solar charging based on average 4–6 hrs/day of sunlight
  • PIR sensor detection range: ~2m cone
  • LoRa typical range: 300m – 2km (line-of-sight)
  • Mailbox door triggers air movement—good PIR detection point
  • LED consumption: 20–50 mA during active use

Free Body Diagram

  • Arrow vectors showing:
  • Tilt motion of flag
  • PIR sensing field cone
  • LED direction toward mail slot
  • LoRa transmission vector to gateway

(Diagram can be sketched or modeled in Fusion/Onshape)


Design

  • PCB: Custom shaped to fit inside or replace traditional mailbox flag
  • Solar panel mounted on the sun-facing side of the PCB or flag
  • Battery compartment protected inside mailbox or under flag
  • LED aimed inside mailbox
  • Microcontroller sleeps most of the time, wakes on tilt or PIR trigger
  • External antenna for metal mailboxes

BOM

ComponentQtySource/ModelNotes
ESP32 LoRa MCU1TTGO T-Beam or HeltecBuilt-in LoRa + ESP32
PIR Motion Sensor1AM312 or HC-SR501Low power model preferred
Tilt Sensor1Ball switch or MPU6050Detect flag position
LED (white)15mm high-brightWith 220Ω resistor
Transistor (NPN)12N2222 or S8050For LED control
Solar Panel 5V 1W1GenericMount on flag
Charge Controller1TP4056 or BQ24074With protection circuit
LiFePO4 Battery118650 3.2V ~1500mAhSafer than Li-Ion
Waterproof Housing1Custom or repurposed caseFlag-mountable

Electronics

  • Power System: Solar panel → charge controller → LiFePO4 cell
  • MCU: ESP32 in deep sleep, wakes on:
  • Flag tilt (INT pin from tilt sensor)
  • PIR motion (GPIO interrupt)
  • Outputs:
  • LED controlled by transistor
  • LoRa message triggered on events

Code

  • Wake on GPIO (tilt or PIR)
  • Read sensor state
  • Transmit LoRa message:
  • "MAIL_DELIVERED"
  • "MAILBOX_OPENED"
  • Blink LED if mailbox opened
  • Return to sleep
  • Gateway script relays message to phone (via MQTT or webhook)

Modeling

  • CAD model of:
  • Mailbox flag PCB with solar panel on one face
  • Battery mount inside box
  • LED beam visualization
  • STL export for custom flag 3D print

Fabrication

  • PCB design and printing
  • Soldering sensors and microcontroller
  • 3D print or cut enclosure
  • Waterproofing via silicone seals or epoxy
  • Mount solar panel and secure with UV-rated adhesives

Guides

  1. Assembly Guide
  2. Mailbox Installation
  3. Connecting to Gateway
  4. Setting Up Notifications
  5. Battery Replacement

Notes

  • Add a debug LED switch for development
  • Consider adding tamper alert in future version
  • May support OTA firmware updates via LoRa in future (experimental)