0% found this document useful (0 votes)
8 views

Arduino Lift Creating A Mini Version of A Lift Using Arduino

Uploaded by

samerkalmoni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Arduino Lift Creating A Mini Version of A Lift Using Arduino

Uploaded by

samerkalmoni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

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

EACH MEMBER HAS CONTRIBUTED EQUALLY AND SH

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 1 of 29
Advertisements

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

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 2 of 29
detected by an ultra sonic sensor that can measure distance according to the height of the
lift. We will use a stepper motor to pull the lift up and down; this will work with the user
interaction of button pressed.

Leave a comment

Project Aims & Outcomes


Posted on November 7, 2014December 10, 2014 by pcomp2014
Our project will imitate a real life lift. We will create a structure and implement a box within
it which will represent a lift capsule, where this capsule will move to different levels. The lift
will be controlled by buttons which will need to be pressed to move it to the floor you
would want it to. The lift will stop at each floor and will wait for the next input whether to
either move to the floor above or below. Using this lift a user could see a functionality of a
real life lift how it was initially designed using counter-weights.

Leave a comment

I/O
Posted on November 7, 2014December 3, 2014 by pcomp2014

Inputs:

Push-buttons: To select the lift level

Ultrasonic sensor: To find the position of the lift

PIR motion sensor:

Outputs:

Stepper motor: Control movement of the lift using a string

Seven segment display: Display the level of the lift

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 3 of 29
LCD display:

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

Components and Software


Posted on November 8, 2014December 10, 2014 by pcomp2014
Our project does not require any other software and only requires the use of the Arduino
software. The components for this project are:

Acrylic Cube 5 sided box (lift)


Ring & plate (lift hook)

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 4 of 29
Twine string (lift cable)
Round steel (lift support)
Spindle (lift structure)
Sensor kit (lift detection)
7 segment led (lift number)
Pin connectors (Arduino
connections)
Wood (bottom structure)
3 buttons
16 pin header
Display
H-Bridge
Step motor and bracket
nut and bolt
Shaft Mount wood
Acrylic glass
12V Battery
Screws and Caps
Breadboards
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

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 5 of 29
Testing LCD Display
Posted on November 8, 2014December 10, 2014 by pcomp2014
What is an LCD display?

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.

What will we use it for?

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

TESTING ULTRA SONIC SENSOR


Posted on November 8, 2014December 10, 2014 by pcomp2014
What is an ultrasonic sensor?

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.

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 6 of 29
What will we use it for?

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:

TESTING ULTRA SONIC S…

Picture:

Breadboard view:

