
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
Constraints | Approach | Achieved |
---|---|---|
Must detect mailbox opening | Use PIR sensor inside mailbox | ☐ |
Must detect flag position | Use tilt or reed sensor | ☐ |
Long battery life | Solar panel + sleep modes | ☐ |
Notify user on phone | LoRa → Wi-Fi gateway → app | ☐ |
LED for illumination | PIR-activated white LED | ☐ |
Waterproof and outdoor safe | IP65+ rated enclosure or coating | ☐ |
Cost under $30 | BOM 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
Component | Qty | Source/Model | Notes |
---|---|---|---|
ESP32 LoRa MCU | 1 | TTGO T-Beam or Heltec | Built-in LoRa + ESP32 |
PIR Motion Sensor | 1 | AM312 or HC-SR501 | Low power model preferred |
Tilt Sensor | 1 | Ball switch or MPU6050 | Detect flag position |
LED (white) | 1 | 5mm high-bright | With 220Ω resistor |
Transistor (NPN) | 1 | 2N2222 or S8050 | For LED control |
Solar Panel 5V 1W | 1 | Generic | Mount on flag |
Charge Controller | 1 | TP4056 or BQ24074 | With protection circuit |
LiFePO4 Battery | 1 | 18650 3.2V ~1500mAh | Safer than Li-Ion |
Waterproof Housing | 1 | Custom or repurposed case | Flag-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
- Assembly Guide
- Mailbox Installation
- Connecting to Gateway
- Setting Up Notifications
- 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)