Page 1 of 5 1 2 3 4 5 LastLast
Results 1 to 10 of 44

Thread: Automated growing using Raspberry Pi

  1. #1

    Join Date
    Dec 2012
    Posts
    469
    Thanks
    112
    Been Thanked: 279 Times

    Default Automated growing using Raspberry Pi

    Hi, I have a mini cab which I've had some success with in the past. I'm now improving the cab design by making it more automated by using some electronics and an old Raspberry Pi model B, which has been kicking around gathering dust for a few years now.

    I have none to little experience of the Python programming language, which I will be using to program to sense temperature, humidity and control the lights and fans with, however, I do have experience with other programming languages, so Python shouldn't be too hard for me to pick up.

    I have studied a couple of other posts that discuss Raspberry Pi automated grows, here are the links. I am using these as a base for my build.

    Automated Raspberry Pi Growing Monitor

    Raspberry Pi Automated Growing

    I have purchased some equipment to build a control box with, here is a list of what I have:

    1x Raspberry Pi model B
    micro USB power supply
    8gb SD card
    Network cable
    HDMI cable
    USB wireless keyboard/mouse
    1x 4 Ralay module
    1x Temperature & humidity sensor
    Female-Female jumpber cables

    Hammond ABS Enclosure 221x150x64
    2x C13 IEC Chassis outlets
    2x C13 IEC Straight cable sockets
    2x C14 IEC Straight Cable plugs
    1x C14 IEC Fused and switched Inlet
    5x 2.5mm x 5.5mm Male & Female Panel mount socket jacks
    1x 3-Pin DIN Panel mount socket & plug connector
    5x 4 way Wago push connectors
    26 AWG PVC stranded wire 7/0.16mm

  2. The Following 8 Users Say Thank You to Craigjw For This Useful Post:

    Bogsmokefarm (03-07-22), BornToBeAgrower (27-02-18), ERBURT (25-08-17), JamesJoyce (25-08-17), joker_the_smoker (24-08-17), kbag (24-08-17), M_C (24-08-17)

  3. #2

    Join Date
    Dec 2012
    Posts
    469
    Thanks
    112
    Been Thanked: 279 Times

    Default

    Here is the equipment set out neatly, for you to get an idea of what I have procured.

    Click image for larger version. 

Name:	IMAG0005.jpg 
Views:	117 
Size:	41.1 KB 
ID:	350014

    Click image for larger version. 

Name:	IMAG0006.jpg 
Views:	108 
Size:	51.1 KB 
ID:	350015

    I have cut out sections of the encasement to fit the various sockets and plugs

    Click image for larger version. 

Name:	IMAG0008.jpg 
Views:	96 
Size:	18.2 KB 
ID:	350016

    And here's what they will eventually look like

    Click image for larger version. 

