Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Based Elevator Control System with IR Sensors and Seven Segment Display

View and Edit Project In Cirkit DesignerImage of Arduino-Based Elevator Control System with IR Sensors and Seven Segment Display

Circuit Documentation

Summary

This circuit is designed to interface with various sensors, a seven-segment display, pushbuttons, a motor with a reducer, and a motor driver, all controlled by an Arduino UNO. The circuit includes IR sensors for detection, pushbuttons for user input, and a motor system for mechanical movement. The Arduino UNO is programmed to read sensor inputs, control the motor, and display information on the seven-segment display.

Component List

  1. IR Sensor

    • Pins: out, gnd, vcc
    • Description: Infrared sensor used for object detection.
  2. Seven Segment Display (Wokwi Compatible)

    • Pins: G, F, COM.2, B, A, E, D, COM.1, C, DP
    • Description: Display used to show numerical information.
  3. Pushbutton

    • Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
    • Description: Button used for user input.
  4. Motor with Reducer

    • Pins: 3 - 6 VCC, GND
    • Description: Motor with a gear reducer for mechanical movement.
  5. Motor Driver (L298N)

    • Pins: OUT 1, OUT 2, OUT 3, OUT 4, +12V INPUT, GND, +5V OUTPUT, ENA, IN 1, IN 2, IN 3, IN 4, ENB
    • Description: Driver used to control the motor.
  6. Arduino UNO

    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
    • Description: Microcontroller used to control the circuit.
  7. 9V Battery

    • Pins: -, +
    • Description: Power source for the circuit.

Wiring Details

IR Sensor

IR Sensor

IR Sensor

Seven Segment Display (Wokwi Compatible)

Pushbutton

Pushbutton

Pushbutton

Motor with Reducer

Motor Driver (L298N)

Arduino UNO

9V Battery

Documented Code

int pin_A=9;
int pin_b=1;
int pin_c=2;
int pin_d=3;
int pin_e=4;
int pin_f=5;
int pin_g=6;
////////////
int OUT_Motor_1=7;
int OUT_Motor_2=8;
////////////
int floor_0=A0;
int floor_1=A1;
int floor_2=A2;
int sensor_0=A3;
int sensor_1=A4;
int sensor_2=A5;
//////////////
int DIN =12;
int CS =11;
int CLK=10;
///////
int speed_ = 150 ;

void setup() {
  // put your setup code here, to run once:
  pinMode(sensor_0,INPUT_PULLUP);
  pinMode(sensor_1,INPUT_PULLUP);
  pinMode(sensor_2,INPUT_PULLUP);
  pinMode(floor_0,INPUT_PULLUP);
  pinMode(floor_1,INPUT_PULLUP);
  pinMode(floor_2,INPUT_PULLUP);
  pinMode(OUT_Motor_1,OUTPUT);
  pinMode(OUT_Motor_2,OUTPUT);

  analogWrite(OUT_Motor_2,HIGH);
  delay(500);
}

void loop() {
  // put your main code here, to run repeatedly:
  if ( digitalRead(floor_0) ==0 ){
    if ( digitalRead(sensor_0) ==1){
      analogWrite(OUT_Motor_1 ,speed_);
      while(digitalRead(sensor_0)){}
      digitalWrite(OUT_Motor_1 ,0);
    }
  }
  //////////////////
  if ( digitalRead(floor_2) ==0 ){
    if ( digitalRead(sensor_2) ==1){
      analogWrite(OUT_Motor_2 ,speed_);
      while(digitalRead(sensor_2)){}
      delay(400);
      digitalWrite(OUT_Motor_2 ,0);
    }
  }
  ////////////////////
  if ( digitalRead(floor_1)==0 ){ 
    if ( digitalRead(sensor_1) ==1){
      ////////////
      if ( digitalRead(sensor_2) ==0){
        analogWrite(OUT_Motor_1 ,speed_);
        while(digitalRead(sensor_1)){}
        digitalWrite(OUT_Motor_1 ,0);
      }
      //////////
      else if (digitalRead(sensor_0)==0 ){
        analogWrite(OUT_Motor_2 ,speed_);
        while(digitalRead(sensor_1)){}
        delay(400);
        digitalWrite(OUT_Motor_2 ,0);
      }
      else {
        digitalWrite(OUT_Motor_1 ,0);
        digitalWrite(OUT_Motor_2 ,0);
      } 
    }
  }

  if ( digitalRead(sensor_0) ==0){
    digitalWrite(pin_A ,1);
    digitalWrite(pin_b ,1);
    digitalWrite(pin_c ,1);
    digitalWrite(pin_d ,1);
    digitalWrite(pin_e ,1);
    digitalWrite(pin_f ,1);
    digitalWrite(pin_g ,0);
  }
  if ( digitalRead(sensor_1) ==0){
    digitalWrite(pin_A ,0);
    digitalWrite(pin_b ,1);
    digitalWrite(pin_c