Week 7 - Greenhouse

Ideation

Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)

greenhouse with ventilation system 

the assignment this week is to Design and program a smart device that performs a certain function or solve a problem: program Arduino UNO to read signals from multiple input components (Sensor, Switch, or variable resistor) to control multiple action components (Motor, Buzzer, LED...etc) using Arduino C (Text Code).  

My idea this week is an even-span greenhouse with a ventilation system it is the cool version of the greenhouse, it contains very simple components yet it is very effective in temperature and humidity regelation and all that is controlled by sensors.

so basically it's a greenhouse with a dht11 sensor module and depending on its reading a fan is controlled to decrease the temperature and humidity if needed and it contains led lights turned on when ultra-sonic sensor detects motion.

Tool Chain

Which software/machines/materials did you use in the assignment? Why?

Make sure to search for the datasheet of the components before connecting it to know its specifications( safe range of voltage and current intensity and connections)

Circuit Components:

breadboard

Arduino Uno (brain)

Jumper wires

DC 5V fan (output)

led light (output)

Enclosure Materials:

Design/Preparation Process

Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?

1st. we designed the circuit on tinker cad using:

"Red is +ve, Black is ground, Orange is input analog , blue is the ultrasonic signals and green and pink are the output analog."

then its code time:

1st. i used code blocks just to simulate the circuit so we have two input sensors and each one of them control a different output device so there is two if conditions one for the temperature sensor and if the temperature exceeded a certain value the fan start and the ultrasonic sensor if it detect motion the led is turned on.

simulation.mp4

After simulating the circuit i started to write the code:

1st i coded only two components the dht11 and the fan only

i used the dht tester library by adafruit to test the sensor first then i edited the code by adding output component the 5v dc fan so if the temperature or the humidity exceeded a certain value the fan is on.

then i started a new file for coding the ultrasonic sensor, i searched online on how others had coded the ultrasonic sensor then i took the code and edited it a little, add the output components (led) so if the ultrasonic reading is high the led is on.

so after that i merged the two file together to get the last code and uploaded it.

CODE1.mp4
FINAL CODE.mp4

Development/Implementation Process

Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?

I started the circuit with the dht11 sensor and the fan only connected them as mentioned below:

1st circuit(1 input&1 output)

final circuit(2 inputs & 2 outputs)

then I connected the ultra-sonic sensor and the led is turned on when the sensor detects motion

circuit.mp4

then I started to build the enclosure

enclosure building

enclosure building

last I assembled everything together 

1st i assembled 3 sides with the base and glues the fan on its place.

2nd i mounted the components (arduino, relay and breadboard) and made the cardboard box around them.

last i glued the last side and put the sensors and the led in there place.

greenhouse.mp4

Overcoming Challenges

What kinds of challenges or problems did you face while doing the assignment, tutorials, or exercises?  How did you solve them? Did you ask for help from an instructor or peer? Please provide a link to the tutorial or article that you used to solve your problem (if any)

I had a lot this week

1st the fan: i connected the fan to a motor driver as we made in the end-week session but that didn't work even with the adaptor and the common ground and everything it worked for a few milliseconds or it made just a small turn when i put the pin or reset the Arduino then it stopped my first thought was that there is a problem in the connections but double checked it and all was right and so was the code. 

so "Mohamed Adel" recommended to use the relay instead, first we connected the fan with the adaptor and it worked, then we connected the relay only to the circuit coded it and tested all that then we connected the fan to the relay and voila.

2nd the Arduino: after i uploaded the code and it worked perfectly then i put all together with the enclosure and all then connected the power and nothing happened, not a single output worked i checked everything watched the videos of the circuit before the enclosure and i found it, there was a wire that got detached and i connected it to the ground instead of the +ve, actually i expected that because the orange small Arduino led was faded, so if it is faded it is probably a short circuit.

Assignment Design Files