Name:	IMAG0009.jpg 
Views:	102 
Size:	29.1 KB 
ID:	350017

  4. The Following 5 Users Say Thank You to Craigjw For This Useful Post:

    BornToBeAgrower (27-02-18), EaZiE (24-08-17), JamesJoyce (25-08-17), kbag (24-08-17), M_C (24-08-17)

  5. #3

    Join Date
    Mar 2009
    Posts
    62,192
    Thanks
    177,576
    Been Thanked: 196,884 Times

    Default

    I'll be keeping an eye on this
    It's Not What You Know, It's What You Can Prove

  6. The Following User Says Thank You to M_C For This Useful Post:

    Craigjw (26-08-17)

  7. #4

    Join Date
    Dec 2012
    Posts
    469
    Thanks
    112
    Been Thanked: 279 Times

    Default

    Here's some basic Python that describes how to control the Relay. I'm using the GPIO ports 02, 03, 04 & 17.

    import RPi.GPIO as GPIO
    from time import sleep
    GPIO.setmode(GPIO.BCM)

    #set relay pins as output
    GPIO.setup(02, GPIO.OUT)
    GPIO.setup(03, GPIO.OUT)
    GPIO.setup(04, GPIO.OUT)
    GPIO.setup(17, GPIO.OUT)

    while(True):
    #turn all relays ON
    GPIO.output(02, GPIO.HIGH)
    GPIO.output(03, GPIO.HIGH)
    GPIO.output(04, GPIO.HIGH)
    GPIO.output(17, GPIO.HIGH)

    sleep(5)
    #turn all relays OFF
    GPIO.output(02, GPIO.LOW)
    GPIO.output(03, GPIO.LOW)
    GPIO.output(04, GPIO.LOW)
    GPIO.output(17, GPIO.LOW)

    sleep(5)
    Last edited by Craigjw; 24-08-17 at 07:50 PM. Reason: typo

  8. The Following 3 Users Say Thank You to Craigjw For This Useful Post:

    JamesJoyce (25-08-17), M_C (24-08-17)

  9. #5

    Join Date
    Dec 2012
    Posts
    469
    Thanks
    112
    Been Thanked: 279 Times

    Default

    Here's some basic Python that describes how to monitor the Temperature and Humidity sensor. This was using GPIO port 02.

    import sys
    import Adafruit_DHT
    import time
    import json

    sensor = Adafruit_DHT.DHT11
    pin = 02
    while True:
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
    data = {'humidity':humidity,'tmperature':temperature}
    print(humidity,temperature)
    print 'Temp: {0:0.1f} C Humidity: {1:0.1f}%'.format(temperature, humidity)
    time.sleep(2)
    Output is received every five seconds, a sample is shown below where I breathed on the sensor:

    Temp: 24 C Humidity: 64%
    Temp: 25 C Humidity: 64%
    Temp: 28 C Humidity: 76%
    Temp: 28 C Humidity: 78%
    Not sure if I need the json import at the top, will remove & test this at a later date.
    Last edited by Craigjw; 24-08-17 at 07:53 PM. Reason: comment

  10. The Following 3 Users Say Thank You to Craigjw For This Useful Post:

    EaZiE (24-08-17), JamesJoyce (25-08-17), M_C (24-08-17)

  11. #6

    Join Date
    Jan 2017
    Location
    Paradise City
    Posts
    1,577
    Thanks
    1,898
    Been Thanked: 4,816 Times

    Default

    I am interested in this but have very little knowledge of programming. I just wonder can this system play with fan speeds also?


    Stumblin' in the neon groves
    A man chooses, a slave obeys!

  12. The Following User Says Thank You to JamesJoyce For This Useful Post:

    Craigjw (26-08-17)

  13. #7
    Bulls Guest

    Default

    I have 0 idea what are you doing but sounds interesting . I will keep an eye

  14. The Following 5 Users Say Thank You to Bulls For This Useful Post:

    Catch_E_Monkey (02-11-17), Craigjw (26-08-17), dynodave (26-08-17), ERBURT (25-08-17), M_C (25-08-17)

  15. #8

    Join Date
    Dec 2012
    Posts
    469
    Thanks
    112
    Been Thanked: 279 Times

    Default

    Quote Originally Posted by JamesJoyce View Post
    I am interested in this but have very little knowledge of programming. I just wonder can this system play with fan speeds also?
    I have looked into this and I don't think it's so easy for 2 reasons; current draw and availability.

    If a variable voltage resistance is applied to the circuit, it needs to be able to handle the current draw, if it's not enough, it will melt. ie, the speed controller needs to be properly rated. Perhaps someone can elaborate on this better than I can. When I first created my cab with pc fans, i attached a pc fan controller, however, controlling 6 pc fans caused the controller to melt in under a minute.

    I can't find a digitally controlled speed controller with a suitable rating that will handle the current draw, most of the ones available are rated too low or are only manually adjustable.


    A circuit using some form of MOSFET maybe the way to achieve this, but I don't know enough about electronics to be able to design/build it and also guarantee it wouldn't melt.

    If anyone has electronics knowledge enough to design a circuit that would be suitable, please let me know.

  16. The Following 3 Users Say Thank You to Craigjw For This Useful Post:

    JamesJoyce (25-08-17), M_C (25-08-17)

  17. #9

    Join Date
    Dec 2012
    Posts
    469
    Thanks
    112
    Been Thanked: 279 Times

    Default

    Quote Originally Posted by Bulls View Post
    I have 0 idea what are you doing but sounds interesting . I will keep an eye
    I'm building a box that will control the following:
    -When the lights turn on & off, which include an LED & CFL
    -When the fans turn on & off
    -When it waters the plant
    -Monitors the temperature & humidity.

    The box will have programming in it to switch on & off the lights depending on the temperature, if it gets too hot, it'll turn off the CFL, if it gets way too hot, it'll turn off the LED also. It will also keep a log of all of the above.

  18. The Following 2 Users Say Thank You to Craigjw For This Useful Post:

    M_C (25-08-17)

  19. #10
    Bulls Guest

    Default

    Seems a bit pointless to me for a small grow..no offense just my thinking.
    It is not any different from running your fans and heater though a controller and stick a watering pump with couple of drippera on a timer? Set your controller to max/min on the extraction/intake and the desired temp and humidity and you won't have to worry about switching the lights off?

  20. The Following 2 Users Say Thank You to Bulls For This Useful Post:

    Craigjw (26-08-17), M_C (25-08-17)

Page 1 of 5 1 2 3 4 5 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


THCtalk.com Disclaimer - You must be over 18 years old to view/use this site .THCtalk.com does not encourage growing Cannabis or possessing Cannabis. Learning how to grow Cannabis instructions should be for educational purposes only. All Information contained in this web site is for: Historical reference, Scientific reference and Educational purposes only. Visitors to this website are advised against breaking the law as It is illegal to smoke, grow, or possess cannabis in the UK and some US States