This project is a Smart Elevator Control System developed for the 8051 Microcontroller (C8051F020). It features a complete logic implementation for a 5-floor building, incorporating Safety Mechanisms (Overload protection), Smart Scheduling (SCAN Algorithm), and Real-time Sensor Monitoring.
The system simulates a realistic elevator environment where inputs are polled via Timer Interrupts to ensure responsiveness, and passenger flow is tracked using IR sensors.
- Bi-Directional Scheduling (SCAN Algorithm): The system optimizes movement by servicing all requests in the current direction (UP) before switching to the opposite direction (DOWN), similar to modern elevator logic.
- Safety & Overload Protection:
- Monitors passenger count using Infrared (IR) Sensors.
- Triggers an Overload Alarm and prevents door closing if capacity > 4 persons.
- Interrupt-Driven Logic:
- Utilizes
Timer0Interrupts to periodically poll buttons and sensors, ensuring that user requests are never missed during motor operation.
- Utilizes
- Hardware Interfacing:
- Direct control of H-Bridge for Motor Direction (Up/Down).
- 7-Segment Display multiplexing for Floor Indication.
The code interacts directly with the MCU registers for low-level control:
| Component | Logic Function |
|---|---|
| IR Sensors | Passenger counting (Entry/Exit sequence detection) |
| Timer 0 | Periodic Interrupt Generation (~240ms tick) |
| Port 1 | 7-Segment Display Output |
| Port 2 | Motor Control & Safety LEDs |
| Port 5 | External Floor Call Buttons |
- Initialization: Configures Crossbar, Watchdog Timer, and System Clock (2MHz).
- Polling (ISR):
Timer0triggers every 240ms to check:- Floor Buttons (Internal Panel).
- Call Buttons (External per floor).
- Door Open Requests.
- Main Loop (Scheduler):
- Sweep UP: Moves motor UP if there are requests above current floor. Checks for intermediate stops dynamically.
- Sweep DOWN: Moves motor DOWN if there are requests below current floor.
- Door Sequence: * Checks IR sensors continuously while door is open.
- Updates passenger count.
- Checks for Overload before closing.
βββ include/ β βββ C8051F020.h # Register/bit definitions for the C8051F020 MCU βββ src/ β βββ elevatorsystem.c # Main application logic, ISRs, and scheduler βββ docs/ β βββ Elevator.pdf # Project documentation and schematics βββ README.md # This file
- Embedded C Programming.
- Interrupt Service Routines (ISR) handling.
- Sensor Fusion (IR + Switches).
- State Machine Implementation.
- Algorithmic Logic Design.