Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
London Dobbs
Published © GPL3+

Lazy Indoor Garden

Spending 100 times more time fiddling with this contraption than I would have just watering plants.

BeginnerWork in progress44,049
Lazy Indoor Garden

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
Or arduino micro
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1
Resistor 220 ohm
Resistor 220 ohm
×2
IoT Relay
×2
Hydroplanet T5 4ft 8lamp
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Water pump
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
DS3231M - ±5ppm, I2C Real-Time Clock
Maxim Integrated DS3231M - ±5ppm, I2C Real-Time Clock
×1
Soil moisture sensor
×9
Blumat Drip System
×1

Story

Read more

Schematics

Automatic indoor garden

This is an Arduino based plant life cycle controller

Wiring Diagram

Wiring diagram png file

Code

LazyPlants v2

Arduino
1. Controls lights on a timer.
2. Tells you when a plant isnt getting enough water from drip system.
3. Records temp and humidity to confirm fruiting temp for peppers


more to come

wifi monitoring of arduino with raspberry pi & web interface
PoE power and data transmission from soil sensors through home ethernet wiring mulyiplexed through 8 twisted pairs of cat5e
more lights & hydroponics!
#include <dht.h>
#include <LiquidCrystal.h>
#include <DS3231.h>

//Instantiate library objects
DS3231  rtc(SDA, SCL); 
LiquidCrystal lcd(8, 10, 7, 6, 5, 4); // RS, 
Time t;
dht DHT;
#define DHT11_PIN 9

//Light timer constants
int startTime = 6; //Integer hour in 24hr format to start lights
int endTime = 22; //Integer hour in 24hr format to cut the lights
int lights = 11; //light digital output pin

//Soil sensor constants
int lcdDelay = 3000; //delay time to refresh the lcd screen with new info
int analogDelay = 150; //delay time to resist EMF interference on analogRead() values
int sensors[] = {A0, A1, A2, A3, A4, A5}; //array of analog soil sensor pins
int sensorLen = 6; //integer length of sensors array
int drySoil = 400; //average sensor output value of known dried soil


//Arduino setup function
void setup() {
lcd.begin(16, 2); //Start lcd in 16x2 mode
Serial.begin(115200);//start serial output at 115200 baud rate
rtc.begin(); //init real time clock module
pinMode(lights,OUTPUT);//set light controller pin to output mode

//set analog pins to INPUT
for (int i = 0; i < sensorLen; i++) {
  pinMode(sensors[i],INPUT);
}
}


//main loop
void loop() {
//Declare local loop variables
String(hours);
String rightNow;
int temp_humi = DHT.read11(DHT11_PIN);

//reads in sensor values once per main loop iteration
int sensorVals[6]; //array to store sensor values
for (int i; i < sensorLen; i++){
 sensorVals[i] = analogRead(sensors[i]);
 delay(analogDelay);
}

//Get current time in HH:MM format
rightNow = rtc.getTimeStr(FORMAT_SHORT);

//Grabs hours then converts to integer for basic hour resolution light timing 
hours = rightNow.substring(0,2);
int hours_int = hours.toInt();

//Checks time and controls lights
if (hours_int > startTime and hours_int < endTime) 
{
  digitalWrite(lights,HIGH);
}
else 
{
  digitalWrite(lights,LOW);
}

//output to serial monitor for debugging
Serial.println("sensor values: ");
for (int i=0; i < sensorLen; i++) {
  Serial.println(sensorVals[i]);
}


//LCD panel
//loop through sensor values and warn if particular plant needs watering. 
for (int i=0; i < sensorLen; i++){
if (sensorVals[i] < 400){
lcd.setCursor(0, 0);
lcd.print("Moisture");
lcd.setCursor(8, 0);
lcd.print(i);
lcd.setCursor(9, 0);
lcd.print(": ");
lcd.setCursor(11,0);
lcd.print(sensorVals[i]);
lcd.setCursor(0, 1);
lcd.print("Needs Water!");
delay(lcdDelay);
}
else {
lcd.setCursor(0, 0);
lcd.print("Moisture");
lcd.setCursor(8, 0);
lcd.print(i);
lcd.setCursor(9, 0);
lcd.print(": ");
lcd.setCursor(11,0);
lcd.print(sensorVals[i]);
lcd.setCursor(0, 1);
lcd.print("Time: ");
lcd.setCursor(6, 1);
lcd.print(rightNow);
delay(lcdDelay);
lcd.clear();
   }
}
//Display temp and humidity after outputting sensor vals
lcd.setCursor(0, 0);
lcd.print("Temperature: ");
lcd.setCursor(12, 0);
lcd.print(DHT.temperature);
lcd.setCursor(0, 1);
lcd.print("Humidity: ");
lcd.setCursor(10, 1);
lcd.print(DHT.humidity);
delay(lcdDelay);
lcd.clear();

}

Credits

London Dobbs

London Dobbs

0 projects • 21 followers

Comments