FINAL PROJECT
Gardening is one of my hobbies I am enjoying it and believe that we should encourage people to have some activity in planting to enhance environment and help our pennant. Unfortunately in desert weather condition like as what we have in Kuwait gardening become a relay hard activity to do due to the very high temperature and the a very active sand storms in Kuwait specially in a summer season.
My first thought on project was to make (The Smart Shield for Agriculture) my own automated shading system that integrated with Temperature sensor , wind sensor and light sensor to protect my plants especially in specially in the early stages of their life cycle.
The
concept
The shutter will be automatically closed or opened
when any of the sensors detected an unusual signal (high
temperature,frosting,heavy wind or sand storms)
ROUGH Sketch :
The first step of my project is sketching my idea before moving to the 2D designing step. Actually I did my firs draft sketch and 2D design by the second week of fabacademy which before I really know and realized the mechanical and electronic challenges that I may face while producing my product . Then I modified the design recently with the current version to have better product without any obstetrical.
Draft#1
Draft #2
Quick
2D DESIGNING (Computer-aided
design)
As mentioned before I have tow versions of design I
made booth of them by using Ms-powerpoint painting option
because I have a good experience of using it on my presentations
and office works:
1st design
2nd design
3D DESIGNING (Computer-aided design)
I did my final design by using my lovely parametric tool Onshape.com to execute my final project and utilize the advantage of 3D assembly before execution stage.
I
designed each part alone with all the slots as shown above
I used my sketch as a reference to not miss any part.
Then I started assembling all the parts to ensure every single part is matching with others and the slots are perfectly fitting each other. And at the end I exported the files as DXF to send them to CNC Download Side.DXF Front.DXF
Body construction (Computer-controlled Machining)
After completing the design I took the files to the Art-cam to make the final touches before cutting the wooden sheet such as identifying the outside/inside parts , allowances editing and the order of cutting. Then I exported it as PLT file and started the parts cutting.
Profiling setting
Identifying the outside and inside parts
Arranging parts within the size of the available sheet
Exporting PLT file
Unfortunately I lost the images of cutting process and fitting process as well. But in general I repeated the same procedure of week#7.
Final product after cutting and fitting
Electronics and programing
Circuit board (Computer-controlled Machining)
Before starting the circuit board design I read a lot about the different types of sensor, motors (stepper,servo…) and other components to choice the best group of components for my project . Finally I decided to make my design with following components which going to serve may purpose :
1.Temperature sensor.
2.Flex sensor (for wind).
3.Light sensor.
4.Stepper motor (Nema 42).
5.Attiny44.
6.12V power connection.
In this board I made the routing manually inorder to have the maximum width of connection. I did a good job actually but I missed one connection (blue color on the left image) that I fixed it by adding a wire in the back of the board as shown below.
After milling the board and ensure all the connections are well connected and there is no circuit-short I started soldering components and got the final result as shown above.
Programing
Obtaining sensors readings :
This is the first step in programing on which I am going to build all of my work. I used the following code to test sensors separately.
[code]
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 3; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
[/code]
from
the following I got
To identify the threshold for each sensor I connected my senors separately to arduino board and connected them to my computer and start obtaining the readings.
Then I got the threshold for each sensor as following :
•Light sensor 500
•Temperature sensor 60
•Flex sensor 800
[code]
#define dirPin 4
#define stepPin 5
#define enablePin 3
#define close 0
#define open 1
#define light_sensor 0
#define light_th 500
#define temp_sensor 1
int temp_th = 60;
#define wind_sensor 2
#define wind_th 800
int rcount = 1000;
boolean cstatus = open;
void close_window() {
if (cstatus == open) {
digitalWrite(dirPin, 1);
digitalWrite(enablePin, 0);
for (int i = 0; i <= rcount; i++) {
digitalWrite(stepPin, LOW);
delayMicroseconds(50);
digitalWrite(stepPin, HIGH);
delayMicroseconds(5000);
}
digitalWrite(enablePin, 1);
cstatus = close;
}
}
void open_window() {
if (cstatus == close) {
digitalWrite(dirPin, 0);
digitalWrite(enablePin, 0);
for (int i = 0; i <= rcount; i++) {
digitalWrite(stepPin, LOW);
delayMicroseconds(50);
digitalWrite(stepPin, HIGH);
delayMicroseconds(5000);
}
digitalWrite(enablePin, 1);
cstatus = open;
}
}
void setup() {
// We set the enable pin to be an output
pinMode(enablePin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
digitalWrite(enablePin, HIGH);
delay(1000);
// temp_th=analogRead(temp_sensor)+30;
}
void loop() {
int light = analogRead(light_sensor);
int temp = analogRead(temp_sensor);
int wind = analogRead(wind_sensor);
if ((wind> wind_th)||(temp > temp_th)||(light < light_th)) //high wind OR high temp OR high light
{
close_window();
delay(5000);
}
else { //heavy wind
open_window();
delay(5000);
}
}
[/code]
Testing before assembling
Temperature sensor test :
I modified the threshold of flex sensor in the code to be 1023 which is the maximum value for the flex sensor that I used and also changed the light sensor threshold to the maximum value to make sure that the only sensor that can detect any changing is the temperature sensor. The video below shows this test :
Wind sensor test : (flex sensor)
I modified the threshold of temperature sensor in the code to be 1023 which is the maximum value for the temperature sensor that I used and also changed the light sensor threshold to the maximum value to make sure that the only sensor that can detect any changing is the flex sensor. The video below shows this test :
Light sensor test :
I modified the thresholds of flex sensor and temperature sensor in the code to be 1023 which are the maximum value for both sensors to make sure that the only sensor that can detect any changing is the light sensor. The video below shows this test :
programing is completed
3D Printing
download (stick_holder.stl , stick_base_holder.stl)
download (motor_holder.stl)
3D printed stick joints
3D printed motor holder
Assembling
Now it is the time for gather all parts together to complete this project.
Fixing the board to the wooden body
Fixing the metal shutter with the wooden body and motor holder and joined the stick holder with the shutter stick
Final project after assembling
Video
SLIDE