Elevator Control System.

Rafaa Fatima
4 min readJul 11, 2020

--

An elevator is a vertical transport vehicle that efficiently moves people or goods between floors of a building. They are generally powered by electric motors and work just like a pulley with a sophisticated mechanism.

They are used in apartments, malls, also in areas of agriculture, manufacturing etc .

Elevator Controls

The working of an elevator using Arduino Uno is discussed as follows:

Simulation Software Used:

  • Tinkercad

Components Used:

  • Arduino Uno R3
  • Servomotors (2)
  • IR Sensor and IR Remote
  • DC Motor
  • Temperature Sensor (TMP36)
  • Push Buttons (3)

Additional Components (can be used):

  • Piezo Buzzer
  • Gas Sensor
  • LCD Module

Working:

Note: The working is shown in a simulation software called Tinkercad.

  • Servomotor: It is a device which can rotate any object with great precision. Here, it uses two of these. One for moving the elevator between the different floors, which is indicated by the rotation of servomotor at specified angles and the other one for controlling the door of the elevator.
  • IR Sensor : InfraRed Sensor detects an obstacle in its way. Here, it is placed at the edges of the elevator door to prevent any accidents. It keeps the door open if any obstacle is detected in the way and closes the door if no obstacle is detected.
  • IR Remote: It is used to control the IR Sensor.
  • Temperature Sensor (TMP36): It measures the temperature of the surroundings. Here, inside the elevator, if the temperature rises above a specified limit then it is programmed to turn on the fan.
  • DC motor: It transforms electric energy into mechanical energy in the form of rotation. Here, it is used as a fan.
  • Push Button: It is like a simple switch. Here, it is used to indicate the different buttons in an elevator, which when pressed accordingly, moves the elevator to that floor.
  • Piezo Buzzer: It is an audio signalling device. It can be used as an alarm in the case of emergency inside the elevator.
  • Gas Sensor: It is a device used to detect gases in an area. It can be used to detect smoke inside the elevator.
  • LCD: Liquid Crystal Display is an output device used to display characters on its screen. Here, it can be used to display the floor number as the elevator moves.

Circuit Diagram:

To view the working of my project, please click on the link provided below:

https://www.tinkercad.com/things/1fnWyA2NCVj

Understanding the Code:

Libraries used:

  • <Servo.h>
  • <IRremote.h>

Code Fragment and Description:

  • Pin Connections and Setup:
//Pin Connections and Setup
void setup()
{
lift.attach(9);
door.attach(6);
pinMode(13,INPUT_PULLUP); //Button for Ground Floor
pinMode(12,INPUT_PULLUP); //Button for First Floor
pinMode(11,INPUT_PULLUP); //Button for Second Floor
pinMode(8,OUTPUT);
pinMode(7,INPUT);
pinMode(A0,INPUT);
ir.enableIRIn();
Serial.begin(9600);
}

Note: The power pins of all components are connected to the arduino 5V and GND pins are connected to the GND of arduino. The additional pin connections are as follows:

  1. Push buttons (Input) :

Button name: GroundFloor

Terminals: 2b to pin 13 & 1a to GND

Button Name : FirstFloor

Terminals: 2b to pin 12 & 1a to GND

Button name: SecondFloor

Terminals: 2b to pin 11 & 1a to GND

2. Temperature Sensor (Input) : Vout pin to A0.

3. IR Sensor (Input) : Out pin to pin 7

4. DC Motor (Output) : Terminal 1 to GND, Terminal 2 to pin 8

5. Servomotor (Output) :

Motor name: lift , Connections: Signal pin to pin 9

Motor name: door, Connections: Signal pin to pin 6

  • Controlling The Elevator By The Floor Buttons.
if(digitalRead(12)==0) //if user presses the First Floor button 
{
lift.write(90); //Elevator moves to the First Floor
Serial.println("First Floor");
delay(1000);
door.write(90); //Elevator door opens
delay(1000);
door.write(0); //Elevator door closes
delay(1000);
}

This block checks if the user has pressed the button for first floor and accordingly moves the elevator to the floor by rotating the motor to an angle of 90°. After reaching the floor, the door opens and then closes. Here, the delay between opening and closing the door and moving the elevator is given as 1 second ( changeable ).

Output: As a particular floor is reached, the floor number (output), (eg: “First Floor”), is displayed on the serial monitor.

Similarly, it is programmed to move the elevator to the ground floor by rotating the motor to an angle of 0° and to the second floor by rotating it to 180°.

  • Controlling The Elevator Door By Detecting The Objects In Its Way.

Note: We use an IR remote to control the IR sensor because we have programmed the project using a simulation software. If we use the hardware components, then the code for IR sensor is a lot simpler and it will not require an IR remote for controlling as it automatically detects the object.

if(ir.decode(&result))
{
//Serial.println(result.value,HEX);
ir.resume();
if(result.value==0xFD08F7)
{
door.write(90);
Serial.println("Alert!");
} if(result.value==0xFD30CF)
door.write(0);
}

This block checks and proceeds if any button is pressed from the IR remote. It then checks if an object is detected (1), then it keeps the door open. If no object is detected (0), then it closes the door. So the value of button 1 is FD08F7 and that of button 0 is FD30CF.

  • Controlling The Elevator Fan By Detecting The Rise In Temperature.
int temp=analogRead(A0);
if(temp>=153)
digitalWrite(8,1);
else
digitalWrite(8,0);

Here, the temperature sensor monitors the temperature inside the elevator. If it rises above the analog reading of 153 (which is 25°C) ,then the fan is automatically turned ON, otherwise, it is OFF.

Hence, this is all about the working of the elevator and its different features.

To view the entire code for the project, please click on the link provided:

https://github.com/rafatima16/ElevatorCS/blob/master/ArduinoCode

--

--