Automate the garden

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.

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… https://www.markdownguide.org/basic-syntax/

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

I’m curious… did the resurrection of the thread make you decide to move forward, or was it just pure coincidence? This thread was dead for over a year lol.

Pretty cool how you’re tinkering around with automating and sharing your scripts n such. Way outside of my abilities currently

2 Likes

@vo_o that’s looks awesome man currently using node-red on the raspberry to tie everything together it’s designed in such a way anyone can do it I’m trying to find someone that can laser cut me some enclosures so I can get this one all finished up … but yeah I definitely want to pick your brain on a few things on this… As far as like a

10A relay
I presume we can run
2 315cfl bulbs
1 600w MH
1 600w HPS
I’m using 16G wiring into the relays I want to build this to be spot on with like UL standard so there is no issues with her while AFT
AFT = away from tent lol

3 Likes

@ChronicMcBudz yes very very long painstakingly process so currently I have cleaned up wiring and soldered my connections solid

So basically original design back to the original design lol I guess I was overthinking the project :joy:

3 Likes


Prototype 2


Prototype 3

4 Likes

Very nice work, vo_o. I’m starting to suspect that you have a significantly larger range of knowledge and skill based on your description than you’ve been letting on. “nodes”, “Matlab”, “worried about dynamic range”, etc… This is some serious deep diving and integration…humble to boot. Beautiful work.

3 Likes

you can quickly do the math with watts and gauge like this (i presume youre american, by the gauge measure of wires):

power = voltage x amperage (current)
max power for that relay = 120V x 10 = 1200W or 1.2 kW

your demand = 2 x 600 watts + 2 x 315 watts = 1830 watts

my recommendation = 2 relays, on each 1 600w and 1 315w lamp, so total is 915w and safe under max 1200w of power that relay can take… if those are lights for different rooms, so spacially your 600w and 315w lights are divided by some distance, i would put 600w on each relay to avoid putting 2 x 600w lamps on relay (maxing out), and 2 x 315 on one, so in total 3 relays… always rate your fuses and relays to be higher than you need…

about wire, eh, you americans are special… you will see numbers as low as 3.7 amperes, but that is over conservative imho, and here i found this chart: https://www.engineeringtoolbox.com/wire-gauges-d_419.html that says 15 A which has more sense for me, but if you can tell me from what state you are i can find the right gauge needed… anyway, if we follow that last number, which is also around same number that is used in Europe standards, you can use that wire for devices up to 1800w, but again, that is maximum, and i would recommend keeping this up to 1500w… how does this help you? well, for your total power usage, you need at least 2 power outlets (check edit), and to have 2 relays, on each 1 x 600w bulb and 1 x 315w bulb, or, you have 3 relays, on one outlet 1 relay with 1 x 600w, on second outlet 2 relays, one has 1 x 600w and other one has 2 x 315w bulbs… does this make sense? if you can tell me how you will power this (how much outlets you have), i can make a diagram for you and give you some tips with wiring (if you have only one color, you can still use it, but you have to mark each positive and negative etc.)

edit: i just saw your rig, give me a sec to check it out… i was wrong about outlet number, somehow got mixed up in my head about it, i would need to know what is maximum power draw trough your outlet, maybe you can draw all the power from one if your circuit supports it, but you would need to go to your breaker room and find the one for the room and outlet youll connect it to, so i can tell you more…

edit nr. 2: ok, like that you have 4 relay board, im gonna draw something fast…

4 Likes

I’d like to suggest to those who are doing the serious DIY in the embedded space to take a look at Nvidia’s Jetson offerings, as well. These are next level up. They would take a bit more effort at integration.

But they also open up a range of possibilities and have significantly greater compute power than the arduinos and PI’s of the world. Combine this with the ‘node’ concept and you have a whole new world of flexibility.

Here’s a new term to consider, sensing “motes” then onto “smart motes”…

4 Likes

i know right, it makes me itching for AI, computer vision, and all that, but even what i want is kinda out of my scope, maybe for next milestone… :slight_smile: <3

2 Likes