Self Lighting and Watering Garden

My project is a self watering and lighting garden. The plants will be under lights 24 hours of the day and as soon and the soil is detected dry it will water the plants.

Engineer

Kreena P.

Area of Interest

Chemical Engineering

School

Monta Vista High School

Grade

Incoming Senior

Starter Project

My starter project is the Motion Alarm, the alarm will start making sounds if something is in front of the sensor. If the object remains unmoving in front of the sensor the sound will remain until the object moves. I enjoyed this project because it taught me how to use an Arduino, the basic components of a circuit and specifically how to use resistors. It is important to us the right number resistor because if not then the circuit can short. I also learned what everything means on the arduino board such as the numbers and how to do a connection between the board and the arduino. One major roadblock I encountered was trouble shooting because the code just wasn’t going through and I had looked up and tried everything. In the end I realized that the usb port isn’t connected to the board properly. Through the frustrating parts of the project, I was able to keep a straight mind and not lash out at my project.

First Milestone

My project is the self watering and light garden, the garden will get watered based on the time of day. For my first milestone I finished the moisture, temperature and light sensor. I learned how to make a moisture sensor out of an everyday thing, nails. I also learned the difference between analog and digital. How digital is more binary. One major roadblock I encountered was when the code disappeared from the website and I had to code/ find the code online for the sensors.

Second Milestone

My project is the self watering and light garden, the garden will get watered based on the time of day. For my second milestone I finished the relay. I learned how to assemble a water pump and connect them together in a relay. I also learned how a relay works, there are many different sides to the relay. One major setback I encountered was that the lights broke during the shipping so the lights had to be reordered. Also the original project used to much voltage so, a new relay also had to be ordered. 

Third Milestone

My project is the self watering and light garden, the garden will get watered based on the time of day. For my third milestone I finished my garden which included setting up the relay and trouble shooting the code. I learned how to assemble a relay and connect two relays together. I also learned how to code a relay. I also learned how ground works, because my pump wasn’t properly connected to ground on the arduino. A few setbacks I encountered were my code was original giving out fluff values instead of the actual value because my code was in digital and needed to be in analog to give different values. My circuit was also not connected properly and I took shortcuts in my original sautering so, I had to remake the circuit on the PCB.

Final Milstone

 My project is the self watering and light garden, the garden will get watered based on the time of day. For my final milestone I added neem oil as a pest resistant and adding a temperature sensor. I learned how to add a light/ component directly to the arduino. One major difficulty I had was I didn’t create a proper bridge with the solder so, when I was testing the temperature sensors the LED light was flashing inconsistently. 

Final Code:

int moistureSensor = A0;

int lightSensor = A1;

int tempSensor = A2;

int moisture_val;

int light_val;

int temp_val;

int relay=2;

int relaySmall=7;

int ground= 11;

int ground2 = 9;

int ground3= 4;

int light= 8;

void setup() {

Serial.begin(9600); //open serial port

pinMode(relaySmall,OUTPUT);

pinMode(relay, OUTPUT);   

pinMode(ground, OUTPUT); 

pinMode(ground2, OUTPUT);

pinMode(ground3, OUTPUT);

digitalWrite(ground, LOW);

digitalWrite(ground2, LOW);

digitalWrite(ground3, LOW);

}

void loop() {

   moisture_val = analogRead(moistureSensor); // read the value from the moisture sensor

  Serial.print(“moisture sensor reads “);

  Serial.println( moisture_val );

  if (moisture_val < 500){

    digitalWrite(relaySmall, HIGH); 

    Serial.println(“turning on pump”);  

  }

  if (moisture_val > 100)

    digitalWrite(relaySmall, LOW); {

    Serial.println(“turning off pump”); 

  }

  light_val = analogRead(lightSensor); // read the value from the photosensor

  Serial.print(“light sensor reads “);

  Serial.println( light_val );

  if (light_val <600){

      digitalWrite(relay, HIGH);

      Serial.println(“turning on lights”); 

  }

  if (light_val > 550){

    digitalWrite(relay, LOW); 

    Serial.println(“turning off lights”); 

  }

  temp_val = analogRead(tempSensor); 

Serial.print(“temp sensor reads “);

Serial.println( temp_val );

if (temp_val < 380)

{

digitalWrite (8, HIGH);

Serial.println(“turning on low-temperature LED”); 

}

if (temp_val > 380)

{

 digitalWrite (8, LOW);

Serial.println(“turning off low-temperature LED”); 

}

  delay(1000);

}

Leave a Comment

Start typing and press Enter to search

Bluestamp Engineering