code for the parking lot management system based on the state machine and Seven segment diplay was provided for debuging purpose. These modules were tested separately working in proper sequence relative to the timing diagram. From the test result, the system has to increment whenever a car is coming in to the parking lot. When a car leaves, the system has to decrement by 1 from the total count(# of car in parking lot). In stead of assuming parking lot is infinite, we restricted the limit of parking spot (7 for max and 0 for min) and elminiate the internal error of system (# of parking spot < 0).
Whenever a car is approaching to the gate for the entrance, a signal from the sensor for the entrance (S_en) is fired off to the system then the system checks if a parking lot is not full. If the parking lot is not full the system enable the solenoid to open the gate. The system makes an increment in the count of the car and displays the result. Whenever a car is approaching to the gate for the exit, a signal from the sensor for the exit (S_ex) is fired off to the system then the system opens the gate.
The system makes a decrement in the count of the car and displays the result. Idle state: The state is reset first; the state remains in this state if both inputs from Hall effect sensor S-en = 0 and S-ex = 0. Otherwise it goes the next state Solenoid entrance state: From signal entrance state once it is checked that the parking lot is not full, (S_en = 1) it enables the solenoid for the entrance and makes the proper count increment.
The result is displayed by the display condition state. Solenoid exit state: From signal exit state once it is checked that the parking lot is not empty, (S_ex =1) it enables the solenoid for the exit and makes the proper count decrement. The result is displayed by the display condition state. Signal state: Once the car is exited or entered, the system has to close the gate, which disables solenoid exit state and solenoid entrance state respectively.
We had a problem to enable the solenoid from the the Hall effect sensor signal output. because the output signal was not enough to show, when the solenoid is enabled to open the gate. A signal from a sensor, to be specific from Hall Effect Sensor, fired off to the system, the system has to be able to identify and respond if the signal is for entrance or exit. If the signal is for entrance(from entrance sensor), the system has to make sure if the parking lot is not full (If Parking spot is left) before it opens the gate.
If the parking is not full, any spot is left, it has to open the gate, make the proper count increment and display the result. If the signal is for exit (from exit sensor), the system has to open the gate, make the proper count decrement and display the result.