Design of parking lot management function board based on microcontroller

Publisher:独行于世Latest update time:2011-06-11 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction :

Figure 1: Schematic diagram of car entry control

PHILIPS's P89C58 is based on the 80C51 core and is designed and manufactured using PHILIPS high-density CMOS technology. It has 8k bytes of non-volatile Flash read-only program memory EPROM, 3 16-bit timers/counters and 6 interrupt sources, and a 4-level priority interrupt nesting structure. It can be used for serial I/O ports, I/O expansion or full-duplex UART for multi-machine communication. In addition, P89C51 adopts low-power static design, wide operating frequency (DC-33MHz), wide operating voltage range (2.7-5.5V), and two software methods to select power idle and power-down modes. This design uses P89C58 as the core processor to realize the intelligent electronic board for modern parking management. It has a set of intelligent and complete logic control processing flow. With a set of card readers, two ground sensors and an LCD display around it, it can conveniently and efficiently realize the system management of a large parking lot. It can be seen that its hardware design is simple in structure, small in size and low in price; in software design, we strive to achieve smooth communication, complete functions and humanized management.

2. Overview:

In the actual environment, we set up a ground sensor A in front of the barrier arm at the entrance of the parking lot. When a vehicle wants to enter the parking lot, it must pass through the ground sensor A set in front of the arm of the parking lot. The vehicle interferes with the ground sensor at the ground sensor A, and the ground sensor generates a signal. At this time, the intelligent function board based on the single-chip P89c58 as the core can quickly realize the acquisition of the signal generated by it. When the signal of ground sensor A is collected, it is known that there is currently a vehicle requesting to enter the parking lot, as shown in Figure 1. Then, it sends a command to the 320 X 240 LCD screen to drive the display of "Please read the card" to prompt the user, and at the same time opens the contactless induction card reader for the user to allow the user to read the card. When the user reads the card, the function board can also quickly collect the card number information sent by the contactless card reader, and forward the information to the upper PC for processing. The PC judges whether the card number is valid and returns the result to the function board. The function board can judge the information returned by the PC. When the card number is invalid, it sends a command to drive the LCD screen to display "This card is invalid or the payment has expired, and entry is not allowed" to prompt the user. Otherwise, when the function board receives valid card number information, it will issue a command to control the execution of the arm-raising action, allowing the current vehicle to move forward, and at the same time, the driven LCD screen will prompt "Entry is allowed, please enter". In order to complete the arm-closing action, the function board will collect the signal of the ground sensor B set behind the arm to determine whether the vehicle has successfully entered the parking lot. When the vehicle allowed to enter passes through the ground sensor B, the ground sensor B has the same working principle as the ground sensor A, generating a signal and transmitting it to the function board. When the function collects the signal sent by the ground sensor B, it confirms that the vehicle has successfully entered, and the function board issues a command to close the card reader and start the arm-closing action. This completes the management of vehicle entry.

In the management of vehicle exit in the parking lot, the function board uses the same working method and principle. The function board collects the card number information from the card reader and sends it to the upper PC. The PC returns the result of whether the card number is valid. If the card number is invalid, the function board drives the LCD display to display "This card is invalid or the payment has expired, and exit is not allowed" to prompt the user; when the card number is valid, the function board controls the arm action and drives the LCD display to display "Exit is allowed, have a safe trip".

3. Signal scheme:

Figure 2: Communication interface unit

The P89C58 chip and communication method adopt asynchronous serial communication, and the signal scheme is mainly the communication protocol between the single-chip microcomputer and the host computer. The interface can complete the task of communicating with the host computer by using only two optical couplers as shown in Figure 2, which saves costs and achieves isolation. If a RS232 to RS485 converter is added to the serial port of the PC; an RS485 is connected to each serial port of the single-chip microcomputer, it is easy to form a control system with a control distance of up to 1.2 km.

1. MCU->host computer data (user information)

byte

ASCII

Hexadecimal number

explain

First

02H

Data Header

second

P~_

` ~o

50H~5FH

60H~6FH

Address code: MCU address code, determined by MCU hardware

50H~5FH: Entry address code (16 addresses in total)

60H~6FH: export address code (16 addresses in total)

third

H

48H

Instruction type: MCU->host computer data (user information)

fourth

0~9

3XH(X=1~10)

Card number bytes 1~10

fifth

00H~99H

Year, represented by BCD code, such as: 03H represents 2003

sixth

01h~12h

Month, represented by BCD code, such as: 03H represents March

seventh

01h~31h

Day, represented by BCD code, such as: 15H represents the 15th

eighth

00H~23H

The BCD code indicates the time, such as: 16H means 16:00 p.m.

ninth

00H~59H

Minutes, expressed in BCD code, such as: 04H means 4 minutes

tenth

00H~59H

Seconds, expressed in BCD code, such as: 50H means 50 seconds

eleventh

00H~FFH

Check code low byte; all previous codes (including STX>)

Check code high byte; add and take the last two bytes

twelfth

00H~FFH

thirteenth

03H

Data tail

2. Data communication between MCU and host computer (status information)

byte

ASCII

Hexadecimal number

explain

First

02H

Data Header

second

P~_

` ~o

