The development of the Internet of Things (IoT) has accelerated the adoption of RFID- and ESP32-based door security systems as more secure and flexible alternatives to conventional locks. However, previous studies have primarily focused on system implementation and functional testing without systematically optimizing RFID operational parameters, resulting in suboptimal reading performance and response time. This study aims to optimize the performance of an RFID-based door security system using the Particle Swarm Optimization (PSO) algorithm on the ESP32 platform. The proposed method includes prototype development, experimental evaluation under varying RFID reading distances and angles, and PSO-based optimization using a fitness function that integrates reading success rate, effective reading distance, and response time. The novelty of this study is integrating PSO to simultaneously optimize ESP32-based RFID parameters for improved authentication performance. Experimental results show that PSO increased the fitness value from 0.636 to 0.923, improved the RFID reading success rate from 60% to 95%, extended the effective reading distance from 4.2 cm to 4.8 cm, and reduced the response time from 0.59 s to 0.43 s. These findings demonstrate that PSO effectively improves the reliability, speed, and service quality of RFID-based access control systems in IoT environments