Arduino Lift Creating A Mini Version of A Lift Using Arduino
Arduino Lift Creating A Mini Version of A Lift Using Arduino
Arduino Lift
Posted on November 7, 2014December 12, 2014 by pcomp2014
Project Members:
Kamal Miah
Rezwan Miah
Leave a comment
Introduction
Posted on November 7, 2014December 10, 2014 by pcomp2014
In this physical computing project we have decided to create a mini version of a lift. This lift
should resemble a real life lift with all its features and concepts about the lift, for this project
we will be using arduino which is a microcontroller that will control the lift and all the
aspects. The aim of this project is to demonstrate on how a real life lift works. There will be 3
floors which are Ground, First and second, the arduino will be used to control the
functionality of the lift and the housing for the lift, and we will be creating ourselves. The
lift will be represented with an acrylic glass cube where it will start from the base which is
ground floor. There will be 3 buttons for each floor; each floor goes up in 30 centimetres. On
each floor there will be a display which will tell the user what floor the lift is on; this will be
Leave a comment
Leave a comment
I/O
Posted on November 7, 2014December 3, 2014 by pcomp2014
Inputs:
Outputs:
Leave a comment
Planning
Posted on November 8, 2014December 12, 2014 by pcomp2014
In order to be consistently productive and use time wisely on this project we decided to
divide the work into four sections: planning, testing ,software and hardware engineering.
This planning stage of the project was carried out by working together. Starting off with
throwing different ideas to the table and see which we both think is the best to implement.
As this project was based on physical computing we decided to go for something which
demonstrates what we have learnt during this course and the usage of different
components.
With the concept of the project decided allowed us to move on to the next stop of what to do
next. Being mindful of finding errors and solving them we decided to do testing of each
components needed in this project. As we both had the same timetables we were able to
allocate a day to work on the project for that entire day and at the end of that day we would
each set out tasks for each of us to do. The testing part we each divided the tasks and tested
different components and making sure it runs with a code,then we would show it to each
other and merge together. The software programming was divided between both of us
during the testing then when merging the software together was done by one of us and the
physical construction of the housing was done by the other. Creating the circuits was
constructed together as we had an entire day to work on this project each week we were
able to get a high amount of work done whilst together.
Leave a comment
Week 6:Testing
Posted on November 8, 2014December 12, 2014 by pcomp2014
This week we will test all the components we will be using in our project. We believe testing
each component will make it easier for us when we come to actually building the project as
we would know how each components works and how it should be used, also we can test
all the components we need and if we do decide not to use any of the components we
would know at least we had tested it.We have divided this task so that all testings can be
done and then come together and show it and demonstrate the functionality. All testings are
done between myself Kamal and Rezwan.
Leave a comment
This is a display used for text and numbers or any information; The LCD display we will
use is a 2×16 display meaning it will have 2 lines that can hold up to 16 letters or digit in one
line.
We will use the LCD display to display instructions on how to user our lift. We are hoping
to connect this to the PIR motion sensor so once it detects movement then the LCD backlight
should come on and the user will be able to see the instruction details. Afterwards if no
movement is detected then the LCD backlight should switch off.
Video:
Picture:
Breadboard view:
Schematics view:
Code:
Leave a comment
The ultrasonic sensor detects the distance of the closest object in front of the sensor (from 2
cm up to 3m). It works by sending out a burst of ultrasound and listening for the echo when
it bounces off of an object. The Arduino board sends a short pulse to trigger the detection,
then listens for a pulse on the different pin. The duration of this second pulse is equal to the
time taken by the ultrasound to travel to the object and back to the sensor. Using the speed
of sound, this time can be converted to distance.
The ultrasonic sensor will be used to detect what floor the lift is on, this sensor is really
accurate and each floor is 30 centimetres therefore we will use if statements to measure the
distance of the lift; if the lift is between e.g 25-35cm then display level 0 which is ground.
Video:
Picture:
Breadboard view:
(https://arduinolift.files.wordpress.com/2014/12/uss1.png)
Schematics view:
Code:
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(ledPin2, OUTPUT);
}
void loop()
{
long duration, inches, cm;
pinMode(trigPin, OUTPUT);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
Serial.print(inches);
Serial.print(“in, “);
Serial.print(cm);
Leave a comment
We will connect the ultrasonic sensor to the top of the lift and we will use 4 seven segment
displays; one for each floor and the last one will be inside the lift. The ultrasonic will detect
where the lift is and send this information to our programme. In our programme we will
have if statement saying if the lift is 60cm or higher then display 0 on the seven segments
display. Else if the lift is 30cm or higher but less than 60 then displays 1 or if the lift is 0cm or
higher but less than 30 then display 2
Video:
Picture:
(https://arduinolift.files.wordpress.com/2014/12/uss.jpg)
Breadboard View:
Schematic View:
(https://arduinolift.files.wordpress.com/2014/12/ds.jpg)
Code:
int A = 7; //Defines all pins on the Arduino Uno board in order of connection.
int B = 6;
int C = 4; // DOT is pin 5, not used in this example.
int D = 3;
byte num0 = 0x3F; //Hexadecimal format based upon the A-G, 0-9 Chart in excel and the
wiring // of the segment (refer to the on/off table image below).
byte num1 = 0x6;
byte num2 = 0x5B;
byte num3 = 0x4F;
byte num4 = 0x66;
byte num5 = 0x6D;
byte num6 = 0x7C;
byte num7 = 0x7;
byte num8 = 0x7F;
byte num9 = 0x6F;
void setup() {
Serial.begin(9600);
pinMode(A, OUTPUT); // Making all pins outputs
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
pinMode(E, OUTPUT);
pinMode(F, OUTPUT);
pinMode(G, OUTPUT);
pinMode(10,OUTPUT);
}
void on(byte num) // This function turns on the correct pins to display numbers passed to
it // through the variable “num”.
{
int result = bitRead(num, 0); // Read the first binary entry in num and stores it in result.
{
digitalWrite(A, HIGH);
} // Turns on the segment.
else // Otherwise, it turns it off.
{
digitalWrite(A, LOW);
} // Turns segment off.
result = bitRead( num, 1); // Same thing for the 6 remaining segments.
{
digitalWrite(B, HIGH);
}
else
{
digitalWrite(B, LOW);
}
result = bitRead( num, 2);
if (result == 1)
{
digitalWrite(C, HIGH);
}
else
{
digitalWrite(C, LOW);
}
result = bitRead( num, 3);
if (result == 1)
{
digitalWrite(D, HIGH);
}
else
{
digitalWrite(D, LOW);
}
result = bitRead( num, 4);
if (result == 1)
{
digitalWrite(E, HIGH);
}
else
{
digitalWrite(E, LOW);
}
result = bitRead( num, 1); // Same thing for the 6 remaining segments.
if (result == 1)
{
digitalWrite(B, LOW);
}
result = bitRead( num, 2);
if (result == 1)
{
digitalWrite(C, LOW);
}
result = bitRead( num, 3);
if (result == 1)
{
digitalWrite(D, LOW);
}
{
digitalWrite(F, LOW);
}
{
digitalWrite(G, LOW);
}
}
void loop()
{
long duration, inches, cm;
pinMode(trigPin, OUTPUT);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
Serial.print(inches);
Serial.print(“in, “);
Serial.print(cm);
Serial.print(“cm”);
Serial.println();
delay(100);
}
else if(cm>65 && cm<=90)
{
on(num3);
else
{
off(num1);
off(num2);
off(num3);
}
}
Leave a comment
A push button is a component that connects two points in a circuit when you press it.
The push button will be used to control what floor the lift is one; we will have 3 push
buttons for each floor (ground, first, second) once a push button is pressed the lift will move
to that floor.
Video:
TESTING BUTTONS TO A…
Picture:
Breadboard view:
(https://arduinolift.files.wordpress.com/2014/12/buttonbb.png)
Schematics view:
Code:
void loop(){
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
if (buttonState1 != lastButtonState1 || buttonState2 != lastButtonState2 || buttonState3 !=
lastButtonState3) {
Leave a comment
A stepper motor is a special type of electric motor that moves in increment or steps as it’s
known as; rather than turning smoothly as a conventional motor does. The size of the
increment is measured in degrees and can vary depending on what you want it to do.
The stepper motor will be used to control the lift moving up and down, by using this motor
we can control the lift with precision. The stepper motor needs a motor driver that will
allow the motor to turn both ways in order for the lift to go up and down. This motor
requires addition power for it to lift the lift up.
Videos:
STEPPER MOTOR
Picture:
Breadboard view:
Schematics view:
(https://arduinolift.files.wordpress.com/2014/12/stepsch.png)
Code:
#include <Stepper.h>
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}
Leave a comment
A seven segment display is a form of electronic display device for displaying decimal
numerals that is an alternative to the more complex dot matrix display. These displays are
used for digital clocks, basic calculators and other numerals devices.
We will use the seven segment display on every floor to display what floor the lift is on. On
each level of a lift you can see what floor the lift is on so you know how long it will take for
the lift to get to your floor. This should always be as quick as possible to make sure people
are not waiting for long.
Video:
Breadboard view:
Schematics view:
(https://arduinolift.files.wordpress.com/2014/12/7segschem.png)
Code:
int A = 7;
int B = 6;
int C = 4;
int D = 3;
Leave a comment
This is a sensor that detects whether a human has moved in or out of the sensors range. This
sensor is really small, inexpensive, low-power and is easy to install and use.
We intend to use a Pyroelectric Infrared PIR Motion Sensor Detector to detect movements
for when a person comes towards the lift; this will switch everything on of the lift such as
the lights will turn on. Once there is no movement it will switch everything off.
Video:
Picture:
Breadboard view:
Schematics view:
Code:
void setup(){
pinMode (motion_1,INPUT);
digitalWrite (light_1,LOW);
//this delay is to let the sensor settle down before taking a reading
delay(1000);
if (sensor_1 == HIGH){
//turn led on
digitalWrite(light_1,HIGH);
//delay 1 min
delay(1000);
Leave a comment
Older posts
Blog at WordPress.com.