50H~5FH

60H~6FH

Address code: MCU address code, determined by MCU hardware

50H~5FH: Entry address code (16 addresses in total)

60H~6FH: export address code (16 addresses in total)

third

I

49H

Instruction type: MCU->host computer data (status information)

fourth

H~W

I

P

Q

R

S

T

U

48H~57H

Fault code: 48H means no fault or the received data is correct

49H indicates that the data received is incorrect and a resend is requested

50H means the boom cannot be raised

51H means the landing rod cannot land

52H means the first ground sensor may be damaged

53H means the second ground sensor may be damaged

54H indicates that the card reader may be damaged

55H means the card machine may be damaged

fifth

00H~FFH

Check code low byte; all previous codes (including STX>)

Check code high byte; add and take the last two bytes

sixth

00H~FFH

seventh

03H

Data tail

According to the above signal scheme, the car arrives at ground sensor A, which is the entrance, and the address is 52H (R). The microcontroller waits to receive the card number. The card number read is 30H, 31H, 32H, 33H, 34H, 35H, 36H, 37H, 38H, 39H (0123456789). After receiving the card number, the current time is recorded: March 25, 2003, 13:12:30 p.m. The microcontroller sends data information (H): , R, H, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, , , %, , , 0, , ), . Hexadecimal representation: (22 bytes in total):

02H,52H,48H,30H,31H,32H,33H,34H,35H,36H,37H,38H,39H,03H,03H,25H,13H,

12H, 30H, 03H, 29H, 03H After the host computer receives the data, it sends back as follows:

Allowed to send: 02H,52H,50H,03H,03H,25H,13H,12H,30H,01H,24H,03H

Not allowed to send: 02H,52H,51H,03H,03H,25H,13H,12H,30H,01H,25H,03H

Request the microcontroller to send data again: 02H, 52H, 52H, 03H, 03H, 25H, 13H, 12H, 30H, 01H, 26H, 03H

The host computer sets the MCU time: Assuming the current time is 2003/5/13, 9:42:20 in the morning, the host computer sends data: 02H, 52H, 54H, 03H, 05H, 13H, 09H, 42H, 20H, 01H, 2EH, 03H. The MCU receives the data correctly and returns the status: 02H, 52H, 49H, 48H, 00H, E5H, 03H; the MCU receives the data incorrectly and requests retransmission: 02H, 52H, 49H, 49H, 00H, E6H, 03H.

The host computer queries the status of the microcontroller: Assume that the current time is 9:42:20 am on May 13, 2003. The host computer sends data: 02H, 52H, 53H, 03H, 05H, 13H, 09H, 42H, 20H, 01H, 2DH, 03H. The microcontroller returns the status: 02H, 52H, 49H, 48H, 00H, E5H, 03H (48H means no fault, and the others are similar). The host computer queries the card number and time recorded by the microcontroller for the last time: Assume that the current time is: 2003/5/13, 9:42:20 in the morning, the time when the microcontroller last recorded and processed the card number is: 2003/5/12, 16:30:59 in the afternoon, the host computer sends data: 02H, 52H, 52H, 03H, 05H, 13H, 09H, 42H, 20H, 01H, 2CH, 03H; the microcontroller returns: 02H, 52H, 48H, 30H, 31H, 32H, 33H, 34H, 35H, 36H, 37H, 38H, 39H, 03H, 05H, 13H, 09H,

42H,20H,03H,2FH,03H.

IV. Conclusion

The hardware of the parking management system currently used is complex, large in size, and expensive. It is difficult to check and maintain when a fault occurs. The parking management function board based on the P89c58 core has a simple structure. The innovation of the author of this article is to fully develop the functions of P89c58 in the process of hardware and software design, achieving the highest cost performance; the software design is more thoughtful, making the communication smooth, the functions complete, the management humanized, and the performance stable and the monitoring data accurate. The actual test results are very good.

Reference address:Design of parking lot management function board based on microcontroller

Previous article:Modeling and design of pressure regulation system for tethered balloon
Next article:Design and implementation of authority control for regional space resource integrated management system

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号