# Project Idea | Smart Elevator

Introduction:

Nowadays, in large buildings, the conventional elevators have higher waiting time, higher traveling time, more power consumption. So there is a need to develop an algorithm which reduces the above problems. I have done this project as in intern at Smartron. I have developed an algorithm which reduces the waiting and travelling time in elevators.

I have used the concept of Internet of things in this project along with the usage of Arduino microcontroller.

Conceptual framework:

The keypad of the elevator is outside the lift in the lobby of the building. All the elevators on a particular floor of the building have a common keypad at the entrance of lobby. When a person presses his desired floor on the keypad, the system assigns a lift to him( which is on that floor or nearer to the floor).

How is the lift assigned to the user?

When a user presses his desired floor on the keypad, the system goes through the following steps:

1) It checks if any lift is on that floor, if yes, it assigns the lift.
2) If no, it checks whether the user wants to go to an upper floor or lower floor from his current floor.
3) It then assigns the lift which is going up and nearer to that floor.

The main constraint in this algorithm is that a lift can have a maximum on 4 stops. So when it checks a lift, it checks whether the lift has reached it’s maximum stops or no.

What’s the system and how it works?

Each lift is connected to an Arduino in the master-slave configuration. Each lift is a slave to a master Arduino which is responsible to assign the lift to the user.

Each lift maintains a queue(data structure). The number of elements in the queue is the maximum number of stops a lift can have.

The first element in the queue is its current floor. The subsequent elements are its destinations in order.

The master checks each queue and gets where all the lifts are from the first element of their queues.

The lift goes upwards when the difference between the current element and next element is positive and vice-versa.

I have used Arduino IDE for programming and hands-on Arduino kit to test.

This project is a POC to the smart elevator and it can be used for the further study on smart elevators( using artificial intelligence makes it really smart).

Pseudo Code:
Master:

```// declare arrays for the slaves(queues are implemented using arrays)
void setup(){
SPI.begin;   // Begin SPI protocol
digitalWrite(SS,HIGH);
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV8);
}
void loop(){
// create as many functions as there are keypads in the building.
// inside each function
// check all the filters and assign a lift
SPI.transfer(destination);  // goes to selected slave
enqueue(destination); // added to selected slave queue
}
// check all the filters and assign a lift
SPI.transfer(destination);  // goes to selected slave
enqueue(destination); // added to selected slave queue
}
}

Slave code:

// declare array for the slave (queue is implemented using array)
void setup(){
pinMode(MISO,OUTPUT);
SPCR |= _BV(SPE);  // turn on slave mode
SPCR |= _BV(SPIE);  // turn on interrupt
}
ISR(SPI_STC_vect){
}
void loop(){
// always looks at the first element of the queue and goes to that floor.
// when the destination is reached, it is deleted from queue
// inform master about deletion so that it can update the queue for this slave
} ?
```

Sincerely,
Sri Harsha

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Previous
Next