OVERVIEW
Introduction
1.1.1 Overview of traffic situation in Vietnam
In urban areas, the increasing population leads to a higher demand for transportation, resulting in a surge of individual vehicles City planners must address traffic flow issues to reduce congestion during peak hours by enhancing infrastructure, such as constructing additional highways and expanding routes Furthermore, developing more parking facilities is essential to accommodate residents' needs For example, in major cities like Ho Chi Minh City, finding parking in the city center is a significant challenge due to the overwhelming number of vehicles compared to the limited parking spaces available.
Fig 1.1 Traffic congestion in metropolises on peak hours
(Source: https://www.vietnamonline.com/transport/traffic-jams.html)
The absence of effective measures to develop static traffic in cities has hindered the construction of new parking lots, exacerbating the parking shortage during peak times like Tet holidays Current strategies to address this issue have proven ineffective, as investors remain unconvinced of their potential Consequently, the condition of parking facilities in major cities is deteriorating, while numerous informal parking lots have emerged, prioritizing profit over security and quality management, leading to inflated ticket prices.
3 expensive, making many parts of people dissatisfied So, the demand for smart and safe parking now is currently extremely large
Fig 1.2 The vacant lands become temporary parking, significantly affecting urban beauty
(Source: https://vietnamnet.vn/en/hcmc-faces-tremendous-pressure-on-parking-spaces-2077838.html)
Spontaneous parking lots detract from urban aesthetics and fail to provide adequate safety and convenience Therefore, the urgent development of smart parking solutions is essential to address these issues in our current environment.
1.1.2 Demand for parking lot in Vietnam
Recognizing the significant parking challenges in Ho Chi Minh City, our team has developed an innovative smart parking system This solution is highly valued for enhancing user safety while also reducing time and labor costs.
Ho Chi Minh City experiences a significant issue with motorbike theft, with losses reported at 50-100% in various locations such as hospitals, supermarkets, and markets, accounting for 30% of incidents The rise in thefts is attributed to criminals using fake tickets or stolen license plates In response, we have developed a high-security parking system aimed at addressing this problem Our project will present compelling data to attract investors and potential partners, emphasizing the business's ability to draw customers in a growing market while ensuring competitive sales A comprehensive business plan will outline the current market size, development trends, and essential components such as production, marketing strategies, and total capital requirements.
4 need, will be based on the forecast about sales mentioned in this section Here are the parts that we want to mention in product market analysis
Fig 1.3 Cars parked on a street affect other traffic
(Source: https://e.vnexpress.net/news/news/vietnamese-cities-suffer-from-lack-of-parking-spaces-4552003.html)
To effectively address the endless needs of our customers, we must prioritize their most urgent demands Our team is dedicated to identifying and fulfilling these needs through a feasible project that aligns with current market demands Traffic congestion remains a pressing issue, frequently covered by various media outlets, including press, radio, and television, alongside specialized channels that provide real-time updates on traffic conditions The overwhelming volume of vehicles on the streets exceeds the capacity of existing roadways, leading to inadequate parking solutions that fail to meet customer expectations.
● Safety levels of the above car parking points are not safe and secure
● Serving attitudes of car senders to non-delicate customers, as well as professional levels
● Vehicle sending time makes customers uncomfortable because they must wait until a long time for their turn
● Customers take a long time to go to nearby parking lot because they cannot know these parking lots status
1.1.3 Vietnam Smart Parking Systems Market – Industry Trends & Forecast
The rapid urbanization and rising demand for personal vehicles have made the implementation of IoT in parking facilities essential From 2023 to 2029, authorities expect advancements in technology and the development of smart cities to significantly boost the Vietnam Smart Parking System Market.
The smart parking market in Vietnam is projected to reach approximately $56.82 million by 2022 and is expected to grow to $98.72 million by 2029 This growth is driven by an increase in vehicle numbers, rising demand for advanced parking technologies, and higher vehicle usage rates during peak hours Additionally, the Vietnamese government's commitment to developing smart cities and investing in driverless vehicle technology presents significant opportunities for market expansion As a result, smart parking solution providers are increasingly focusing on developing staffless and cashless parking systems.
Fig 1.4 Vietnam parking system market size predicted
(Source: https://www.blueweaveconsulting.com/report/vietnam-smart-parking-systems-market)
1.2 What is Smart Parking Lot?
Smart parking systems utilize advanced information technology to manage vehicle entry and exit, integrating electrical components like magnetic cards, surveillance cameras, safety sensors, security latches, and control LED panels for enhanced efficiency and security.
Smart parking systems in developed countries leverage IoT technology to provide real-time updates on parking space availability, both indoors and outdoors, along with information on traffic and road conditions.
Smart parking systems are being implemented in major cities across various sectors, including schools, hospitals, transportation companies, factories, and apartment buildings This innovative model enables efficient vehicle management and streamlined parking operations Compared to traditional parking methods, smart parking offers numerous significant advantages.
– Monitor, control and manage the number of vehicles entering and exiting closely and quickly
– Reduce the rate of theft, vandalism, ensure asset safety
– Conveniently extract information, promptly handle unexpected situations
– Limit traffic jams at the parking lot during peak hours
– Magnetic cards have their own codes, difficult to fake, ensuring security
– Optimize costs and save management and operation personnel
– Manage revenue effectively and ensure accuracy by extracting data and making reports quickly
1.3 Suitable solutions for current parking lot status in our country
1.3.1 Fully automatic Tower Parking System
The tower parking system features a vertical elevator that efficiently transports vehicles to various parking levels around the shaft, maximizing space utilization compared to traditional parking lots This innovative design allows for integration into existing buildings without causing vibrations or noise, making it an ideal solution for urban environments Additionally, a rotating mechanism at the base of the system rotates vehicles 180 degrees, ensuring they are positioned straight for easy exit.
(Source: https://www.wohrparking.in/tower-car-parking-system-manufacturer-india.html)
The rotary parking system efficiently maximizes horizontal space by accommodating multiple vehicles in an area typically designed for just two cars This innovative structure can hold up to six vehicles and can be customized to fit even more, making it ideal for confined spaces in various environments Vehicles enter the parking system on the ground floor, where carriages rotate clockwise to bring an empty compartment to the ground level To retrieve a vehicle, the system rotates all cars until the desired one is positioned for the driver to exit, allowing seamless loading and unloading of vehicles.
(Source: https://www.indiamart.com/proddetail/rotary-vertical-car-parking-system-13215166048.html)
Silo parking systems feature a cylindrical design with a central positioning mechanism for efficient vehicle parking and retrieval Vehicles are stored at the outer edge, while a lift and rotation mechanism in the core enables quick vehicle movement, allowing for simultaneous up/down and axial positioning These systems are typically installed underground, making them ideal for challenging soil conditions, though they can also be placed above ground While multiple parking modules can be integrated, the system generally accommodates one vehicle at a time for parking or retrieval.
(Source: https://www.pouted.com/fully-automated-car-parking-systems/)
1.4 Misidentification of Smart Parking Lot
Many individuals express concerns about the safety and trustworthiness of Smart Parking Lot Systems, primarily due to the reduction of human oversight They fear that the absence of staff may compromise the security of their vehicles, believing that technology cannot match human vigilance However, despite this reduction in personnel, Smart Parking Lot Systems are designed to effectively safeguard users' properties Advanced technology enables devices to communicate and relay information to a central platform, allowing remote management of parking facilities Additionally, the integration of physical access cards and license plate recognition serves as a significant deterrent against theft, enhancing overall security.
LITERATURE REVIEW
Image processing technique
Tesseract is a leading OCR (Optical Character Recognition) engine available today, distributed under the Apache 2.0 open-source license It effectively recognizes characters in image files and can output results in various formats, including plain text, HTML, PDF, and invisible-text-only PDFs Users can utilize Tesseract directly, while programmers can access its functionalities through an API.
Tesseract has evolved to version 3.0x and is compatible with three major operating systems: Windows, Mac, and Linux This powerful tool supports character recognition for over 100 languages, including Vietnamese, and allows users to train the program to enhance its recognition capabilities for specific languages.
The request recognition system requires initial training with specific character patterns Today, intelligent systems with high accuracy in recognizing various fonts are widely available These systems can also closely reconstruct the original document's formatting, including images, columns, tables, and other non-text elements Currently, word recognition software can directly identify Vietnamese characters from scanned documents without saving them as intermediate image files Document pages can now be scanned and stored as multi-page files, with results saved in Microsoft Word and Excel formats to effectively meet data digitization needs.
Fig 2.1 Tesseract OCR text localization and detection
(Source: https://pyimagesearch.com/2020/05/25/tesseract-ocr-text-localization-and-detection/)
The proposed method consists of two key steps: vehicle detection and license plate detection The WPOD system identifies license plates and applies an affine transformation for each detection, enabling the rectification of the license plate area into a rectangle that closely resembles a frontal view.
Given the prevalence of vehicles in classical detection and recognition datasets, we opted not to train a detector from scratch Instead, we selected a well-established model for vehicle detection based on specific criteria A high recall rate is essential, as any missed vehicle with a visible license plate (LP) directly contributes to overall LP miss detection Additionally, maintaining high precision is crucial to ensure short running times, since each incorrectly identified vehicle requires confirmation by WPOD-NET.
To optimize object detection with WPOD-NET, positive detections are resized, balancing input photo size and processing costs Larger images facilitate the detection of smaller objects, but also increase computational demands In frontal and rear views, the ratio of license plate size to vehicle bounding box is relatively high Conversely, this ratio decreases in oblique or lateral views due to the elongated nature of the vehicle bounding box Therefore, resizing oblique views to a larger dimension is essential to ensure the license plate remains recognizable.
This article introduces a straightforward and efficient method for determining the resize scale of vehicles, utilizing the aspect ratio of their bounding boxes When the aspect ratio is approximately one, a smaller dimension is sufficient; however, as the aspect ratio increases, a larger dimension is required.
License plates are rectangular objects used for vehicle identification We introduce the Warped Planar Object Detection Network, a new CNN designed to detect license plates despite various distortions This network effectively regresses coefficients for an affine transformation that "unwarps" distorted license plates into a rectangular shape, akin to a frontal view While a planar perspective projection could be an alternative to the affine transform, it may lead to numerical instabilities due to small denominator values in the perspective transformation.
The WPOD-NET combines insights from YOLO, SSD, and Spatial Transformer Networks (STN) to enhance object detection capabilities While YOLO and SSD excel at fast multiple object detection and recognition, they are limited to producing rectangular bounding boxes and do not accommodate spatial transformations In contrast, STN can detect non-rectangular regions but is restricted to applying a single spatial transformation across the entire input, lacking the ability to handle multiple transformations simultaneously.
The network processes the resized output from the vehicle detection module, resulting in an 8-channel feature map that represents object probabilities and affine transformation parameters To extract the warped license plate, we consider a fixed-size square around the center of a cell (m, n) When the object probability for this cell surpasses a set detection threshold, we utilize part of the regressed parameters to create an affine matrix This matrix transforms the square into the license plate region, allowing us to effectively unwrap the license plate into a properly aligned object.
2.1.3 Apply image processing in smart parking lot
Facial recognition system is a type of application that is able to identify a person's face image based on the characteristics that the database has previously stored
The user will approach the security camera, which will scan their face and utilize AI technology to isolate it from the background The system will analyze the facial features and store the data Subsequently, it will compare the analyzed face against existing data using an encoder If the match is nearly perfect, the device will be unlocked.
As you can see, to be able to work it will have to go through 4 different stages including: – Save data
– Compare data with stored information
Vacancy management through image processing involves installing a fixed camera to capture images of a parking lot, which are then transmitted to a processing system This technology identifies available parking spots and those that are occupied, providing real-time updates on a notice board As a result, drivers can quickly and efficiently locate available parking spaces.
Fig 2.2 Detect remaining space by using image processing
(Source:https://pdfs.semanticscholar.org/a0cb/66c8d87528f498be94e7699db0db72af0e60.pdf)
2.1.3.3 Comparison of image processing methods
In this project, we use image processing method for recognizing and analyzing license plates when cars enter and exit the parking lot
Facial recognition technology may enhance security, but it often comes with unnecessary costs and extended installation times Our system, which integrates UID codes from RFID magnetic cards, significantly boosts customer security while minimizing both expenses and operational time.
Implementing image processing for parking lot space management is a cost-effective solution, particularly for facilities with over 100 parking spaces While our current system does not require an additional space management system, such technology will be beneficial as we scale up operations in the future.
RFID Technique
RFID, or Radio Frequency Identification, is a remote data recognition technology that enables the reading of information stored on a chip without direct exposure This process utilizes radio waves and can operate at distances ranging from 50 cm to 10 meters, depending on the specific type of RFID label card used.
Service users will be provided with a magnetic card This type of card contains ICs with identity information about a product, animal or person to identify and track radio waves
In the parking lot, the magnetic cards will be connected to the car sending information and that means your information is managed better Basically, magnetic cards like an
ID car owners and vehicles Information on this card is unique Each RFID card will have a different frequency range
An RFID device consists of an antenna or coil, a transceiver with a decoder, and an RFID card When powered on, the RFID antenna utilizes radio signals to activate tags and retrieve vehicle information, with the antennas typically mounted on the transceiver or decoder.
It acts as a signal reader/scanner When a card passes through the electromagnetic area due to the antenna generated, the information on the card will be read and decoded
2.2.2 How does the Smart parking lot system use RFID technique?
A parking lot management system utilizing RFID technology comprises RFID device sets, computers with car parking management software, and cameras that capture images within the parking area This integrated system streamlines parking operations by efficiently monitoring vehicle entry and exit, enhancing security, and optimizing space utilization.
When entering a parking lot, drivers swipe their card at the RF card reader located at the gate, while a camera captures the vehicle's license plate number To exit, guests must scan their card again at the reader, and if the information from both scans matches, the vehicle is allowed to leave the parking area.
The standout feature of automatic parking systems is their ability to ensure the security of both guest information and vehicles, significantly minimizing potential losses during the parking process Consequently, these automated facilities operate without staff while providing a level of safety that surpasses that of traditional parking lots.
Fig 2.3 Basic working of RFID implemented in parking lot system
(Source: https://telemedia.id/rfid-solution/)
Overview PLC S7 1200
The Simatic S7-1200 is a compact and flexible PLC designed for basic automation needs This modular programmable controller supports comprehensive control and communication functions, making it ideal for small to medium-scale applications in various automation settings.
(Source: https://new.siemens.com/global/en/products/automation/systems/industrial/plc/s7-1200.html)
(Source: https://new.siemens.com/global/en/products/automation/systems/industrial/plc/s7-1200.html)
Expansion I/O - Allows maximum connection of I/O modules (including DI, DO AI AO)
- Includes 2 types of SB: directly mounted on the CPU supports 1 slot SM: mounted outside the CPU, the number is based on the CPU line
Functions - Support PTO pulse (Fmax = 100kHz) and
- 3 Inputs High Speed Counter Fmax 100kHz
- The PID controller enables automatic auto- tuning
PROFIBUS communication support - PROFIBUS communication support when using communication module CM 1243-5 (Master) and CM 1242-5 (Slave)
PROFINET communication support - Integrated PROFINET communication port
PROFINET follows I/O and RT standards Does not support the IRT standard
Security - Protect download/upload PLC program with
- Protect function blocks OB, DB, FC, FB in the program that are not allowed to be accessed and adjusted by Password
Web Server - Allows programming web server interface over Wi-Fi
- NatPort support Allows remote connection between PC and CPU
CPU memory area - Load Memory: save the machine program
- Work Memory: Working memory when CPU RUN Up to 150Kbytes
- Retentive Memory: Memory that stores data when power is lost Up to 10Kbytes
Memory Card - Allows mounting memory card to increase the capacity of the Load Memory area
The TIA Portal programming software utilizes Step7 Basic for programming the S7-1200, supporting three programming languages: FBD, LAD, and SCL This software is seamlessly integrated within Siemens TIA Portal 11.
Protocol communication (UART, I2C, USB, Modbus)
UART (Universal Asynchronous Receiver-Transmitter) is a widely used protocol for asynchronous serial data transmission, facilitating device-to-device communication It is commonly employed in applications involving modules like WiFi, Bluetooth, Xbee, and RFID card readers, often in conjunction with platforms such as Raspberry Pi, Arduino, or other microcontrollers This communication standard is prevalent and popular across various industrial applications.
In UART communication, two UARTs interact directly, where the transmitting UART transforms parallel data from a control device like a CPU into serial format This serial data is then sent to the receiving UART, which converts it back into parallel data for the receiving device.
Fig 2.5 Data transmission method of UART
(Source: https://www.analog.com/en/analog-dialogue/articles/uart-a-hardware-communication-protocol)
UART communication operates asynchronously, meaning it lacks a clock signal for synchronization between the transmitting and receiving UARTs To manage data transmission, UARTs utilize start and stop bits, which mark the beginning and end of data packets, enabling accurate bit reading For successful communication, both UART devices must be configured to use the same data packet structure.
In a UART communication setup, the transmit (Tx) pin of one chip is directly connected to the receive (Rx) pin of another chip, and vice versa, typically operating at voltage levels of 3.3V or 5V During transmission, the UART converts parallel data into a serial format through the Tx pin, which is then received by the second UART on its Rx pin This second UART subsequently converts the serial data back into parallel format for communication with its control device.
● There is a parity bit to enable error checking
● The structure of the data packet can be changed as long as both sides are set up for it
● The method is well-documented and widely used
● The size of the data frame is limited to a maximum of 9 bits
● Does not support multiple slave systems or multiple master systems
● The baud rate of each UART must be within 10% of the other
In 1982, Philips Semiconductors developed the I2C communication protocol, also known as the inter-integrated communication protocol, enabling efficient data transfer between a central CPU and multiple ICs on the same circuit board using just two wires This protocol is widely utilized for short-distance synchronous serial communication among microcontrollers, sensor arrays, displays, IoT devices, EEPROMs, and various other components The I2C multi-master bus operates with two active wires, Serial Data (SDA) and Serial Clock (SCL), transmitting data bit by bit over a single wire.
I2C operates synchronously, meaning that the bit output is aligned with the bit sampling through a shared clock signal controlled by the master device, which always dictates the timing of the clock.
(Source: https://www.circuitbasics.com/basics-of-the-i2c-communication-protocol)
Data transfer occurs via the Serial Data Line (SDA), synchronized with the clock signal from the Serial Clock Line (SCL) Devices on the I2C network connect to these lines, facilitating effective communication.
The I2C bus lines operate as open-drain drivers, allowing any device on the network to pull the SDA and SCL lines low, but not high To maintain a high default state, pull-up resistors are employed for each bus line This open-drain configuration minimizes the risk of short circuits.
In an I2C bus system, devices are categorized as masters or slaves, with only one master active at any time The master device is responsible for controlling the SCL clock line and SDA data lines while facilitating communication with the connected slave devices.
In data transfer processes involving a master and slave device, the master initiates communication by specifying a 7-bit address for the slave device on the SDA line, leading to an efficient data exchange.
● Supports multi-master and multi-slave modes
● Confirmation that each frame is transferred successfully with ACK/NACK bit
● Limited size of the data frame (8 bits)
● I2C is a half-duplex protocol which is complex when compared to other protocols
● Complex hardware and firmware when compared other protocols
The Universal Serial Bus (USB) protocol, introduced in 1996, aimed to create a standardized cable and connector for various devices This innovation addressed the growing number of technological devices by providing a universal solution, significantly reducing the confusion and inconvenience associated with managing multiple cables for each device.
The device enables the connection of up to 127 peripherals to a single computer via a USB port, utilizing the high-speed USB 2.0 standard with a maximum data transfer rate of 480 Mbps The USB cable features two power wires (+5V and GND) and a twisted pair for data transmission It allows the computer to deliver up to 500mA of power at 5V DC, ensuring efficient operation of connected devices.
Low-power devices like mice, keyboards, and low-power computer speakers can be powered directly through USB ports, eliminating the need for separate power supplies In contrast, devices requiring substantial power, such as printers and scanners, do not primarily rely on USB for power, as their power transmission now functions mainly as a signal generator.
USB devices feature a heat-sensitive property that allows users to connect or disconnect them at any time without rebooting the system Additionally, many USB devices can enter a suspended state when the computer activates power-saving mode, enhancing energy efficiency.
● The universal serial bus is easy to use and low cost
● It has variety of connector types and size available
● Daisy chain up to 127 USB components / peripherals at the same time to one PC
● Fits almost all devices that have a USB port
● It has limited capability and overall performance
● Universal Serial Bus does not provide the broadcasting feature, only individual messages can be communicated between host and peripheral
● The data transfer not as fast as some other systems
In 1979, Modicon, Incorporated developed the Modbus protocol for industrial automation systems and programmable controllers, establishing it as an industry-standard method for transferring discrete and analog I/O information, as well as data registers between industrial monitoring and control devices Today, Modbus is a widely accepted public domain protocol that requires a license but does not necessitate royalty payments to its owner.
Modbus is transmitted over serial lines between devices The simplest setup would be a single serial cable connecting the serial ports on two devices, Master and Slave
The data is encoded in binary, and only one communication byte is required for one data byte This is the ideal communication protocol for RS232 or RS485, a rate from
1200 to 115000 baud The most common rate is between 9600 and 19200 baud MODBUS RTU is the most widely used industrial communication protocol
Socket.io
Socket.io, a Node.js module created in 2010, enables real-time communication through open connections, delivering real-time data It facilitates two-way communication between the client and server, provided that the client has Socket.io integrated in the browser and the server has incorporated the Socket.io package.
Security: When Socket.io comes out, it automatically creates secure connections like:
● Personal firewall and anti-virus software
Socket.io offers automatic reconnection and disconnection detection, ensuring that the client continuously attempts to reconnect to the server indefinitely after a disconnection This feature can be customized according to user preferences Additionally, Socket.io provides events that enable the detection of disconnections between the client and server, enhancing real-time communication reliability.
Binary support: Socket.io supports us with binary encodings such as:
ArrayBuffer and Blob in the browser
ArrayBuffer and Buffer in Node.js
Socket.io enables the creation of distinct channels and rooms, facilitating unique relationships among components as independent modules or according to varying permissions This functionality allows for the establishment of diverse communication pathways within applications, enhancing modularity and control over interactions.
24 rooms, clients can be joined to different rooms This is a useful feature to send notifications to a group of users or to a certain user connected on several devices for example.
My SQL database
MySQL is an open-source relational database management system (RDBMS) that operates on a client-server model, allowing users to create and manage databases while effectively handling the relationships between them.
A database is an organized electronic collection of structured information, managed by a database management system (DBMS) Together, the data, the DBMS, and associated applications form a comprehensive database system, commonly referred to simply as a database.
Data in commonly used databases is organized in rows and columns within tables, facilitating efficient processing and querying This structure allows for easy access, management, modification, and organization of information Most databases utilize Structured Query Language (SQL) for writing and retrieving data.
MySQL Server is a robust computer system that runs MySQL software, enabling efficient data storage and client access Data is organized in interrelated tables, ensuring fast, secure, and reliable performance This free software is developed and supported by Oracle Corporation.
MySQL clients are essential tools for connecting to MySQL Server, enabling users to send commands and queries while effectively managing data within the server's databases.
A client communicates with a server over a specified network, where each client can send requests via a Graphical User Interface (GUI) The server responds with results, provided both the client and server can understand each other.
MySQL creates tables to store data, defining relationships between those tables
Client sends SQL requests with a special command on MySQL The application on the server will respond to the information and return the results on the client
PhpMyAdmin is a free, open-source tool developed in PHP that facilitates MySQL administrative tasks via a web browser It enables users to create, modify, or delete databases, tables, fields, and records, execute SQL statements, and manage user permissions efficiently.
DESIGN AND IMPLEMENTATION
Block Diagram
CPU: Process all signals from components
Converter: convert the current to adapt with each component
Power Supply: supply Voltage for all System
Monitor: monitor status of parking lot on Web server
Barrier: prevent car pass in/out
Camera: monitor parking lot and detect number license plate
IR sensor: detect car go in/out to open/close Barrier 3.1.2 Connection
Operational Description
The automatic parking system begins by recognizing the vehicle's license plate upon arrival, utilizing advanced image processing techniques to ensure precise data capture This information is stored in a database, allowing the entry barrier to open seamlessly Cameras throughout the parking facility enable drivers to monitor the occupancy rate and available spaces while accurately identifying each parking spot These cameras employ Cascade classifiers, which require training within the parking environment to enhance detection accuracy, even under varying lighting conditions and obstructions Upon departure, the system verifies the vehicle's entry data against the captured image at the exit gate, ensuring a smooth exit process.
28 automatically check and open the barrier The system is constantly updated on the website so that parking lot owners can manage all activities and conditions of the parking lot.
Mechanical design
We calculate the required pull force to raise the swing arm, then choose the appropriate motor
With the given parameters, we have:
Diameter of the turntable mounted on the bar body: D = 200mm
F: Force (N) d: distance between the center of rotation to Force (m)
Due to the chosen bar is attached to the motor shaft with mass of 5 kilogram, with the length is 2 meters
So, the total moment for the step motor to control barrier Open/Close is:
∑ M = 50.2 = 100 (N.m) Number of revolutions on the axle:
3,14.200 = 85,98 (𝑟𝑝𝑚) (3-2) Therefore, we deduce the angular speed of the rotating disk:
From the above data, we can calculate the theoretical Power:
Using gear transmission with gear ratio: u = 4
From there, we will calculate the number of preliminary revolutions on the motor shaft
So, the number of synchronous revolutions of the motor will be selected
From the above data, we can select the appropriate engine according to the following criteria:
According to the appendix table in the book “Thiet ke dan dong co khi tap 1” – Trinh Chat, we can choose the motor 4A80B8Y3.
Image processing
Object detection methods for license plate detection often return a region that includes both the license plate and parts of the vehicle body, which can lead to inaccuracies Typically, optimal results occur when the camera is positioned directly facing the license plate, such as in automatic parking systems However, in real-world scenarios, such as when a traffic officer uses a mobile camera, the angle may be tilted, complicating the extraction of license plate information in subsequent processing steps.
In the front view (left image), the detected number plate area lacks significant body details, while in the slightly forward and tilted view (right image), the number plate area is overwhelmed with unnecessary body details.
Fig 3.2 Detecting results of using YOLO on photos with front view and tilt direction when capturing license plates
(Source: https://viblo.asia/p/tim-hieu-kien-truc-mang-wpod-cho-bai-toan-phat-hien-bien-so-xe-LzD5d240ZjY)
The Wrapped Planer Object Detection Network (WPOD) is an advanced detection framework inspired by YOLO, SSD, and Spatial Transformer Networks (STN) Unlike YOLO and SSD, which only provide a rectangular bounding box around license plates, WPOD offers a more precise quadrilateral representation, effectively capturing the license plate's true shape and surrounding space.
Fig 3.3 Result when using WPOD for the case of a tilted license plate
(Source: https://viblo.asia/p/tim-hieu-kien-truc-mang-wpod-cho-bai-toan-phat-hien-bien-so-xe-LzD5d240ZjY)
Figure 3.3 illustrates the detection outcome using WPOD, highlighting that the vehicle's license plate area is free from extraneous details from the body, with WPOD effectively repositioning this area to the forefront.
Fig 3.4 Step of WPOD network
(Source: https://viblo.asia/p/tim-hieu-kien-truc-mang-wpod-cho-bai-toan-phat-hien-bien-so-xe-LzD5d240ZjY)
The WPOD network operates by processing an input image, resulting in an output feature map with 8 channels The first 2 channels indicate the probability of the presence or absence of number plates, while the remaining 6 channels provide parameters essential for calculating the transformation matrix, which adjusts the viewing angle of the license plate.
To extract the license plate area, a fixed-size square is defined around each tile on the output feature map If the probability of an object being present in that cell exceeds a specified threshold, the values of the remaining six channels in that cell are utilized to compute the transformation matrix from the square area to the license plate area, represented by a red border polygon This transformation matrix is then employed to bring the license plate to the forefront.
The WPOD-NET integrates concepts from YOLO, SSD, and Spatial Transformer Networks (STN) to enhance object detection capabilities While YOLO and SSD excel in rapid multi-object detection, they limit themselves to rectangular bounding boxes and overlook spatial transformations In contrast, STN effectively identifies non-rectangular regions but is restricted to a single spatial transformation for the entire input, lacking the ability to manage multiple transformations simultaneously.
The network receives input from the vehicle detection module, producing an 8-channel feature map that represents object probabilities and transformation parameters To extract the warped license plate (LP), we focus on a fixed-size square centered around a cell (m, n) If the object probability for this cell exceeds a specified detection threshold, we utilize some of the regressed parameters to create an affine matrix, which transforms the imaginary square accordingly.
LP region Thus, we can easily unwarp the LP into a horizontally and vertically aligned object
The network architecture consists of 21 convolutional layers, with 14 integrated into residual blocks, utilizing fixed 3 × 3 convolutional filters ReLU activations are applied throughout the network, excluding the detection block, which features two parallel convolutional layers These layers are designed for inferring probabilities through a softmax activation and regressing affine parameters using an identity function Additionally, the architecture includes 4 max pooling layers of size 2 × 2 and a stride of 2, effectively reducing the input dimensionality by a factor of 16.
Fig 3.5 Detailed WPOD-NET architecture
To train the WPOD-NET model, we developed a dataset comprising 196 images, which included 105 images from the Cars Dataset, 40 images from the SSIG Dataset (training subset), and 51 images from the AOLP dataset (LE subset) Each image in the dataset was manually annotated to ensure accuracy and relevance.
The images selected from the Cars Dataset primarily feature European license plates (LPs), alongside a notable representation of American LPs and various other types Additionally, images sourced from SSIG and AOLP showcase Brazilian and Taiwanese LPs, respectively Below the picture, a few annotated samples are provided for reference.
Fig 3.6 Examples of the annotated LPs in the training dataset
Due to the limited number of annotated images in the training dataset, data augmentation plays a vital role Key augmentation techniques employed include rectification, where the entire image is adjusted based on the LP annotation, assuming the LP is situated on a plane, and aspect-ratio adjustment, where the LP aspect ratio is randomly varied within a specified interval.
[2, 4] to accommodate sizes from different regions;
– Centering: the LP center becomes the image center
– Scaling: the LP is scaled so its width matches a value between 40px and 208px (set experimentally based on the readability of the LPs)
– Rotation: a 3D rotation with randomly chosen angles is performed, to account for a wide range of camera setups
– Translation: random translation to move the LP from the center of the image, limited to a square of 208 × 208 pixels around the center
– Cropping: considering the LP center before the translation, we crop a 208 × 208 region around it
– Colorspace: slight modifications in the HSV colorspace
– Annotation: the locations of the four LP corners are adjusted by applying the same spatial transformations used to augment the input image
From the chosen set of transformations mentioned above, a great variety of augmented test images with very distinct visual characteristics can be obtained from a single manually labeled sample
Fig 3.7 Different augmentations for the same sample The red quadrilateral represents the transformed LP annotation
Fig 3.8 Image processing license plate flow chart
Step 1: Use WPOD algorithm to get the license plate
With the original image, after applying WPOD algorithm we will have a license plate from the car
Fig 3.10 Number plate is gotten by using WPOD Step 2: Change the license plate to gray image
A color image consists of multiple numeric matrices of identical dimensions, making it more efficient to process image data as a single numeric matrix To facilitate this, a grayscale converter is used to transform the image information into a single two-dimensional digital matrix.
Fig 3.11 Number plate after convert into gray image Step 3: Threshold the image
We use the threshold function in the OpenCV library to change the grey image to black and white image This step is used to separate numbers and backgrounds
Fig 3.12 Number plate after using threshold function Step 4: Use tesseract OCR library to get the characters
We utilize the Tesseract OCR library to accurately identify letters and numbers within images, subsequently eliminating any extraneous special characters The final output of the program is the extracted number plate, represented by the red string in Figure 3.10 below.
Fig 3.13 Final number plate after image processing
Part list electrical devices
The ESP8266 IoT Wi-Fi transceiver module is a user-friendly development tool based on the ESP8266 chip, designed for seamless integration with Arduino's compiler for programming and software flashing This ease of use makes it an ideal choice for applications requiring data collection and control via Wi-Fi, particularly in the realm of Internet of Things (IoT) projects.
1 ADC channel 1 channel of 10-bit precision SAR ADC
2 UART interfaces UART0 can be used for communication Since UART1 features only data transmit signal (TX), it is usually used for printing log
4 PWM outputs 4 channels of PWM pins for dimming LEDs or controlling motors
2 SPI and 1 I2C interfaces There are 2 SPI and 1 I2C interfaces to hook up all sorts of sensors and peripherals
I2S interface 1 I2S interface if you want to add sound to your project
(Source: https://lastminuteengineers.com/esp8266-pinout-reference/)
The RFID RF522 module utilizes the MFRC522 chip to read ID codes from RFID cards and transmit them to a Raspberry Pi It typically comes with RFID tags in both credit card and keychain formats, featuring 1K or 4K memory organized into sectors and blocks In addition to reading, the RC522 module can also write data to RFID tags To read information from a tag, it must be placed near the reader, which generates an electromagnetic field that powers the tag's chip through its antenna, eliminating the need for direct line-of-sight.
Fig 3.15 Module RFID RC522 pinout
(Source: https://components101.com/wireless/rc522-rfid-module)
● VCC: RFID reader power pin RC522 It supports a supply voltage between 2.5V and 3.3V.
The RST pin is used to control the power state of the module, allowing it to be turned on or off When the pin is set to LOW, the module remains in an off state, consuming minimal power Conversely, switching the pin to HIGH triggers a restart of the RC522 module.
● IRQ: interrupt pin that alerts the microcontroller when an RFID tag approaches the RFID reader RC522.
● MISO / SCL / TX: This pin has three functions When the SPI interface is enabled, it functions as slave output and master input
● MOSI: entry in the SPI interface.
● SCK: clock signal of the SPI interface.
● SS / SDA / RX: The pin acts as a signal input when the SPI interface is enabled.
The LCD 1602 is a liquid crystal display that functions as a dot matrix module, designed to showcase letters, numbers, and various characters It features a 5x7 or 5x11 dot matrix configuration, where each position is capable of displaying a single character This display can effectively separate characters and lines, utilizing a dot pitch for spacing between them The LCD 1602 can present information in 2 rows, with each row accommodating 16 characters.
(Source: https://circuitdigest.com/article/16x2-lcd-display-module-pinout-datasheet)
● Vss (Ground): Ground pin connected to system ground
● Vdd (+5 Volt): Powers the LCD with +5V (4.7V – 5.3V)
● VE (Contrast V): Decides the contrast level of display Grounded to get maximum contrast
● Register Select: Connected to Microcontroller to shift between command/data register
● Read/Write: Used to read or write data Normally grounded to write data to LCD
● Enable: Connected to Microcontroller Pin and toggled between 1 and 0 for data acknowledgement
● LED Positive: Backlight LED pin positive terminal
● LED Negative: Backlight LED pin negative terminal
Data pins 0 to 7 create an 8-bit data line that can be connected to a microcontroller for transmitting 8-bit data Additionally, these LCDs can function in a 4-bit mode, where data pins 4, 5, 6, and 7 remain unused.
● Current consumption is 1mA without backlight
● Alphanumeric LCD display module, meaning can display alphabets and numbers
● Consists of two rows and each row can print 16 characters
● Each character is built by a 5×8 pixel box
● Can work on both 8-bit and 4-bit mode
● It can also display any custom generated characters
● Available in Green and Blue Backlight
LCDs are widely utilized in various devices such as CD/DVD players, digital watches, and computers, as well as in numerous electronic projects for message display In the display industry, LCDs have largely supplanted CRTs (Cathode Ray Tubes) due to their energy efficiency, lighter weight, and smaller size.
This project utilizes a 16x02 LCD to effectively display the available parking space in a lot, and it indicates "Full Slot" when no spaces are available.
I2C is a simple method of communication that combines the best features of SPI and UARTs Module I2C supports LCD types using HD44780 drivers like LCD 1602, LCD
In this project, we utilize the I2C interface to connect the LCD 1602 to a microcontroller, allowing for efficient communication while only using two pins instead of the typical twelve required for direct connections This approach ensures compatibility with most modern microcontrollers, streamlining the setup process.
Fig 3.17 I2C module ( Source: https://lastminuteengineers.com/i2c-lcd-arduino-tutorial/)
● GND: is a ground pin and should be connected to the ground of Arduino.
● VCC: supplies power to the module and the LCD Connect it to the 5V output of the Arduino or a separate power supply.
● SDA: is a Serial Data pin This line is used for both transmit and receive
Connect to the SDA pin on the Arduino.
● SCL: is a Serial Clock pin This is a timing signal supplied by the Bus Master device Connect to the SCL pin on the Arduino.
Connecting an I2C LCD is significantly simpler than connecting a standard LCD, requiring only four pins instead of twelve Begin by linking the VIN pin to the 5V output on the Raspberry Pi and connecting the GND pin to ground For I2C communication, only four pins are necessary: SCL, SDA, VCC, and GND, which facilitate the connection between the LCD and the microprocessor.
An infrared (IR) sensor is an electronic device designed to detect and measure infrared radiation in its environment The discovery of infrared radiation dates back to 1800 when astronomer William Herschel observed that the temperature beyond red light was the highest while measuring the temperatures of different colors of light separated by a prism Although infrared radiation is invisible to the human eye due to its longer wavelength compared to visible light, it remains part of the electromagnetic spectrum.
Anything that emits heat (everything that has a temperature above around five degrees Kelvin) gives off infrared radiation
(Source: https://circuitdigest.com/microcontroller-projects/interfacing-ir-sensor-module-with-arduino)
● VCC: is the power supply pin for the IR sensor which we connect to the 5V pin on the Arduino
● OUT: pin is a 5V TTL logic output LOW indicates no motion is detected; HIGH means motion is detected
● GND: Should be connected to the ground of the Arduino
The sensor module outputs a HIGH signal (5V or 3.3V) when no obstacles are detected within its detection range If an object is closer than or equal to the set threshold, the output switches to LOW (0V) Users can adjust the distance threshold using the potentiometer on the board This module effectively detects distances ranging from 2cm to 30cm, influenced by the object's surface material, color, and shape.
In this project, we implement IR Sensors to monitor vehicle movement in and out of yards Two IR Sensors will be strategically placed at the barriers to detect when cars approach, enabling the barriers to close automatically.
This professional-grade IP camera boasts a color sensor that enhances resolution up to 1920 x 1080 pixels, delivering sharp and clear images thanks to its high-quality zoom capabilities Additional features include a motion sensor and user-friendly ONVIF technology, ensuring seamless compatibility with multiple platforms such as iPhones, Windows, and MacOS.
The camera offers the convenience of accessing footage from anywhere, but its fragility is a significant drawback; even minor issues can require replacement Additionally, the motors can produce noise intermittently, potentially alerting a thief after an incident.
(Source: https://honduras.desertcart.com/products)
Surveillance cameras are widely used in various applications, including enterprises, small businesses, parking lots, hospitals, traffic intersections, backyards, driveways, courtyards, farms, warehouses, supermarkets, and schools In this project, we are deploying cameras at three key locations: one in the parking lot to monitor available spaces and communicate this information to a microprocessor, while the other two cameras will capture license plate data from vehicles and relay this information for processing.
Control design
PLC programming
3.6.1 Input and output signal board
Table 3.2 Input and output signal in PLC
Order Function Symbol Bit Symbol M Bit M
1 Button Start BI_START I0.0 BM_START M0.0
2 Button Stop BI_STOP I0.1 BM_STOP M0.1
3 Car Sensor In I_CB_IN I0.2 M_CB_IN M0.2
4 Car Sensor Out I_CB_OUT I0.3 M_CB_OUT M0.3
1 Count the number of cars in garage DEM_XE MW100
2 Car Simulation IN SIMU_VAO MW102
3 Car Simulation OUT SIMU_OUT MW104
3.6.2.1 Counting cars in and out
Fig 3.22 Counting number of car function
The selection sensor device is a magnetic sensor to recognize the vehicle in and out yard and announce the vacant position in the yard
Upon entering the parking lot, the vehicle recognition sensor at the entrance alerts the system, increasing the vehicle count by one.
After a car is removed from the parking lot, the sensor detects its absence at the exit, effectively reducing the total count of vehicles in the lot by one.
3.6.2.2 Notice of vacancies in the parking lot
When a vehicle enters the parking lot, the IR sensor detects its location and assigns it to an available space A red indicator light signals that the storage compartment is occupied by a car.
When the car leaves the parking lot, the IR sensor knows where the car has left the compartment container, the green indicator light shows that the tank is empty
The parking lot's design offers ample space, but the high volume of vehicles makes simulation challenging To address this, the team developed a parking simulator featuring 9 parking spaces, organized into 3 distinct areas, each containing 3 parking positions.
The functions of the simulated car park on TIA Portal and PLC SIM:
● Display of available positions and number of vehicles in the parking lot
● Automatic stop barrier and warning when the limit switch is not working move after 5s
Fig 3.23 The parking lot when all positions are empty
Fig 3.24 Simulate the car goes into the parking lot
Fig 3.25 The parking lot is full of all locations
Fig 3.26 Simulate the car goes out of the parking lot
EXPERIMENT RESULTS
Model test
With a frequency of taking 1 picture per 1,5 second, the system will always recognize the license plate whenever a vehicle enters the parking lot
The camera will send the result to the server to process license plate information
We will test different cases to check how the operating range of the system
In each test case, we will position the car to capture the license plate while varying the lighting conditions to evaluate the effectiveness of license plate recognition.
The vehicle will be placed in the position of taking pictures for 5 seconds, if within that
5 second, the system does not recognize the correct number plate once, then the test case is considered to fail
The terminal panel on the left side of the screen is run by a Python file, outputting the image processing results twice per second
Testcase 1: Front angle of license plate:
Testcase 2: 30 degree angle of license plate:
Testcase 3: 45 degree angle of license plate
Testcase 4: Sunlight illuminate on license plate
Testcase 5: Angle strongly illuminated on license plate
Testcase 6: License plate is missing a small angle
Result No detected 30E92115 No detected
Analysis
Based on the experimental results, we make the following conclusions:
The system recognizes and processes number plates continuously, giving quick results
So, if the vehicle is positioned correctly and in favorable lighting conditions, the system will do its job well
The system struggles to accurately process images when the light intensity is excessively strong or weak, when the number plate is obscured by dust, or when the digits are partially covered.
If a license plate is positioned incorrectly, specifically if it is tilted more than 45 degrees from the camera angle, the system will fail to accurately recognize the number plate, resulting in no exportable data.
With the above analysis, we conclude that the camera must capture the license plate in the opposite position to be able to recognize the license plate accurately and quickly
The system operates effectively under typical weather conditions, free from direct sunlight or shade It is ideal for application in apartment buildings and commercial centers, as these environments can optimize lighting based on the system's features and incorporate a fixed camera setup.