Automate the garden

Showing some more love to introducing my self and thanking all the ones who welcomed me :smiley: this is my current project to automate the garden

so far

35$ raspberry pi
15$ worth of material from home depot including the outlets.
8$ relay board
2.12$ according to my calculations some leftover computer power supply wires from old dead desktop computers…

if all goes well ill post up a better schematic :smiley:

28 Likes

Welcome @ct2003viper! I’m new too and been playing around with the Arduino for controls. I’m new to it but it’s been fun. Looking forward to seeing more of your setup.

3 Likes

Hello and welcome to OG!

Nice DIY build! It deserves its own topic…

I’ve moved your uploads to our server. Please preferably upload pics directly to Overgrow. See howto here:

5 Likes

Im very interested as well. What exactly are you automating - lights, humidity, heat, PH, EC, or?

Is the arduino acting as a timer or does it process sensor data or?

Are the outlets running 110 volts AC or some DC voltage or?

Whats the white plastic thingy with the vent holes?

How about the red gizmo with the two wires recessed into the right side wall?

Curious minds etc etc :slight_smile:

5 Likes

I think the plastic thingy may be a humidity/temp sensor :+1: it looks very much like the sonoff th16 sensor
https://www.ebay.co.uk/p/A099-Th16-th10-Smart-Sensor-Switch-Sensors-Controller-Home-Kitchen-for-Sonoff/11027315037?iid=273621876900&chn=ps&ul_ref=https%253A%252F%252Frover.ebay.com%252Frover%252F1%252F710-134428-41853-0%252F2%253Fmpre%253Dhttps%25253A%25252F%25252Fwww.ebay.co.uk%25252Fp%25252FA099-Th16-th10-Smart-Sensor-Switch-Sensors-Controller-Home-Kitchen-for-Sonoff%25252F11027315037%25253Fiid%25253D273621876900%252526chn%25253Dps%2526itemid%253D273621876900%2526targetid%253D594652337200%2526device%253Dm%2526adtype%253Dpla%2526googleloc%253D9046779%2526poi%253D%2526campaignid%253D1660961680%2526adgroupid%253D69691738931%2526rlsatarget%253Dpla-594652337200%2526abcId%253D1140486%2526merchantid%253D6995734%2526gclid%253DCjwKCAiAyMHhBRBIEiwAkGN6fB9tVFF0H_H1o8P453DAM3g3pdZeRg2FY9s2KPIvoAevWNZQQZ--XRoC4ZcQAvD_BwE%2526srcrot%253D710-134428-41853-0%2526rvr_id%253D1807266798199%2526rvr_ts%253D1d725a751680ab455fd1cb13fffbc20b

4 Likes

Thank You @LemonadeJoe

@anon32470837 yes hopefully if all goes well this will be able to read Temp,Humidity,CO2,possibly release CO2 from a canister that would be epic … currently i have lighting and watering running smoothly via a crontab but i believe there is better ways in programming the lighting and watering system… I think PH & EC should be handled by human… they have sensors online of them but who knows how long they last in water… and that little gizmo is the male plug for the extension cord :smiley:

@Hashtree im right there with you on this i followed this page python on facebook and a few guys on a discord channel and what i can say is there helpful yet not lol none will help you code on there… just guide you in a direction to help you fix it currently i have to learn about tuples and how to access one for reading… smh im more of your avid mechanic that fixes no start issues not a programmer next step is Craigslist lol

7 Likes

I’ve had really good luck hiring programmers/devs/artists on Fiverr. It might be worth a shot :slight_smile:

5 Likes

no joke i checked them out last night starting at 5$ to talk business and prices goes up… anyhow the temp monitoring system now is working properly so far!

2 Likes

now the relay turns on and off when temp is 63=on
77=off

4 Likes

That box is a great idea to contain everything. The arduino was overwhelming at first but the more projects I tried the more it made sense. If you got the temp controls figured out I’m sure the other controls will fall into place as well.
looks like your making progress!

3 Likes

Where moving right along with the project took a break from it but Im just concerned with my wiring I’m using 16g wire because that’s the only one that fits the relays… but they handle 10Amp so that’s the baseline we have as far as drawbacks… I’m going to see if they have some beefer relays online… I believe if I’m not mistaken to my calculations if there is an electrician in here let’s confirm this…

Maybe 3 315s on one relay ?

3 Likes

Ok guys it’s been a while since I posted and not much progress on this project but here is a starter kit of parts you would need for the project…
So far, I have it programmed

Lights on and off one relay is
12Hr = pin 15 ---- SleepTimeL = 43200 Seconds
18Hr = pin 14 ---- SleepTimeL = 64800 Seconds

To edit the rest of the scripts you apply the same concept to the rest of the scripts to adjust time on and off also temperature remember that the temp is in Celsius so convert to F if that’s your standard.

Open python editor the part where the script says SleepTimeL = XXXXX import your time in Seconds for how ever long you want the relay to run for.

Watering schedule pin = 18
Mon, Wed, Fri for 300Sec = 5minutes always can be adjusted.

Temp Control pin = 4
Temp1 = on
Temp2 = off
You will edit these settings in python editor

Shopping List for amazon :slight_smile:

Relays

Raspberry pi

https://www.amazon.com/Raspberry-Pi-RASPBERRYPI3-MODB-1GB-Model-Motherboard/dp/B01CD5VC92/ref=sr_1_3?s=pc&ie=UTF8&qid=1548648535&sr=1-3&keywords=raspberry+pi+3

