A custom microstrip patch antenna and ESP32-based RSSI trilateration system for indoor positioning of GPS-denied mobile nodes
- 🎯 Overview
- ✨ Features
- 🔬 Technical Specifications
- 🏗️ System Architecture
- ⚡ Installation & Setup
- 🎮 Usage & Operation
- 🧪 Methodology & Project Phases
- 📁 Project Structure
- 📚 Documentation & References
- 📄 License
OpenIPS is a low-cost indoor positioning system built around a custom-designed 2.4 GHz microstrip patch antenna. The system combines five ESP32 nodes, ESP-NOW communication, RSSI ranging, trilateration, Kalman filtering, and a browser dashboard for GPS-denied indoor positioning.
The system targets GPS-denied environments such as collapsed structures, underground passages, and terrain-blocked zones, with disaster-response scenarios (e.g. earthquake rescue robotics) as the primary motivating use case.
A hybrid antenna architecture underpins the design: the custom patch antenna is evaluated on the mobile node, while the three fixed anchors use ESP32 built-in trace antennas. This makes it possible to compare antenna effects under the same anchor layout.
✅ Project completed and evaluated. The antenna was designed in MATLAB, fabricated on FR4, measured with a LiteVNA, corrected with a lumped L-network, and evaluated in the OpenIPS positioning system. The final report records room-level and zone-level performance rather than metre-level accuracy.
Figure 1. OpenIPS system architecture overview
| Feature | Description |
|---|---|
| 📡 Custom Patch Antenna | Inset-fed rectangular microstrip patch; fabrication was corrected with a lumped L-network |
| 🎯 Compact Design | Optimized for FR4 substrate (εr = 4.4, h = 1.6 mm), fabricable with locally available materials |
| 🔀 Hybrid Antenna Strategy | Custom patch on the mobile node + built-in ESP32 trace antennas on fixed anchors |
| 📶 ESP-NOW Communication | Low-latency, WiFi-independent link between anchors and rover |
| 📍 RSSI Trilateration | Position estimation from three fixed anchor nodes |
| 🧮 Kalman Filtering | Smooths noisy RSSI-derived position estimates for stable tracking |
| 🚗 Rover Navigation | L298N motor driver integration for autonomous indoor movement |
| 🔬 Simulation-Validated | Electromagnetic simulation in MATLAB before physical fabrication |
| 💻 ESP32-S3 Support | Updated firmware with ESP32-S3 microcontroller optimization for improved performance |
Figure 2. Custom inset-fed patch antenna geometry
| Parameter | Value | Purpose |
|---|---|---|
| Resonant Frequency | 2.4 GHz | Target operating frequency (ISM band) |
| Substrate | FR4 (εr = 4.4) | Low-cost, locally available dielectric |
| Substrate Thickness (h) | 1.6 mm | Standard FR4 board thickness |
| Patch Width | 28.507 mm | MATLAB design output |
| Patch Length | 26.369 mm | MATLAB design output |
| Stripline width | 1.629 mm | MATLAB design output |
| Notch length | 3.801 mm | MATLAB design output |
| Notch width | 2.851 mm | MATLAB design output |
| Ground plane | 57.015 mm × 57.015 mm | MATLAB design output |
| Copper thickness | 0.03556 mm | MATLAB design output |
| Reference impedance | 50 Ω | S-parameter reference |
| Component | Quantity | Role |
|---|---|---|
| ESP32-WROOM-32U / ESP32-S3 | 5× | 3 fixed anchors, 1 mobile node, and 1 gateway |
| Custom Patch Antenna | 1× or more | Tested on the mobile node |
| ESP32 built-in trace antenna | 3× | Used by the fixed anchors |
| U.FL-to-SMA Pigtail (RG-178/RG-316) | 1× or more | Connects the patch to the mobile ESP32 |
| L298N Motor Driver | 1× | Drives rover motors based on trilaterated position |
| NanoVNA | 1× | Fabricated antenna impedance/S11 verification |
| FR4 Copper-Clad Board | — | Antenna fabrication substrate |
| Parameter | Specification |
|---|---|
| Evaluated Area | 18 m × 18 m |
| Positioning Dataset | 416 out-of-sample fixes |
| Median Position Error | 2.84 m |
| RMSE | 4.80 m |
| Simulated Return Loss (S11) | < −15 dB at 2.4 GHz |
| Communication Protocol | ESP-NOW on channel 1; gateway USB serial output |
| Filtering | Kalman filter on trilaterated position estimates |
Figure 3. Complete system flow from beacon transmission to position output
TLM Equations (W, L, y₀) → MATLAB Antenna Toolbox Simulation
→ S11 / Impedance Validation → Fabrication (FR4 etching)
→ NanoVNA Measurement → RSSI Field Comparison vs Built-in Antenna
- The mobile node uses the custom patch antenna during the antenna comparison, connected through a U.FL-to-SMA pigtail.
- The three fixed anchors use their built-in ESP32 trace antennas, matching the final report's tested configuration.
- The two antenna configurations are compared under the same anchor layout to quantify their effect on RSSI positioning.
| Requirement | Description |
|---|---|
| MATLAB + Antenna Toolbox | Required for patchMicrostripInsetfed simulation |
| Arduino IDE / PlatformIO | For ESP32 firmware (anchor + rover) |
| ESP32-WROOM-32U / ESP32-S3 | ×5 total: mobile node, gateway, and three anchors |
| NanoVNA | For post-fabrication antenna verification |
| Fabrication Tools | FR4 copper-clad board, ferric chloride etchant, SMA connectors |
git clone https://github.com/sarpharaj-09/OpenIPS.git
cd OpenIPS% From Antenna_Simulations/
run BestResultEver03_30.mThis derives base dimensions (W, L, Wf, y₀, NotchWidth) from the transmission line model and feeds them into the patchMicrostripInsetfed simulation.
cd code
pio run -e gateway -t upload
pio run -e anchor0 -t upload
pio run -e anchor1 -t upload
pio run -e anchor2 -t upload
pio run -e mobile -t upload- Solder SMA female connector at each patch antenna's feed point.
- Connect the custom patch antenna to the mobile ESP32-WROOM-32U through a U.FL-to-SMA pigtail (RG-178 or RG-316).
- Keep the three anchor ESP32 built-in trace antennas exposed; wire the mobile node to the L298N motor driver if rover control is used.
Figure 4. LiteVNA used for post-fabrication antenna verification
The completed workflow combines the antenna measurement pipeline with the ESP-NOW positioning system:
% Run the antenna model from Antenna_Simulations/
run BestResultEver03_30.m- Power On — The mobile node broadcasts via ESP-NOW; the anchors begin RSSI sampling.
- Trilateration — Rover computes position estimate from three anchor RSSI readings.
- Kalman Filtering — Smooths position estimate over time.
- Serial Output — The gateway sends synchronized readings to the computer for visualization.
The antenna was simulated in MATLAB Antenna Toolbox, fabricated on FR4, measured with a LiteVNA, and evaluated in the positioning system. The report records the following results.
The built-in ESP32 antenna is the baseline used by the fixed anchors in the reported configuration.
Figure 5. ESP32 built-in trace-antenna radiation pattern
- The built-in antenna pattern changes with board orientation, enclosure, cables, nearby metal, and the human body.
- Fixed anchor measurements require a stable and repeatable antenna reference.
- The custom 2.4 GHz patch provides a controlled and measurable alternative for the mobile node.
- Comparing both antennas under the same anchor layout shows their effect on RSSI and position error.
- The patch was designed for a direct 50 ohm match in simulation and later tested with lumped matching after fabrication.
Figure 6. Simulated 3D radiation pattern of the custom patch antenna
Figure 7. Simulated S11: −24.3 dB at 2.400 GHz
Figure 8. Simulated impedance response for the inset-feed design
Figure 9. Simulated azimuth (left) and elevation (right) radiation patterns
Figure 10. Simulated patch geometry (left) and surface current distribution (right)
The fabricated antenna resonated at 2.600 GHz instead of the simulated 2.400 GHz. At 2.4 GHz, the bare antenna measured S11 of −1.41 dB and impedance of 64.62 + j22.21 Ω.
Figures 11-13. Actual fabricated antenna results without lumped element: S11, Smith chart, and SWR.
A series-L/shunt-C network using a 1.409 nH series inductor and 3.592 pF shunt capacitor improved S11 to approximately −12 dB with SWR of 1.61 to 1.64. The repository file is named ant_match_s11.jpeg.
Figures 14-16. Actual fabricated antenna results after lumped-component matching: S11, Smith chart, and matching calculation.
| Configuration | Resonance | S11 | Result |
|---|---|---|---|
| Simulation | 2.400 GHz | −24.3 dB | Theoretical match |
| Fabricated without matching | 2.600 GHz | −1.41 dB at 2.4 GHz | Poor match |
| Fabricated with lumped matching | 2.535–2.595 GHz | −12.28 to −11.97 dB | Usable improvement |
Calibration used 20 measured grid positions with the log-distance model:
| Anchor | RSSI0 (dBm) | n | R2 | Residual sigma |
|---|---|---|---|---|
| A0 | -45.2 | 2.08 ± 0.66 | 0.355 | 4.52 dB |
| A1 | -46.7 | 2.16 ± 0.44 | 0.570 | 3.53 dB |
| A2 | -42.0 | 2.26 ± 0.65 | 0.405 | 3.95 dB |
The final evaluation used 416 out-of-sample fixes across an 18 m × 18 m area.
| Metric | OpenIPS | Room-centroid baseline |
|---|---|---|
| Mean position error | 3.81 m | 7.94 m |
| Median position error | 2.84 m | — |
| RMSE | 4.80 m | — |
| 90th-percentile error | 8.46 m | — |
Calibration fit plot · Position-error CDF
The OpenIps/ TypeScript/Express application reads gateway serial CSV data, converts RSSI to distance, applies median filtering, performs trilateration and Kalman filtering, emits live Socket.IO updates, and stores movement history in Redis.
| Feature | Implementation |
|---|---|
| Serial input | serialport at 115200 baud |
| Position processing | Log-distance model, median filter, weighted trilateration, Kalman filter |
| Storage | Redis locations and event history |
| Views | /, /history, and /calibrate |
| API | /api/v1/locations and /api/v1/ping |
Figure 17. Live dashboard visualization
Figure 18. Dashboard software workflow. Figure 19. Dashboard calibration page.
Run the dashboard locally:
cd OpenIps
pnpm install
pnpm build
pnpm devRedis must be available before starting the server. See OpenIps/DOCUMENTATION.md, OpenIps/CALIBRATION.md, and OpenIps/KALMAN_FILTER.md.
| Phase | Status | Description |
|---|---|---|
| 1. Design | ✅ Complete | TLM-derived patch dimensions (W, L, y₀, Wf) |
| 2. Simulation | ✅ Complete | MATLAB Antenna Toolbox validation; S11 = −24.3 dB at 2.4 GHz |
| 3. Fabrication | ✅ Complete | FR4 toner transfer, ferric-chloride etching, and SMA installation |
| 4. Measurement | ✅ Complete | LiteVNA S11, impedance, SWR, and RSSI rotation testing |
| 5. System Integration | ✅ Complete | ESP-NOW anchor/mobile/gateway chain with trilateration and Kalman filtering |
| 6. Firmware Testing | ✅ Complete | ESP32-S3 firmware build and serial testing |
| 7. Validation | ✅ Complete | 416 out-of-sample fixes compared with a room-centroid baseline |
Key design principles applied throughout:
- Change one antenna parameter at a time during tuning to avoid impedance collapse.
- Minimize ground plane size and feed stub length, and use the coarsest acceptable mesh to keep simulation runtimes tractable.
- Validate simulation timing on a single point before scaling to a full parametric sweep.
- Comprehensive simulation validation before fabrication to ensure optimal antenna performance.
Project methodology and workflow
OpenIPS/
├── Antenna_Simulations/ # MATLAB antenna model and result data
├── code/ # PlatformIO ESP-NOW firmware
│ ├── include/common.h # Shared MAC addresses and packet structures
│ ├── src/main.cpp # Gateway, mobile, and anchor roles
│ └── test/ # Standalone radio test sketches
├── Media/ # Reports, figures, measurements, and demos
│ ├── Docs/ # Final and defence documents
│ ├── Simulation_Results/ # MATLAB plots and simulation data
│ ├── actual_antenna_result/ # VNA measurement images
│ ├── test_environment/ # Calibration and CDF results
│ └── visualization_software/ # Dashboard images and recordings
├── OpenIps/ # TypeScript dashboard and backend
├── Test_code/ # Earlier standalone ESP32 sketches
└── README.md
| Reference | Topic |
|---|---|
| C. A. Balanis, Antenna Theory (4th ed.) | Primary antenna design reference |
| Cidronali et al., MIKON 2019 | RSSI-based radiation pattern validation methodology |
| Almasi, 2024 | Impact of antenna orientation on RSSI accuracy |
| Sadowski & Spachos, 2018 (IEEE Access) | RSSI localization baseline |
This project is developed as a Minor Project for the Bachelor's degree in Electronics Engineering, Tribhuvan University, Institute of Engineering (Pokhara).
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2026 OpenIPS Project
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Sarpharaj Dewan
💼 Embedded Systems & Robotics Enthusiast
pnpm install
pnpm build
pnpm dev
```
If you found this project useful or interesting, please consider giving it a star!
"Finding your way, where satellites can't."
Made with ❤️ by OpenIPS team







