DOI : 10.17577/IJERTV14IS080038
- Open Access

- Authors : Hajar Zrioual, Diego D.G.P. Ge
- Paper ID : IJERTV14IS080038
- Volume & Issue : Volume 14, Issue 08 (August 2025)
- Published (First Online): 12-08-2025
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Smart Car Parking System Based on STM32 and Template Matching License Plate Recognition
Hajar Zrioual
School of Electronic and Information Engineering, Nanjing University of Information Science & Technology, Morocco
Diego D.G.P. Ge
School of Computer Science,
Nanjing University of Information Science & Technology, Mozambique
Abstract:- With the rapid increase in urban vehicle density, efficient traffic and parking management has become a significant concern. Traditional manual systems are no longer sufficient to handle the growing volume, prompting the need for intelligent solutions. This study presents the design and implementation of a Smart Car Parking System incorporating license plate recognition (LPR) using the STM32 microcontroller and a template matching algorithm. The proposed system comprises image acquisition through an OV7670 camera, preprocessing using binarization, plate localization via transition point detection and color analysis, and character segmentation and recognition using nearest-neighbor interpolation and template matching. A 2.8-inch TFT-LCD driven by an ILI9341 chip is employed for real-time feedback and system interaction. Additionally, a simulation of parking lot management is integrated to facilitate automated timing and fee calculation based on vehicle entry and exit. System functionality is validated through real-time tests that demonstrate high-speed recognition and effective charging mechanisms. While the system achieves reliable results under controlled lighting, further improvements are suggested for dynamic environments. This implementation confirms the feasibility of deploying embedded microcontroller-based LPR for intelligent parking solutions in smart cities.
Keywords: Character Segmentation, Embedded Systems, Image Processing, License Plate Recognition, Microcontroller, Smart Parking System, STM32, Template Matching, Vehicle Monitoring.
- INTRODUCTION
With the increase in the number of vehicles in urban environments, traditional manual methods for managing parking and vehicle identification have become outdated. These methods are time-consuming, error-prone, and inefficient. Consequently, intelligent systems like License Plate Recognition (LPR) have become critical in automating the vehicle monitoring process.This study aims to develop a smart parking system that integrates license plate recognition using an STM32 microcontroller and a template matching algorithm. The system is designed for small-scale parking lots and includes real-time display, vehicle tracking, and billing simulation.
- LITTERATURE REVIEW
LPR technology was first explored in the 1980s and initially involved basic image processing. By the 1990s, template matching approaches became common. However, early implementations struggled with accuracy and required manual verification. In China, LPR development faced the added complexity of recognizing Chinese characters.Modern systems
have achieved high recognition rates under ideal conditions. However, environmental factors such as lighting and occlusion can significantly degrade performance. This project builds upon these methods using template matching, selected for its simplicity and suitability for microcontroller-based systems.
- METHODOLOGY
System Overview:
The proposed Smart Car Parking System is composed of several core hardware components that work together to achieve automated vehicle monitoring and management. At the heart of the system is the STM32F103RCT6 microcontroller, which serves as the central processing unit. It is responsible for controlling all peripheral devices, executing image processing
algorithms for license plate recognition, managing user interactions, and simulating parking lot operations. For image acquisition, the system utilizes an OV7670 camera equipped with a FIFO (First-In-First-Out) buffer. This camera captures real-time images of approaching vehicles, and the integrated FIFO memory allows the camera to operate independently of the microcontrollers data processing speed, ensuring stable and uninterrupted frame capture. The captured images are then displayed on a 2.8-inch TFT-LCD screen driven by an ILI9341 controller. This display module provides a 240×320 pixel resolution and is used to present visual feedback to the user, including live image previews, recognition results, system messages, and billing information. To facilitate user control, the system includes two physical buttons. The first button (K1) is the start button, which initiates the systems operation, triggering the camera to capture an image and begin the recognition sequence. The second button (K2) serves as a query button, enabling users to retrieve and display stored data such as current parking occupancy and calculated parking fees. These components form an integrated embedded system capable of real-time license plate recognition and parking lot simulation on a low-cost, microcontroller-based platform.
Fig. 1. Functional Block Diagram of the System
Hardware Componemtnts:
The STM32F103RCT6 belongs to the STM32 F1 series of microcontrollers and is one of the commonly -used models in practical development. This type of microcontroller has rich hardware resources, integrates a variety of peripherals, and is easy to use. It has 48KB of SRAM and 256KB of FLASH internally. It has up to 8 internal timers, which makes timing operations very convenient. The presence of ADC and DAC also makes AD conversion very convenient. In terms of communication interface types, it provides many interfaces such as SPI, IIC, USART, and USB. It has more than 50 general – purpose I/O interfaces, which is just the right amount to meet the actual needs of this project. The system design uses a STM32F103RCT6 core minimum system, and the physical object is shown in Figure 2.
Fig. 2. Physical Diagram of STM32F103RCT6 Core
Board
The display module circuit is mainly used to display various types of image information and realize human – machine interaction. Initially, it needs to cooperate with the camera for license plate image information collection. When recognizing the license plate, it should clearly highlight the recognition process and results. Finally, it also needs to display the simulated parking lot scene. Therefore, in the peripheral device circuit, the design of the display screen is of the utmost importance. In this project, we select a 2.8 – inch TFT
– LCD display screen driven by the ILI9341 chip, with a resolution of 240*320, which provides a clear display. At the same time, this screen supports 16 – Bit RGB 65K color display. Through adjustment, it just matches the data output format of the camera. The pins of the TFT – LCD display screen are shown in Figure 3.
Fig. 3. Physical Pin Diagram of the TFT Liquid Crystal
Display Screen
The camera module is used for the collection of license plate information in the early stage. Clear license plate information images are the basis for the operation of the system. By
adding an FIFO module to the camera, the output rate of pixel data is reduced, making it convenient for operation and use.
Fig. 4. Physical Diagram of OV7670
The button circuit consists of the two buttons required by the system’s functional requirements, namely the start button and the query button. The hardware circuit diagram of the button module is shown in Figure 5.
Fig. 5. Hardware Circuit Diagram of the Button Module
As shown in Figure 12, the button module is very simple. Two indepenent buttons are directly connected to pins 8 and 12 of GPIOA, and the pressing actions of the two buttons can be detected. K1 is the start button, and when pressed, the system is officially started. K2 is the query button, and when pressed, it enters the license plate information page, where the existing license plate information can be viewed.
Software Architecture :
- Image Acquisition: Obtaining image information is the foundation of the system’s operation. The most common method is to use a camera to capture images and transmit them to the microcontroller.
- Image Pre – processing: Generally, due to the complexity of the environmental background, the shooting angle and other issues during the image acquisition process, the collected image information often has certain defects. At this time, pre – processing operations on the image are required to reduce the impact of these defects on image recognition to a certain extent.
- License Plate Location: Analyze the license plate image to find the upper, lower, left and right boundaries of the license plate area, and then extract the license plate part.
- Character Segmentation: License plate information consists of a string of characters. Separating each character is a necessary step. Therefore, after the license plate is located, each information character in the license plate area needs to be segmented individually. Ensuring the quantity and integrity of the characters is the key point in the algorithm design.
- Character Recognition: Match each character with the template characters to obtain the license plate information, and start the timing and charging process.
- RESULT AND DISCUSSION
System Hardware Implementation:
The connection of the hardware circuit is the most basic part of the system design. Only by accurately connecting the lines can the system work properly. In this project, DuPont wires are used to connect each module. According to the schematic diagram design, each module is connected in turn. The physical diagram of the connected circuit is shown in Figure 6.
Fig. 6. Physical Diagram of the Initially Connected
Circuit
As can be seen from Figure 6, the initially connected physical object has a very low aesthetic degree. There are many DuPont wires and the lines are complicated. It is very inconvenient to use and the system cannot be tested normally. Therefore, the circuit needs to be packaged, and the relative positions of each module need to be coordinated. The physical object after packaging is shown in Figure 7.
Fig. 7. Physical Diagram after Regularization
As shown in Figure 7, the regularized circuit encapsulates the circuit inside a dark box, and only the human – machine interaction part is exposed, which improves the aesthetic degree. Secondly, the relative positions of the screen and the camera are adjusted to conform to normal usage habits, reducing the difficulty of use.
System Function Testing And Result Analysis:
After the circuit is connected, the program is burned in, and the USB plug is connected to a 5V power supply. After the power supply is connected, the system starts to work and displays the home page, as shown in Figure 8.
Fig. 8. System Home Page
From the system home page in Figure 8, information such as the system name, student number, and designer can be seen. Press the start button K1 to start working, as shown in Figure 9.
Fig. 9. Initial Screen
After entering the system, there is a 20 – second camera screen adjustment time. Figure 9 shows the blurry image information. Adjust the focal length of the camera to improve the image quality, as shown in Figure 10.
Fig.10. Clear License Plate Image
As can be seen from Figure 10, through continuous adjustment, the image quality gradually becomes clear. At this time, the upper and lower boundary algorithm starts to run to assist in license plate shooting. After 20 seconds, the screen no longer changes, the current picture information is locked, the left and right boundaries are determined, and the binarization processing before character segmentation begins, as shown in Figure 11.
Fig. 11. Binarization Process
As shown in the screen of Figure 11, after the license plate area is determined from the static picture, binarization of this area begins. It can be seen from the figure that the license plate part is gradually black – and – white. The blue bottom plate part turns black, and the character part turns white, making the display more prominent. After binarization, the character segmentation operation begins, as shown in Figure 12.
Figure .12. Normal Character Segmentation
Figure 12 shows a normal character segmentation result. The result of character statistics is 8 characters displayed in the lower left corner. However, there will be cases of incorrect character segmentation. Here, we deliberately created such a situation for an experiment, as shown in Figure 13.
Fig.13. Incorrect Character Segmentation
As can be seen from Figure 13, when the license plate picture is too deformed, it cannot be recognized normally. The system will prompt an error and require re – collecting the image information. After normal character segmentation, it can be found from Figure 12 that each character is tightly framed by the segmentation line. Next, the characters are recognized one by one, as shown in Figure 14 on the right.
Fig.14. Character Matching
As can be seen from Figure 14, the characters of the license plate are matched with the templates one by one and displayed. At the same time, three pictures appear in the lower left corner, which are the original character picture, the horizontally stretched picture, and the picture stretched both horizontally and vertically. This is the character normalization process in the algorithm, and it is displayed here for easy observation. The final matching result is “Su E·P76J7”, which is consistent with the information in the image, indicating that the license plate recognition design is correct and can run normally.
Since the license plate recognition algorithm is normal, the following is to test the design of the parking scenario with timing and charging, as shown in Figure 15.
Fig. 15. Vehicle Timing and Charging
As shown in Figure 15, after the license plate is recognized, the background timing and charging service is started. After a period of time, press the K2 key to query the vehicle information just now. It is found that the time has reached 4 minutes and the cost is 0.32 yuan.
Next, simulate the scenario of a car leaving the station to observe whether the self – service charging service is normal. Before this, we scanned other license plates again to facilitate subsequent demonstrations, as shown in Figure 16.
Fig.16. Current Vehicle Information
On the above basis, we scanned the license plate “Su E·P76J7” again, as shown in Figure 17. At this time, only one vehicle information is displayed, that is, the parking time of this vehicle is 13 minutes and the payable fee is 1.04 yuan. The design of the leaving – station scenario is successful.
Fig.17. Payment for Leaving the Station
The license plate recognition system implemented by the STM32 microcontroller in this paper, through actual testing, has met the design requirements in terms of functions, and the recognition rate is acceptable. However, compared with modern advanced recognition systems, there is a huge gap, and it cannot be compared in terms of practicality, portability, recognition rate, etc. Therefore, there is still a lot of room for improvement in the design of this system. In future work, the system can be further improved and enhanced in the following directions:
- In terms of hardware design, the data processing speed of the STM32 F1 series microcontroller used in the system is limited, resulting in a relatively long license plate recognition time. In terms of font data storage, due to the limited internal memory of the STM32 F1 microcontroller, it is impossible to encapsulate all font models. Currently, only a few Chinese characters such as “Su”, “Liao”, and “Yue” can be recognized. Therefore, in subsequent designs, a higher – performance main – control MCU can be considered.
- The pre – processing ability of images is slightly insufficient. In the test, it can be found that the processing ability of the algorithm in the early stage is limited. It is simply impossible to recognize license plate images with problems such as excessive license plate inclination, defective image quality, overly complex background environment, and non – blue license plate background. Therefore, the pre – processing algorithm needs to be improved.
- The algorithm selection for license plate recognition can also be optimized. The template matching method used in this system requires preparing standard templates in advance, and the quality of the template data directly affects the recognition rate. The test results show that through simple pixel data comparison, this method has a better effect in the recognition of numbers and letters, but the recognition rate of Chinese characters is low and the practicality is poor. Therefore, if a high – end MCU is selected in the future, the artificial neural network algorithm can be considered for design. This algorithm has low requirements for the quality of image information, a high recognition rate, and does not require preparing template data in advance.
- The aesthetic degree of the system interface is not high, and the functions are few, resulting in low practicality. This project’s system only focuses on the research of the license plate recognition algorithm and involves few specific practical directions. Considering the needs of actual production and life, some practical functions such as remote information monitoring and networked alarms for illegal vehicles should be added. These functions can be considered for addition in the future.
- CONCLUSION
The smart car parking system presented in this work addresses a critical need for automated vehicle management in increasingly congested urban environments. By leveraging STM32 microcontroller technology and template matching for license plate recognition, the system demonstrates that practical, low-cost solutions can effectively support smart infrastructure. Its modular design and real-time capabilities make it suitable for deployment in small-scale parking facilities, such as residential areas, campuses, and gated communities. Moreover, the approach is scalable; future enhancements could include deep learning-based recognition, cross-platform integration with mobile apps, and real-time data analytics via cloud connectivity. This work provides a foundation for advancing intelligent transportation systems using embedded platforms.
ACKNOWLEDGMENT
The author would like to express heartfelt gratitude to Professor Ni Haibin, whose expert guidance, insightful feedback, and continuous encouragement were invaluable throughout the development of this project. Appreciation is also extended to the School of Electronic Information Engineering at Nanjing University of Information Science and Technology for providing access to essential laboratory resources and tools necessary for successful implementation. Finally, the author is thankful to all classmates and peers who offered technical advice, support, and motivation during various stages of the research.
REFERENCES
- Liu J., Zheng W., and Feng Y., “Design of the intelligent parking lot management system based on the user side and management side,” Proc. SPIE, vol. 12708, 2023. DOI:10.1117/12.2683886.
- Zhao H. and Shi L., “Application of license plate image recognition technology in intelligent parking lot,” 2020.
DOI:10.1145/3444370.3444551.
- Valizadeh M., Moradi F., Sarvenoee A. K., et al., “Economic Management of an Intelligent Parking Lot Using a Time-Based Load Response Program,” IEEE Access, vol. 12, pp. 113, 2024.
DOI:10.1109/ACCESS.2024.3420706.
- Wang M., “A Brief Introduction to the Development of Intelligent Transportation in China,” China Science and Technology Expo, no. 24,
pp. 88, 2012.
- Tao P. and Zhu H., “Comparison and MATLAB Implementation of Template Matching Recognition Algorithm and Neural Network Recognition Algorithm,” Computer Knowledge and Technology, vol. 16, no. 34, pp. 187190, 2020.
- Ma L. and Zhang Y., “Research on Vehicle License Plate Recognition Technology Based on Deep Convolutional Neural Networks,” Microprocessors and Microsystems, vol. 82, no. 8, p. 103932, 2021.
- Guo J.-M. and Liu Y.-F., “License Plate Localization and Character Segmentation With Feedback Self-Learning and Hybrid Binarization Techniques,” IEEE Trans. Veh. Technol., vol. 57, no. 3, pp. 14171424, 2008.
- STM32F103RCT6 Microcontroller Datasheet, STMicroelectronics. [Online]. Available: https://www.st.com/en/microcontrollers- microprocessors/stm32f103rc.html
- OV7670 Camera Module Datasheet, OmniVision Technologies Inc. [Online]. Available: https://www.ovt.com/download-documen
