Abstract
In response to the alarming rise in home invasions during Sri Lanka's economic crisis, our team developed an
affordable IoT-based home security system. This smart security solution leverages ESP32 microcontrollers,
PIR motion sensors, and magnetic reed switches to provide real-time intrusion detection with smartphone
notifications via the Blynk platform.
The system features a wireless sensor network using ESP-NOW protocol for ultra-low power consumption,
achieving 32-day battery life with potential optimization to 461 days (1.2 years). Designed for the
Sri Lankan market, our product targets the 4000-4500 LKR price range based on comprehensive market
survey results, making advanced home security accessible to middle-income families.
Problem Description & Market Analysis
Sri Lanka's economic crisis led to a significant increase in home invasions and burglaries, creating
urgent demand for affordable security solutions. Existing systems were either too expensive for average
households or lacked smart features like remote monitoring and instant notifications.
Market Survey Results
Our comprehensive market research revealed:
- Target Price Point: 4000-4500 LKR identified as optimal for mass adoption
- Key Requirements: Real-time alerts, smartphone integration, easy installation
- User Demographics: Middle-income families in urban and suburban areas
- Competitive Advantage: 50-60% lower cost than imported alternatives
Market Survey Results - Price point preferences and feature requirements from survey respondents
Market Survey Results - Additional insights on user preferences and competitive analysis
Project Highlights
Ultra-Low Power
32-day battery life (optimizable to 461 days/1.2 years) using ESP-NOW protocol
Custom PCB Design
Professional PCBs designed in Altium Designer for both hub and sensor units
Smartphone Integration
Real-time notifications via Blynk app with remote arming/disarming
Affordable Pricing
18,900 LKR complete system (1 hub + 2 sensors) - 60% cheaper than imports
Wireless Sensors
ESP-NOW protocol for reliable, low-latency sensor-to-hub communication
3D Enclosures
Custom SolidWorks-designed enclosures optimized for compact installation
My Responsibilities
As the PCB Designer and Technical Feasibility Analyst, I was responsible for:
- PCB Design: Designed both Hub and Sensor Unit PCBs using Altium Designer, including component placement, routing optimization, and design rule checks
- Technical Feasibility Analysis: Researched and evaluated sensor technologies (PIR vs. ultrasonic), communication protocols (ESP-NOW vs. WiFi), and power optimization strategies
- Power Consumption Analysis: Calculated battery life scenarios and identified optimization opportunities from 32 days to 461 days
- Component Selection: Evaluated ESP32 variants, battery options, sensor specifications, and voltage regulators for optimal cost-performance balance
- Design Documentation: Created technical specifications, schematic diagrams, and PCB fabrication files
Product Architecture
The system comprises three main components working together to provide comprehensive home security:
1. Hub (Main Control Unit)
- Dual ESP32 Configuration: One for WiFi connectivity to smartphone, one for ESP-NOW sensor communication
- Buzzer Alert System: Local audible alarm when intrusion detected
- Cloud Connectivity: Connects to Blynk server for remote access and notifications
- Power Supply: 5V wall adapter for continuous operation
- Dimensions: 11.9 × 8.25 × 3.3 cm (SolidWorks designed enclosure)
2. Sensor Unit (Wireless Detection Nodes)
- PIR Motion Sensor: Detects human movement with 7m range and 120° field of view
- Magnetic Reed Switches: Door/window open detection with tamper resistance
- ESP32 Controller: Processes sensor data and transmits via ESP-NOW protocol
- Battery Powered: 3.7V Li-ion battery with AMS1117 voltage regulator
- Dimensions: 12.1 × 10.1 × 4.1 cm (compact wall-mountable design)
3. Smartphone Application (Blynk Platform)
- Real-time Notifications: Instant push alerts when sensors trigger
- Remote Control: Arm/disarm system from anywhere with internet
- Safe Mode: Disable alerts when home (prevents false alarms)
- Buzzer Mode: Enable/disable local alarm independently
- Multi-device Support: iOS and Android compatibility
Detailed System Architecture - Hub, Sensor Units, Blynk server, and communication flow with ESP-NOW and WiFi protocols
Design Evolution: From Sketch to Product
Initial Concept Sketches
Our design journey began with hand-drawn sketches exploring various enclosure shapes, component
layouts, and installation methods. Early concepts focused on minimizing size while ensuring
adequate sensor coverage and battery capacity.
Initial Concept Sketches - Hand-drawn design ideas showing early enclosure concepts, component placement, and mounting options
Final Design Refinement
After several iterations, we finalized a compact rectangular design optimized for discrete
wall mounting. The sensor unit features a front panel cutout for PIR sensor while keeping
reed switch connections accessible. The hub design prioritizes ventilation and cable management.
Product Architecture Overview - System components and communication flow
SolidWorks 3D Enclosure Design
Professional 3D enclosures were designed in SolidWorks by team member Javin, ensuring precise
fit for PCBs, optimal sensor positioning, and manufacturing feasibility. The designs include
mounting holes, cable entry points, and ventilation considerations.
Sensor Unit Enclosure (12.1 × 10.1 × 4.1 cm)
- Front panel cutout for PIR sensor with 120° unobstructed view
- Side ports for reed switch wiring connections
- Battery compartment with secure retention mechanism
- Wall-mounting screw holes for various surfaces
- Snap-fit lid for easy battery replacement without tools
Hub Enclosure (11.9 × 8.25 × 3.3 cm)
- Dual ESP32 mounting platform with isolated sections
- Buzzer placement for optimal sound projection
- Cable entry for 5V power adapter
- Ventilation slots for heat dissipation during continuous operation
- Indicator LED window for status visibility
Sensor Unit 3D Model - Complete enclosure showing cover, battery compartment, PCB mounting, and PIR sensor cutout
Hub Enclosure Platform - Showing dual ESP32 placement, buzzer position, and cable management
PCB Design: Altium Designer Implementation
Both Hub and Sensor Unit PCBs were professionally designed in Altium Designer with careful
attention to power distribution, signal integrity, and manufacturing constraints. The designs
incorporate best practices for ESP32 RF performance and low-power operation.
Sensor Unit PCB
- Microcontroller: ESP32-WROOM-32 module with antenna placement optimization
- Power Management: AMS1117 3.3V voltage regulator with decoupling capacitors
- Sensor Interfaces: PIR sensor connector with pull-up resistor, reed switch terminals
- Battery Connection: JST connector for 3.7V Li-ion battery with reverse polarity protection
- Deep Sleep Optimization: Ultra-low quiescent current path for extended battery life
- Programming Interface: UART header for firmware updates
Hub PCB
- Dual ESP32 Layout: Isolated ground planes for WiFi and ESP-NOW modules
- Power Input: 5V barrel jack with TVS diode protection
- Buzzer Driver: NPN transistor-based driver circuit for high-volume alerts
- Indicator LEDs: Status indicators for WiFi, ESP-NOW, and alarm states
- Antenna Considerations: Keep-out zones and ground plane clearance for RF performance
Sensor Unit PCB Layout - Altium Designer layout showing component placement, ground pour, and routing
Hub PCB Layout - Dual ESP32 placement, power distribution network, and buzzer driver circuit
Sensor Unit PCB 3D Rendering - All components mounted, including ESP32, regulator, and connectors
Hub PCB 3D View - Dual ESP32 modules, buzzer, and all connectors visible
System Operation: Safe Mode & Buzzer Mode
Safe Mode (Home/Away Status)
The Safe Mode toggle allows users to disable intrusion alerts when they're home, preventing
false alarms from normal household movement. This feature can be controlled remotely via the
Blynk app before arriving home or locally via a button on the hub.
- Safe Mode ON (Home): Sensors continue monitoring but don't trigger alerts or buzzer
- Safe Mode OFF (Away): Full security active - any sensor trigger sends notification and activates buzzer
- Remote Control: Toggle from smartphone before entering home to avoid alarm
Buzzer Mode (Local Alert Control)
Independent control of the local buzzer allows users to choose between silent notifications
(smartphone only) or full alarm mode (notification + loud buzzer). Useful for nighttime security
without disturbing neighbors.
- Buzzer ON: Loud local alarm (85dB+) activates when intrusion detected
- Buzzer OFF: Silent mode - only smartphone notifications sent (discreet monitoring)
- Use Cases: Buzzer ON for daytime/away, Buzzer OFF for nighttime/discrete monitoring
Power Consumption Analysis & Optimization
Current Implementation: 32-Day Battery Life
With current firmware implementation using ESP32 light sleep mode, the sensor unit achieves
approximately 32 days of operation on a 3.7V 2000mAh Li-ion battery.
Power Budget Breakdown:
- Light Sleep Mode: ~2.5mA average current draw
- Wake-up Events: PIR trigger, reed switch interrupt, periodic ESP-NOW sync
- Active Transmission: ~80mA for 50ms when sending alert via ESP-NOW
- Calculation: 2000mAh ÷ 2.5mA ≈ 800 hours ≈ 33 days
Optimized Implementation: 461-Day Battery Life (1.2 Years)
By implementing ESP32 deep sleep mode with external wake-up, battery life can be extended to
approximately 461 days (15 months / 1.2 years) on the same 2000mAh battery.
Optimized Power Budget:
- Deep Sleep Mode: ~10μA (0.01mA) ultra-low power state
- Wake-up Sources: PIR sensor interrupt pin, reed switch GPIO interrupt
- Wake & Transmit: ~80mA for 100ms (ESP32 boot + ESP-NOW transmission)
- Average Current: ~0.18mA accounting for occasional wake events
- Calculation: 2000mAh ÷ 0.18mA ≈ 11,111 hours ≈ 463 days ≈ 1.2 years
Optimization Techniques
- Deep Sleep Implementation: Use esp_deep_sleep_start() instead of light sleep
- External Wake-up: Configure PIR and reed switch as ext0/ext1 wake sources
- Minimal Boot Time: Optimize code to transmit alert within 50-100ms of wake-up
- Voltage Regulator: Consider ultra-low quiescent current LDO (e.g., MCP1700 ~1.6μA)
- Periodic Sync Elimination: Remove unnecessary periodic wake-ups, rely solely on event-driven wake
Key Features
- Real-time Notifications: Instant smartphone alerts via Blynk when intrusion detected
- Wireless Sensor Network: ESP-NOW protocol for ultra-low latency communication (< 10ms)
- Dual Detection: PIR motion sensors + magnetic reed switches for comprehensive coverage
- Remote Control: Arm/disarm system from anywhere with internet connectivity
- Long Battery Life: 32 days current, optimizable to 1.2 years with deep sleep
- Local & Remote Alerts: Loud buzzer (85dB+) and smartphone notifications
- Scalable System: Support for multiple sensor units per hub (tested up to 8 sensors)
- Easy Installation: Wall-mountable units, no complex wiring required
- Affordable: 18,900 LKR complete system - 60% cheaper than imported alternatives
- iOS & Android Support: Cross-platform Blynk app compatibility
Tools & Technologies
ESP32-WROOM-32
Altium Designer
SolidWorks
Arduino IDE / PlatformIO
ESP-NOW Protocol
Blynk IoT Platform
PIR Motion Sensor
Magnetic Reed Switch
AMS1117 Regulator
Li-ion Battery (3.7V)
Project Gallery
Manufactured PCB for Sensor Unit - Professionally fabricated board ready for assembly
Team with Final Product - Showcasing the completed IoT security system
Demonstration Day - Team presenting the IoT-based home security system
Future Developments
- Deep Sleep Optimization: Implement firmware updates to achieve 461-day battery life
- Camera Integration: Add ESP32-CAM module for visual verification of intrusions
- Solar Charging: Optional solar panel for perpetual sensor operation without battery replacement
- Machine Learning: Implement edge AI for intelligent false alarm reduction (pet detection, etc.)
- Voice Integration: Alexa/Google Home compatibility for voice control
- Multi-zone Support: Software updates for zone-specific arming (e.g., arm only upstairs at night)
- Cloud Storage: Event logging and historical data analysis via cloud database
- Mesh Network: Sensor-to-sensor mesh for extended range in large properties
- Commercial Production: Scale to mass manufacturing with injection-molded enclosures
Marketing Strategy
Our go-to-market strategy focuses on the value proposition of "bank-level security at budget prices"
targeting middle-income Sri Lankan families affected by the economic crisis.
Target Market Segments
- Primary: Middle-income families in urban/suburban areas (monthly income 80,000-150,000 LKR)
- Secondary: Small businesses, home offices, rental property owners
- Geographic: Colombo, Gampaha, Kandy metro areas initially, expand nationally
Marketing Channels
- Online: Facebook/Instagram ads targeting homeowners, YouTube product demos
- Retail: Partnerships with electronics stores (Singer, Damro, etc.)
- Direct Sales: Home security consultations and custom installations
- Word-of-Mouth: Referral discount program (500 LKR per referral)
Competitive Advantages
- 60% lower price than imported alternatives (Ring, SimpliSafe)
- No monthly subscription fees (one-time purchase, free Blynk tier)
- Local support and warranty in Sinhala/Tamil/English
- Customizable to Sri Lankan home architecture (grill gates, compound walls)
- Long battery life reduces maintenance hassles
Budget & Bill of Quantities
Sensor Unit BOM (Per Unit: 3,290 LKR)
| Component |
Quantity |
Unit Price (LKR) |
Total (LKR) |
| ESP32-WROOM-32 |
1 |
850 |
850 |
| PIR Motion Sensor |
1 |
320 |
320 |
| Magnetic Reed Switch |
2 |
150 |
300 |
| AMS1117 Voltage Regulator |
1 |
80 |
80 |
| Li-ion Battery (3.7V 2000mAh) |
1 |
550 |
550 |
| PCB Fabrication |
1 |
400 |
400 |
| Enclosure (3D Print/Mold) |
1 |
450 |
450 |
| Passive Components & Misc |
- |
340 |
340 |
| Total Per Sensor Unit |
3,290 |
Hub Unit BOM (Per Unit: 3,660 LKR)
| Component |
Quantity |
Unit Price (LKR) |
Total (LKR) |
| ESP32-WROOM-32 |
2 |
850 |
1,700 |
| Buzzer (85dB+) |
1 |
250 |
250 |
| 5V Power Adapter |
1 |
420 |
420 |
| AMS1117 Voltage Regulator |
1 |
80 |
80 |
| PCB Fabrication |
1 |
500 |
500 |
| Enclosure (3D Print/Mold) |
1 |
380 |
380 |
| Passive Components & Misc |
- |
330 |
330 |
| Total Per Hub Unit |
3,660 |
Complete System Pricing
Standard Package (1 Hub + 2 Sensor Units)
- Hub Unit: 3,660 LKR
- Sensor Units (×2): 6,580 LKR
- Assembly & Testing: 1,200 LKR
- Packaging & Manual: 460 LKR
- Subtotal: 11,900 LKR
- Profit Margin (30%): 3,570 LKR
- Contingency (10%): 1,190 LKR
- Retail Price: 16,660 LKR
- Market Survey Target: 18,900 LKR (includes marketing, warranty, support)
Note: Pricing based on small-batch production (50-100 units). Mass production (500+ units)
could reduce component costs by 25-30% through bulk purchasing and injection-molded enclosures.
Team & Task Allocation
This project was developed by a dedicated 3-member team from the University of Moratuwa:
My Role - PCB Design & Feasibility
- PCB design (Altium Designer)
- Technical feasibility research
- Power consumption analysis
- Component selection
Javin - Enclosure & Finance
- SolidWorks enclosure design
- Budget planning & BOQ
- Marketing strategy
- Cost optimization
Selaka - Firmware & Testing
- ESP32 firmware development
- Circuit design & assembly
- System testing & debugging
- Blynk app integration
Key Learnings
- PCB Design Excellence: Mastered Altium Designer for professional PCB layout with RF considerations for ESP32
- Power Optimization: Deep understanding of ESP32 sleep modes and battery life calculation for IoT devices
- IoT Protocols: Practical experience with ESP-NOW for low-latency, low-power sensor networks vs. traditional WiFi
- Market-Driven Design: Importance of market research and competitive pricing for product success
- System Integration: Coordinating hardware (PCB), enclosure (SolidWorks), and software (firmware/app) in cross-functional team
- Technical Feasibility Analysis: Evaluating sensor technologies, communication protocols, and power sources against project constraints
- Cost Engineering: Balancing performance specifications with Bill of Quantities to hit target retail price
- Real-World Problem Solving: Designing solutions for genuine social issues (home security during economic crisis)
Documentation & Resources
Acknowledgements
Special thanks to the University of Moratuwa Department of Electronic and Telecommunication Engineering
for providing resources and guidance. Thanks to our teammates Javin and Selaka for excellent collaboration,
and to the survey respondents who provided valuable market insights that shaped our product design and pricing strategy.