(https://arduinolift.files.wordpress.com/2014/12/uss1.png)

Schematics view:

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 7 of 29
(https://arduinolift.files.wordpress.com/2014/12/usss.png)

Code:

// trigger pin is connectetd to pin 2


const int trigPin = 2;
// echo pin is connected to pin 4
const int echoPin = 4;

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);

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 8 of 29
Serial.print(“cm”);
Serial.println();
delay(100);

long microsecondsToInches(long microseconds)


{
return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
return microseconds / 29 / 2;
}

Leave a comment

TESTING ULTRA SONIC SENSOR WITH 7


SEGMENT DISPLAY
Posted on November 8, 2014December 10, 2014 by pcomp2014
What will we use it for?

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:

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 9 of 29
TESTING USS WITH 7SD

Picture:

(https://arduinolift.files.wordpress.com/2014/12/uss.jpg)

Breadboard View:

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 10 of 29
(https://arduinolift.files.wordpress.com/2014/12/d.jpg)

Schematic View:

(https://arduinolift.files.wordpress.com/2014/12/ds.jpg)

Code:

// trigger pin is connectetd to pin 12


const int trigPin = 12;
// echo pin is connected to pin 13
const int echoPin = 13;

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;

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 11 of 29
int E = 2;
int F = 8;
int G = 9;

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.

if (result == 1) // Check to see if this segment should be on.

{
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.

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 12 of 29
if (result == 1)

{
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, 5);


if (result == 1)
{

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 13 of 29
digitalWrite(F, HIGH);
}
else
{
digitalWrite(F, LOW);
}

result = bitRead( num, 6);


if (result == 1)
{
digitalWrite(G, HIGH);
}
else
{
digitalWrite(G, LOW);
}
}
void off(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.

if (result == 1) // Check to see if this segment should be on.


{
digitalWrite(A, LOW);
} // Turns segment off.

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);
}

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 14 of 29
result = bitRead( num, 4);
{
digitalWrite(E, LOW);
}

result = bitRead( num, 5);


if (result == 1)

{
digitalWrite(F, LOW);
}

result = bitRead( num, 6);


if (result == 1)

{
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);

if(cm>10 && cm<=30)


{
on(num1);

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 15 of 29
}

else if(cm>35 && cm<=60)


{
on(num2);

}
else if(cm>65 && cm<=90)
{
on(num3);

else
{
off(num1);
off(num2);
off(num3);

}
}

long microsecondsToInches(long microseconds)


{
return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)


{
return microseconds / 29 / 2;
}

Leave a comment

TESTING BUTTONS TO CONTROL


MOVEMENT BETWEEN EACH FLOOR
Posted on November 8, 2014December 10, 2014 by pcomp2014
What is a push button?

A push button is a component that connects two points in a circuit when you press it.

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 16 of 29
What will we use it for?

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:

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 17 of 29
(https://arduinolift.files.wordpress.com/2014/11/button-sch.png)

Code:

const int buttonPin1 = 2;


const int buttonPin2 = 3;
const int buttonPin3 = 4;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int lastButtonState1 = 0;
int lastButtonState2 = 0;
int lastButtonState3 = 0;

boolean level1 = true;


boolean level2 = false;
boolean level3 = false;
void setup() {
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
// Sets up the serial.
Serial.begin(9600);
}

void loop(){
buttonState1 = digitalRead(buttonPin1);
buttonState2 = digitalRead(buttonPin2);
buttonState3 = digitalRead(buttonPin3);
if (buttonState1 != lastButtonState1 || buttonState2 != lastButtonState2 || buttonState3 !=
lastButtonState3) {

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 18 of 29
if(level1 == true){
if (buttonState1 == HIGH) {
Serial.println(“moving from level 1 to level 1″);
level1 = true;
level2 = false;
level3 = false;
}
if (buttonState2 == HIGH) {
Serial.println(“moving from level 1 to level 2″);
level1 = false;
level2 = true;
level3 = false;
}
if (buttonState3 == HIGH) {
Serial.println(” moving from level 1 to level 3″);
level1 = false;
level2 = false;
level3 = true;
}
}
else if(level2 == true){
if (buttonState1 == HIGH) {
Serial.println(“moving from level 2 to level 1″);
level1 = true;
level2 = false;
level3 = false;
}
if (buttonState2 == HIGH) {
Serial.println(“moving from level 2 to level 2″);
level1 = false;
level2 = true;
level3 = false;
}
if (buttonState3 == HIGH) {
Serial.println(” moving from level 2 to level 3″);
level1 = false;
level2 = false;
level3 = true;
}
}
else if(level3 == true){
if (buttonState1 == HIGH) {
Serial.println(“moving from level 3 to level 1″);
level1 = true;

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 19 of 29
level2 = false;
level3 = false;
}
if (buttonState2 == HIGH) {
Serial.println(“moving from level 3 to level 2″);
level1 = false;
level2 = true;
level3 = false;
}
if (buttonState3 == HIGH) {
Serial.println(“moving from level 3 to level 3″);
level1 = false;
level2 = false;
level3 = true;
}
}
}
lastButtonState1 = buttonState1;
lastButtonState2 = buttonState2;
lastButtonState3 = buttonState3;
}

Leave a comment

Testing Stepper Motor


Posted on November 8, 2014December 10, 2014 by pcomp2014
What is a stepper motor?

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.

What will we use it for?

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.

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 20 of 29
Initially we were using a thread rod that turned clockwise and anticlockwise in order to
make the lift go up and down using a driver beam. This was really slow and took a lot of
time just to reach first floor then we decided to use string with was much faster than the
threaded rod.

Videos:

TESTING STEPPER MOT…

TESTING STEPPER MOTOR

STEPPER MOTOR

Picture:

Breadboard view:

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 21 of 29
(https://arduinolift.files.wordpress.com/2014/12/stepbread.png)

Schematics view:

(https://arduinolift.files.wordpress.com/2014/12/stepsch.png)

Code:

#include <Stepper.h>

const int stepsPerRevolution = 200;

Stepper myStepper(stepsPerRevolution, 8,9,10,11);

void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 22 of 29
void loop() {
// step one revolution in one direction:
Serial.println(“clockwise”);
myStepper.step(1000);
delay(500);

// step one revolution in the other direction:


Serial.println(“counterclockwise”);
myStepper.step(-200);
delay(500);
}

Leave a comment

Testing Seven Segment Display


Posted on November 8, 2014December 10, 2014 by pcomp2014
What is seven segment display?

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.

What will we use it for?

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:

TESTING SEVEN SEGME…

Breadboard view:

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 23 of 29
(https://arduinolift.files.wordpress.com/2014/12/7segbb.png)

Schematics view:

(https://arduinolift.files.wordpress.com/2014/12/7segschem.png)

Code:

int A = 7;
int B = 6;
int C = 4;
int D = 3;

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 24 of 29
int E = 2;
int F = 8;
int G = 9;

byte num0 = 0x3F;


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 on(byte num)


{
int result = bitRead(num, 0);
if (result == 1)
{digitalWrite(A, HIGH);}
else
{digitalWrite(A, LOW);}
result = bitRead( num, 1);
if (result == 1)
{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, 5);
if (result == 1)

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 25 of 29
{digitalWrite(F, HIGH);}
else
{digitalWrite(F, LOW);}
result = bitRead( num, 6);
if (result == 1)
{digitalWrite(G, HIGH);}
else
{digitalWrite(G, LOW);}
}
void setup() {
pinMode(A, OUTPUT);
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
pinMode(E, OUTPUT);
pinMode(F, OUTPUT);
pinMode(G, OUTPUT);
pinMode(10,OUTPUT);
}
void loop() {
on(num0);
delay(1000);
on(num1);
delay(1000);
on(num2);
delay(1000);
on(num3);
delay(1000);
on(num4);
delay(1000);
on(num5);
delay(1000);
on(num6);
delay(1000);
on(num7);
delay(1000);
on(num8);
delay(1000);
on(num9);
delay(1000);
}

Leave a comment

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 26 of 29
Testing Pyroelectric Infrared PIR Motion
Sensor Detector
Posted on November 8, 2014December 10, 2014 by pcomp2014
What is PIR motion sensor?

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.

What will we use it for?

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:

TESTING MOTION SENSOR

Picture:

Breadboard view:

Schematics view:

Code:

// This is a test for PIR mation sensor

//declare pin for sensor

int motion_1 =3;

//declare pin for led bulb

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 27 of 29
int light_1 = 13

// main setup function

void setup(){

//set sensor as input

pinMode (motion_1,INPUT);

//set led as output

pinMode (light_1, OUTPUT);

// this fuction is needed to play

void loop (){

//set led off

digitalWrite (light_1,LOW);

//this delay is to let the sensor settle down before taking a reading

delay(1000);

// this reads the sensor

int sensor_1 = digitalRead(motion_1);

//checks of any motion

if (sensor_1 == HIGH){

//turn led on

digitalWrite(light_1,HIGH);

//delay 1 min

delay(1000);

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 28 of 29
Leave a comment

WEEK 7: HARDWARE ENGINEERING


Posted on November 14, 2014December 10, 2014 by pcomp2014
As now all the main testings has been done and we know what components we are going to
use we are able to move on to creating the housing for the lift as the next step would be to
make the housing so we can do the next stop which would be adding the components to the
housing. As this didn’t require 2 of us creating it Rezwan created the housing whilst
Kamal was making the electronic breadboards and ensuring each component is working for
us to take the next step of assembling the components to the housing.

Leave a comment
Older posts

Blog at WordPress.com.

https://arduinolift.wordpress.com/?order=asc 27/11/2017, 7=07 am


Page 29 of 29

You might also like