The main idea of the project is to make an enclosed multifunctional open space ( seat , shading and kids area ) that can be used as : outdoor pergola or as a open area in parks.
inspired by The Medina Haram Piazza Shading
We use Fusion 360 software to design the project and export it as dxf files.
We use AutoCAD to add the living hinge to petal.
Start by drawing sketches for the base, side, top and petals then export the sketch to join project parts.
Making T-slots to assemble parts together using screws and nuts.
Mounting the components.
Add Living-Hinge to petals.
Export DXF files to fabricate.
We used laser cutting machine to cut the model.
We Use LaserCAD to set the parameters to cut and engrave the design and send it to laser cut.
We use prusa i3 mk3 for 3D printing.
We use Ultimate Cura Software to slice the 3d design and export it into a G-code file.
Because our laser cutting machine did not work, I cut my parts in Supernova makerspace, so the parameters for cutting were: speed 20 & power 70. (the same parameters on the lab)
I used 3 sheets of plywood to cut the parts.
Fabricate the first sheet.
Fabricate the other sheets.
I used the 3d printing to print potentiometer Knob.
Printing potentiometer Knob
Control the position of the Servo motor with the Arduino and the potentiometer.
Ir module sensor used to detect specific characteristics in its surroundings through emitting or detecting IR radiation.
LDR sensor module is used to detect the intensity of light
servo motor is a rotary actuator that allows for precise control of angular position
Manual Mode:
The Pavilion can be controlled by using a potentiometer.
Seating mode:
The pavilion can be opened and closes (According to a motion sensor ).
I used external power source (5V) to to had a better performance with servo motors.
and (9V) adaptor to power Arduino.
#include <Servo.h>
Servo servo[4];
int servoPins[] = {9, 10, 11, 12};
int IR[] = {4, 5, 6, 7};
int obj = 0;
const int LDR = A0 ;
int pot = A1;
int angle;
int modeslider = 2;
First I add the servo library to the code, then define the servo pins and Ir sensor pins in array and add the rest of components pins.
void setup() {
Serial.begin(9600);
pinMode(modeslider, INPUT_PULLUP);
pinMode(LDR, INPUT);
for (int i = 0 ; i < 4 ; i++) {
servo[i].attach(i + 9);
servo[i].write(0);
}
}
In void setup section:
define the pin mode for a slide switch and LDR.
define the servos in for statement and make servos write 0.
void loop() {
angle = analogRead(pot);
angle = map(angle, 0, 1023, 10, 180);
if (digitalRead (modeslider) == LOW) {
Serial.println("Seating Mode");
for (int i = 0 ; i < 4 ; i++) {
obj = digitalRead(IR[i]);
servos(obj, i);
}
} else {
Serial.println("Manual Mode");
for (int i = 0 ; i < 4 ; i++) {
servo[i].write(angle);
}
}
}
In void loop section:
define the angle that write in servo on manual mode
write if else statement to change the modes using the slider switch.
if slide switch send low signal(Enter in seating mode) else (Enter in manual mode)
void servos(int Reading , int servoPin) {
if (Reading == LOW) {
servo[servoPin].write(180);
Serial.print("object");
Serial.println(servoPin - 9);
} else {
servo[servoPin].write(0);
Serial.print("Empty");
Serial.println(servoPin - 9);
}
}
I made custom void function to allow me to control each servo with each Ir sensor.
Describe the code:
when the switch on terminal 1 the project is on manual mode to control the pavilion using potentiometer, on terminal 2 the project go to seating mode to sense the movement using Ir sensor.
After fabricate the project, assemble parts together using screws and nuts
Start to mount the Arduino and breadboard on the base.
2. Assemble the side parts on the base.
3. assemble the servos on top part.
4. Assemble the petals on top part.
5. Assemble the rest of components to project.
6. The final result.
The final Video
void servos(int Reading , int servoPin) {
if (Reading == LOW) {
servo[servoPin].write(180);
Serial.print("object");
Serial.println(servoPin - 9);
} else {
servo[servoPin].write(0);
Serial.print("Empty");
Serial.println(servoPin - 9);
}
}
First when I use custom void function my peer Alaa Wahba help me to explain how custom void function work and how I can use it in my project.
while work on mechanism of moving petals my instructor Ahmed Khaled suggested to me to use living hinge to use in my design. so I tried many times to find best living hinge to use.
While working on mechanism with living hinge I discover some points:
if I want more flexibility, I need to reduce the size of pattern.
To make the plywood double curvature I need to use fabric pattern.
I have a problem when I want to program 4 servos with 4 Ir sensor they don't work like expected so I asked my instructor, so we searched to find the best way to solve the problem and we found we should make custom void for servo and call it in void loop.
and this link about how to use custom void.
void servos(int Reading , int servoPin) {
if (Reading == LOW) {
servo[servoPin].write(180);
Serial.print("object");
Serial.println(servoPin - 9);
} else {
servo[servoPin].write(0);
Serial.print("Empty");
Serial.println(servoPin - 9);
}
}
Add light and music to interact with user to look cooler and funniest for user.