i have passion generally about smart house and how to automate it and love plants and try more to care plant in my home and Unfortunately it's dies .
so I thought to make a green house to can care my plants automatically by using the skills and tools i learnt in a maker diploma .
And the general idea of the project it Preparing place to be suitable for plant life and Control the air and climate inside it by the blower fan based on DHT sensor .
my first idea was make a model of smart house with more sensor and action . And the idea started to change when I discussed the idea of my project with my instructors , Sharif suggested to me to change the the idea because it is very general and does not lead to a specific function. Then Migo suggested to me the idea of the project "THE GREEN HOUSE", so i started working in idea. then I search for similar project in some sites and start write a project proposal.
and I include images and video for similar projects .
i design my body of project using fusion 360 CAD software , my design body Consists of 9 main parts To be assembled to complete the house and 3 subsections parts for box of electronics and this parts I make to cut it by laser cut machine , I make 2 rectangle sides each side consists of two rectangles one made from wood and the other from acrylic that are joined by A rectangular parts I design it with dimensions of 30 mm * 5 mm with two holes, each slot of 3 mm diameter to fit the screw that I will use to fix the two parts and its thickness is 3 m , I printed it on 3d printer.
then I designed the other sides that make the house shape one made from wood and the other made from acrylic and I joined by 90 Degree Angle Brackets that I made some modifications to a ready-made design from the internet to the part to fits the perimeter of the screw that I will use to secure it and I printed by 3D printer ,
then i design the two upper parts and it made from acrylic and i joined it by metal Hinge
I made some holes in the wooden part of the design to fit the size of the fan blower , lcd and botton and some slots in the acrylic part For ventilation ,
the bottom part i design it with t slots .
I made some adjustments to a ready-made design for the fan entrance because it was too short to go through the wood, so I extended the parts.
bottom part
90 Degree Angle Brackets
joint part with 2 slots
joint part that joined the wooden part and acrylic part
front part
acrylic part with slots.
wooden back part
the back part that have a slot of 2 fans blower
wooden parts with lcd and botton place
the acrylic side that's joint with the wooden parts by joint parts that are printed
the wooden part of the sides.
the bottom side of the box of electronics
the bottom side of the house.
the 90 Degree Angle Brackets and joint part.
the parts of fan blower.
i used a laser cut machine to cut the parts of the body of the house by using laser work software, i set the power and speed of the machine for each material wood (22,65)and acrylic(18,69) and power the laser cut machine on then i choose my file from the screen of machine and track frame the my design to check the wood or acrylic boards are in the track frame the in choose run to start cut and I take some photos and videos for cutting after I load a DXF file in the machine.
and used a 3D printer to print the joint part, 90 Degree Angle Brackets, and fan parts to can jointed the parts together by using Prusa software after I load a g-code file in the storage of the machine.
i make ample test printing to check the parts by printing one of this part , then I checked I start printing all parts.
after finishing cutting and printing i power off the machines and wait for minutes to can take of my parts.
my circuit componants : breadboard , arduino uno board , water pump, relay, 2 motor fan blower,motor drive ,soil sensor , DHT 11 sensor , wiers , on off botton,.
the power source 12v adapter and i connect it in vin pin the i make a common 12v and common 5v and common ground then i wiring the componants in breadboard and arduino board .
DHT sensor data pin in pin 7 in arduino
motor drive with 2 fans:
fan A
in1 pin 2
in2 pin 3
fan B
in3 pin4;
in4 pin5;
and connect relay with motor pump:
soil sensor : analog A0
I have 2 sensors(input) : DHT 11 sensor and soil moisture sensor:
I have 2 out put :2 fan blower and water pump
and I have user input a bottom to on and off the system,
the first function : the blower power on based on dht sensor (humidity and temperature) automatically
.the second function : the water pump power on based on soil moisture sensor.
my power power source is a 12 v adaptor i choose it with the help of my instructor because i have i 12v fan blower and 12v water pump so the 12v adaptor is suitable.
first i download the "DHT.h" libarary the i include it in the code (#include "DHT.h"). then I defined (DHTPIN ) the pin of data in pin 7 in arduino , i define the type of dht sensor by define it in DHTTYPE and my sensor is DHT11 .
I define the relay in pin 12 by(#define relaypin 12).
i declare variable for soil sonsor in type intger named sensorValule and the initial value =0.
the 2 motor fan mountain in motor drive : motor A in1 and in2 in pin 2 and 3. and motor B in3 and in4 in pin 4 and 5.
in setup : a knows the relaypin for water pump in pinMode as OUTPUT (pinMode(relaypin ,OUTPUT) and in of motor drive as an INPUT also .
and the state of motor fan is low.
i creat a serial monitor to can read the reads of sensors as temperature and humidity and the read of soil sensor.
in (void loop):
delay (2000) mean :Wait a few seconds between measurements.
Reading temperature or humidity takes about 250 milliseconds Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
i declarte 2 variables (h and t) : h to Read humidity and t to read temperature as Celsius .
sensorValue is an analogread in pin A0.
the function of code is when(if statement ) the read of siol sensor is more than 500 the water pump will be start to irrigate else the read is less than 500 the pump will be stop irrigate.
the second if condition related to the motor fan based on DHT sensor reads when (if statement) temperature > 28 or humidity >65 the two motor fan will be power on else the 2 motor fan will be off.
#include "DHT.h"
#define DHTPIN 7 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
#define relayPin 12
int sensorValue=0;
// Motor A
int in1 = 2;
int in2 = 3;
// Motor B
int in3 = 4;
int in4 = 5;
void setup() {
pinMode(relayPin, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
// Turn on motor A
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
// Turn on motor B
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
Serial.begin(9600);
Serial.println(F("DHTxx test!"));
dht.begin();
}
void loop() {
// Wait a few seconds between measurements.
delay(2000);
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
Serial.print(F("Humidity: "));
Serial.print(h);
Serial.print(F("% Temperature: "));
Serial.print(t);
Serial.println(F("°C "));
sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(200);
if (sensorValue > 500) {
digitalWrite(relayPin, HIGH);
delay(2000);
digitalWrite(relayPin, LOW);
}
else if(sensorValue <500){
digitalWrite(relayPin, LOW);
}
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t)) {
Serial.println(F("Failed to read from DHT sensor!"));
}
else if (t > 28 || h > 65)
//if(false)
{
Serial.print(F("Humidity: "));
Serial.print(h);
Serial.print(F("% Temperature: "));
Serial.print(t);
Serial.println(F("°C "));
// Turn on motor A
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
// Turn on motor B
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
}
else if (t<30 || h<60){
// Turn on motor A
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
// Turn on motor B
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
}
}
my design body Consists of 9 main parts To be assembled to complete the house and 3 subsections parts for box of electronics and this parts I make to cut it by laser cut machine , I make 2 rectangle sides each side consists of two rectangles one made from wood and the other from acrylic that are joined by A rectangular parts and I use two things to joint the parts of acrylic the side part and upper part to allow me open the house and put the plant and the tank of water .
I joined the 4 corners by 8 parts if 90 Degree Angle Brackets . and I mount the box of electronic by the same parts , then i mount the 2 motor fan and the botton and the lcd . i tested the circuit before I mount it in the body of house i tested the fans based on DHT sensor once by humidity and once by temperature
I maximise the value of temperature with a fire Then maxmise the value of humidity by placing my hand on the sensor that is make the fan turn on . then mini minimise the value of temperature by cold the sensor by the fan that is make the fan power off and the humidity also and that shown in video.
the irrigation operation based on soil sensor : the pump started irrigate when the read of sensor reads more than 500 and that shown in serial monitor and when the read of soil is less than 500 the water pump stop the arrigation.
i fabrecate two parts to can go through in fan to allow me mountan the fan on the body of house .
sens the humidity and the fan
sense the soil sensor and the water pump
irrigation in green house
all functions in project.
tesr DHT sensor by heating and fan turn on
full smart system funcions
hing joint the acrylic patrs and the rectangular joint parts joint the wood side and the acrylic side
mount the hing with acrylic part
mount the wooden parts together
front side
the 2 patrs upper and side joint together by hing.
electronic componants
corner parts with hing and joint parts
the after integrate
fans with mount parts
befor i make holes by hand driller to mount the pvc tube
soil with plant
soil
parts fan and the electronic componants
the parts fan mount in the house
the fan mount in the house befor make holes
hole in the house for arduino board data port
fan mount completly in house with wire
At the beginning of the project, I designed and implemented the project on cardboard and transparent bags simulated for acrylic. I installed the components on them, then asked Sherif for his opinion and feedback in the design and implementation and he suggested to reduce the size of the model to fit the components and also so that the fan can do the ventilation function. then i installing electrons on it Then I started designing on the correct sizes.
i helped ahmed to make a hole in his wood design by hand driller and i helped to integrate the parts together and also helped moaiz to make hole in his project by hand driller
mena and mohab helped me more in my code and mena tested with me the all functions of project .
i got some stuck in design and got to videos of week 2 and 3 to solve it and some time i search in youtube to solve the problem and after fabrecation i got stuck some error in place of hole that is do not fit the design so i used the hand driller to makek holes to fit the parts .
and got stuck in wireing some componants so i search in google and asked mohab to help me in wiring and coding .
the pitfalls and mistakes others can avoid make sure of holes of design because the mistake in design and fabrication to solve this mistakes take very much time.
I was hoping I was turning on the lcd screen to read temprature and humidity and the soil sensor .