Simple, Scalable Raspberry Pi Garden Irrogation

15K1004

Intro: Simple, Scalable Raspberry Pi Garden Irrogation

This is one of the projects I'm currently working on. The idea behind the project is to build a simple yet scalable and eficiant garden irrogation, using as little resources as posible.

The end product will be a IOT garden project, but I'll update you as i go.

STEP 1: List of Parts

1 x Raspberry Pi with raspbian installed

1 x Drip irrigation kit

n x Relays

n x Moisture sensors for Arduino, we will use thair digital output.

n x Solanoid valves or water pumps

*n x - If you use more valve/sensor pairs your irrigation will be more eficiant.

STEP 2: The Python Code and GPIO

https://github.com/VBranimir/GardenPIO/blob/master/gardenpio.py

Read the code, it's simple and short.

Change GPIO pins or just add more if you need.

# Set up GPIO pins:

sensor=[27,22,23]

sensorPow = 18

pump=[17,24,25]

# Schedule irrigation function to be run on every day 7 and 22 o'clock, you cen edit or add more times but keep in mind that the more you reed the sensor, the faster it will oxidate.

sched.add_job(irrigation, 'cron', hour='7,21')

Raspberry has no Real Time Clock so it has to be connected to the internet to keep track of time in this case.

STEP 3: Connecting It All

Here are a few notes on connecting the project:

1. Do not put the sensor to near to the irrigation nozzle.

2. Be careful around the highvoltage AC and isolate the relays from the rest of the project.

3. Becouse Raspberry has no analog inputs you can use digital output pin (DO) on sensors controller. The controller has a neat treshold regulator and labeled on the image.

Other options include analog/digital converters and arduino/avr microcontrollers, but i won't use them this time.

3 Comments

Is there a schematic for the circuit?

Nice and simple :)

Mind you, take a look at the code. It seems you are powering down sensors after the 1st one finishes, and IMO, that is not what you wanted to do.

The line 34:

GPIO.output(sensorPow, 0) #sensor power down

should be outside of the for loop to power down the sensors after all the readouts (and pumping) has finished.

Tnx, I'll give the code a revision!