5v micro USB charger if you got a phone charger don’t bother buying one. Will work fine

MicroSD Card

GPIO Wires & Breadboard

Temp/humidity Sensor

5 Likes

Here is a zip file of all my scripts so far upload into home folder on raspberry pi. More info coming soon on how to trouble shoot issues.
https://ufile.io/bc6lo

6 Likes

Cool, thanks for posting the script. I just bough a pi so I can confuse myself now that i have the arduino down. I haven’t had a chance to try it yet but when I bookmarking this to come back to.

2 Likes

well Hash if it makes you feel any better i still get confuzzled with the pi i currently am looking to take a try with arduino seems a little easier than this i dabbled with it with my old 3d printer…

3 Likes

Thank you @ct2003viper any chance you have any updates to your setup or is this all working out. Really starting to look into this as a viable way of maintaining more plants with less attention lol.

1 Like

@Enjoi802 No nothing yet. Only thing I have done was got it to work in Fahrenheit opposed to Celsius… still on the drawing board i need to find someone good with programming a GUI interface so we can seamlessly adjust settings without editing code for the ones not tech savvy also make a backup end where it will always upload any crash reports so it can start where it left off… Using crontab works but not fail safe. My vision is to have a main box we work from that controls other small controller boxes on the network… so we can monitor multiple rooms :smiley:

import sys
import Adafruit_DHT
import RPi.GPIO as GPIO
import time


# initialize GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18, GPIO.OUT)        
relay = 18

# read data using pin 4
sensor = Adafruit_DHT.DHT22
pin = 4

# set temps
temp1 = 67.9
temp2 = 72.0

#pull data from sensor

while True:
time.sleep(5)
instance = Adafruit_DHT.read_retry(sensor, pin)

Temp = instance[1]
Temp = (Temp * 9 / 5) + 32

print (Temp)

                     
if Temp <= temp1:
GPIO.output(relay, GPIO.LOW) # on
print("turning on relay")
                 
if Temp >= temp2:
GPIO.output(relay, GPIO.HIGH) # out
print("turning off relay")


# Reset GPIO settings
GPIO.cleanup()
4 Likes

Hello, I’ve reformatted your post. Check out MarkDown syntax for better formatting… Basic Syntax | Markdown Guide

3 Likes

Well anyhow boys and girls we are under way just paid a programmer couple bucks to Nigeria and man progression! The guy I found absolutely great we are going to implement next a time-laps so we can see the lady’s get big :smiley:. So long story short this man is working in conditions of power outages every couple hours i got pictures of him buying gas at the gas station there for the Generator btw 30cents a Liter … He is using internet Hot-spot on cell phone to his laptop to communicate with me via Teamviewer and using VNC to tie into the Raspberry pi Truly amazing how we can perform these thing’s. The conditions he has to go threw on a daily amazes me. Trying to keep you guys up to date with everything :heart:

6 Likes

hey mate… congrats on your progress… im doing similar thing, but im going for multiple arduinos inside growbox (nodes), connected to one main esp32 (switch), and for multiple growboxes and room where they would be (more nodes) i would have one router - raspi - to have www control… im utilizing many open source projects, like PJON protocol for communication: https://www.youtube.com/watch?v=yPu45xoAHGg, DRO-Matic for nutes controll: https://www.youtube.com/watch?v=GlZHTMk3PBg, Mycodo for overall control: https://www.youtube.com/watch?v=nyqykZK2Ev4, and of course Adafruit libraries for sensors, Matlab channel for process control explanation: https://www.youtube.com/watch?v=ApMz1-MK9IQ, basically all i could get my hands on to make a solid product… i first made whole thing on Blynk platform: https://blynk.io/, which is very powerful platform to make IoT devices with nice mobile app, but since they pushed more of their business side, and less open source, and then released 2.0 version only for businesses, i went for different route, and to remake most of my things, and have offline interface via nextion screens and online via webpage, not an app… im nowhere near a programmer, im still on basic level of c++ and web languages, im electrician and am handy with tools, so i approached this with grow room design first, and then searched for solutions, and since there were many setbacks, and not enough knowledge (of control processes, desing of user friendly UI, grow room setup in general), i put my project on hold and decided to research the shit out of it until i go back to code… but i have a ton of info, some i already put here, other i can find for you, and share my experience working with arduino… ive mostly used arduino nano, cause its cheap, and there is ton of libraries for various sensors, but it has its limitations (8 bit controller with floating point simulator, so its very slow with lets say VPD calculation, which ive outsourced to my esp32), and arduino mega (handles 30 sensors without a sweat, but still 8 bit controller), so if you have a questions feel free to ask! also, about ph readings, youre right about probe being submerged, it has to be scientific grade to be allowed to be constantly submerged in a solution, and Atlas Scientific had one for 200$ (probe only, signal board is about 40$), but since many hydro users needed something less powerful but still resilient, they made cheaper probes with lesser resolution, consumer grade one has resolution and accuracy of +/- 0.1 and its 40$: https://www.atlas-scientific.com/probes/consumer-grade-ph-probe/ and their lab one has resolution and accuracy of +/- 0.002 and its 80$, both can be submerged in a solution indefinitely… hope this helps you and gets you some good reading material, have fun and happy growing! <3

Edit: example pic of Blynk

6 Likes