Growing plants in water: an automated approach.

Prior Art

Parts List

part manufacturer cost quantity total interface Python Library description
SEN0219‎ DFRobot $59.74 1 $59.74 analog (0.4-2V) ADC infrared CO2 sensor board
DS18B20‎ Maxim Integr $3.06 5 $15.30 1-wire DS18X20 digital temperature sensor
101-70-103 SainSmart $14.99 1 $14.99 16xTTL 5V DigitalOutputDevice 16 channel relay module; 250V 10A
SEN0137 DFRobot $9.79 1 $9.79 analog (0-3V) Adafruit_Python_DHT DHT22 temp/humidity sensor board
TSW-10 Amphenol Adv $7.70 1 $7.70 analog (0-Vcc) ADC turbidity sensor1
DFR0151 DFRobot $4.53 1 $4.53 I2C N/A2 RTC module
AD7150BRMZ Analog Dev $3.88 2 $7.76 I2C None Capacitance-to-Digital chip
161‎ Adafruit $0.95 3 $2.85 analog (0-Vcc) LightSensor photocell
TSL2591 Adafruit $6.95 1 $6.95 I2C Adafruit_TSL2591 digital light sensor
BME680 Adafruit $22.50 1 $22.50 I2C/SPI Adafruit_BME680 Temp/humidity/pressure/gas sensor
BME280 Adafruit $19.95 1 $19.95 I2C/SPI Adafruit_BME280 Temp/humidity/pressure sensor
MCP3008 Microchip Tech $2.26 2 $4.52 SPI ADC 8 channel ADC
MCP23017 Microchip Tech $1.24 1 $1.24 I2C/SPI Adafruit_MCP230xx 16-bit I/O Expander
MCP4725 Adafruit $4.95 1 $4.95 I2C Adafruit_MCP4725 12-bit DAC
SGP30 Adafruit $19.95 1 $19.95 I2C Adafruit_SGP30 MOX based VOC meter
4K7 resistor Stackpole $0.49 10 $4.90 Pull up resistor for I2C connections

Required Packages

Work Log

21 Aug 2019

DIY Rooting Hormone Gel

I started with this formula but used the potassium salt of indole-3-butyric acid instead of IBA. I also wanted a higher concentration of IBA (90mM) because of a paper on cloning walnuts suggested a higher concentration was better (Stevens and Pijut 2017).

20 Aug 2019

Built an ultrasonic cloner today.

I have several hydroponic tests in the works and I want a stable line of plants to compare the results.

22 Mar 2019

Looked into growing specialty crops in aquaponic/hydroponic systems. Saffron would yield $1-2 per square foot in 3-4 months. Definitely not worth the labor.

FarmerTyler Blog

Cross-flow filtration for removing solids in aquaponics?

21 Mar 2019

Q&A Aquaponic Pumps | Youtube - recommends 400lph pump with a ceramic shaft for each grow bed or siphon. This pump seems to fit.

How to mix Masterblend 4-18-38 Hydroponic Solution

Worked on the nutrient analysis spreadsheet.

18 Mar 2019

Python web servers? Flask? - nice and simple; plus its templating mechanism uses liquid tags which I have experience with

Python Flask from Scratch | Youtube: A very thorough walkthrough.

17 Mar 2019

Bell’s Siphon for a modified ebb and flow system: Build instructions for a snorkel type siphon for adjustable minimum height (Fox, Howerton, and Tamaru 2010).

PEX or PVC? I’m not worried about leaching, but biofouling in PVC is greater than in PEX. Since my system is designed for indoor use, I’m not worried about UV either. Biofouling in ocean water: LDPE < HDPE < PP (Sudhakar et al. 2007).

Place the venturi before the intake of the water pump. That way the bubbles are broken apart by the rotor.

If I have a single grow bed of dimensions 2’x3’x1’, a 1/2" drain pipe siphon should be sufficient. If we assume 60% fill density of LECA (just a guess), then the water required to fill the grow bed is about 15 gal. I want that volume to be replaced every 15-20 minutes (Fox, Howerton, and Tamaru 2010). That means my pump has to move 45-60 gallons per hour (170-230 lph). If we assume a 25% loss of pressure due to the venturi (just a guess) and an extra 50% because restriction is easy, the total flow rate for my pump should be 320-430 lph (115 gph) at a height of about 1 foot. The 1200 gph pump I looked at earlier is way overkill. That seems really small… I think I’m going to go for the 400 gph (~325 gph at 1 foot) version because it is the cheapest from the set of eBay pumps that has screw fittings.

The pump cannot run dry… how to prime it if it is mounted above the sump? Probably manually. That also means that if the power goes out, the siphon will slowly allow the pipe to drain and ruin the pump when the power returns. Perhaps a check valve in the sump? Or I could just run the pump submerged as is recommended. I would prefer to have it accessible and contributing less heat to the system. Or I could just mount it at or below the base of the sump.

I can’t find a consistent answer on whether PVC, cPVC, or PEX is better at handling ozone. They all bounce between “B” and “C”. This is probably fine for the low concentrations and short contact times I will be using.

Media: LECA, river pebbles, lava rock, basalt. Since my system will be synthetic (as opposed to organic) I don’t care too much about bacteria growth surface area.

The funnel type bell siphon seems to be more reliable.

This could turn into an entire web site…

16 Mar 2019

Beaglebone or raspberry pi (or arduino)?

Beaglebone uses the Adafruit BBIO library which is less developed than the raspberry pi version. The two might be adapted, however. BB is more powerful, which I like, but it isn’t necessary. BB is more expensive (+$20) but has more GPIO pins.

Adafruit has done a lot of the heavy lifting for product and software development. Given the opportunity, I will be purchasing from them even if it costs a bit more.

I think I have decided on Raspberry Pi. It has the most support and has all the capabilities I need. The clock issues are solved by using a RTC module. The lack of pins isn’t an issue because a GPIO expander can be used. I/O for a hydroponics controller doesn’t need to happen quickly so multiplexing the expander isn’t an issue.

Staring work on the Raspberry Pi programming by using an emulator on my Ubuntu machine. Instructions. I didn’t need to follow the network bridge part because mine worked out of the box.

15 Mar 2019

A nice PID class in python which could be useful for control electronics. Or a PyPi PID package

Touch screen or buttons?… Or android app…

I2C extender - since I2C is limited to about 1 meter.

I like the idea of using the arduino as a pin-out board with the raspberry pi doing the heavy video and network lifting. Plus I get to use python instead of C++ for all the real work. Although, the Pi does seem to be capable of running the entire system by itself.

A pin expander could be used for additional space if 10 (26 total) digital pins isn’t enough. You will need to get an ADC for so many sensors. This is only a few dollars for 8 channels.

Also… using RJ-11 connectors for remote sensors is an excellent idea. They are sooo cheap.

DIY or Buy: Peristaltic Pump | YouTube. The “buy” peristaltic pump that the channel GreatScott compares to the “DIY” version is significantly more expensive than the ones I have found and offer 80ml/min. His DIY version is based on this design on Thingiverse but with a NEMA 17 stepper. A major downside of that design is the heat generated by the motor tends to overheat PLA.

Looking into using cheaper pH and EC probes for the DRO-Matic.

Single vs. Double junction pH probe. Double junction probes have an extra compartment to slow ion infiltration that ultimately destroys the probe. Slower infiltration: longer life. Especially when it comes to complex mineral/organic solutions like in hydroponics. Therefore, a double junction probe is recommended for hydroponic use.

A gel filled probe is cheaper, but again, doesn’t last as long. A liquid probe can be filled again and again with new solution essentially making the probe last forever.

Since the DRO-Matic system is built to use BNC connectors and has built in calibration, any pH meter can be used. You don’t have to buy the really expensive ones. Double junction probes are recommended and can be bought for around $40.

The creator of the DRO-Matic says that he was having trouble with interference between the pH and EC probes. He suggests that buying the Atlas Scientific tentacle and EZO circuits is the only way to solve this problem. I believe the secret is not in some “electrical isolation”, but serial rather than parallel measurements. Basically the system only checks each probe once per second in a staggered manner so they don’t interfere. One could certainly program that into the arduino, bypassing the issue (and cost) altogether.

RTC for the Pi

14 Mar 2019

Hold Everything!!! I found the answer.

Electrolysis for oxygen generation? I really don’t like this presentation because it is a sales pitch. He talks about a lot of things that aren’t related. At one point he just says, “It’s technical science… It’s compelling science…. Microbes.” What a joke. Anyway, that doesn’t mean there isn’t science behind the tech.

Electrolysis is supposedly capable of a 50% boost to oxygen concentrations (12 mg/L vs. 8 mg/L). Would it be worth it? One problem is the production of CO2. Without the significant air flow and mixing provided by a bubbler, excess gasses cannot be removed from the boundary layer just above the reservoir. So it seems that you would need to purchase an electrolysis system in addition to your existing bubbler.

So the question becomes: Does higher DO concentrations compensate for the additional cost of an electrolysis system?3 Furthermore, I can’t imagine that direct exposure of root systems to a voltage field is entirely nonreactive.

It appears that plant susceptibility to low dissolved oxygen concentrations is plant, growth stage, and end-point specific. Lettuce can tolerate 2mg/L without adverse affects on root growth or sprouting (Goto et al. 1996). Tomatoes were taller and leaves had higher chlorophyll content in 40mg/L DO water but had negatively impacted weight, leaf area, and stem diameter. (Zheng, Wang, and Dixon 2007)

It is suggested that it was safe to enrich root zone DO to as high as 30 mg L−1, although the growth benefit was minor by increasing DO from ambient air saturated level (∼8.5 mg L−1) to 30 mg L−1. Higher than 30 mg L−1 could cause reduction in tomato plant growth.

Cucumber production was unaffected by elevated oxygen concentrations. Researchers did note that shelf life was increased possibly due to enhanced antioxidant production. Again, oxygen concentrations above typical ambient levels (~8mg/L) is probably not worth the effort. (Ehret et al. 2010)

Ajoene content of garlic was negatively impacted by only oxygenating the nutrient solution 12-hours per day (nighttime oxygenation worse than daytime) compared to 24-hour oxygenation (Naznin et al. 2010). An interesting side note is that the roots contained ~80% the ajoene content of the bulbs. The maximum DO concentration was ambient (8 mg/L).

Ozone in the hydroponic reservoir doesn’t seem to impact plant development (maybe advantageous for antioxidant production) but can significantly reduce pathogenic bacteria. (Graham, Zhang, and Dixon 2011) (Chan et al. 2007) Use of 3.0mg/L ozonated water is recommended for mineral wool based systems (Graham, Zhang, and Dixon 2012).

Ozonated water is mildly effective at controlling powdery mildew without damage to plants (Fujiwara and Fujii 2002)

Here’s an interesting approach to pH manipulation using electrolysis (Spinu, Langhans, and Albright 1998). Only 5W was needed to control the pH of a 12 sq. meter lettuce raft system. The loss of positive ions is a little disconcerting, however. Perhaps that is why this kind of system was never researched again.

I really hate when a research paper is full of grammatical errors and it still gets accepted for publication. (Saaid et al. 2013)

A 7" capacitive touch screen for a raspberry pi would be an excellent way to display data. I still think arduino is the better choice for direct communication with sensors. A system like this. Here’s a project that runs lights and a pump directly from the raspberry pi GPIO pins. Another

13 Mar 2019

Looking at automation equipment choices: air/water pumps, venturi, air stones, etc.

Degassing tower: would solve the dissolved CO2/pH issue but add significant humidity to the air. (Pattillo 2017)

What about spectrometers for measuring nutrient concentrations and even plant growth? (Pavlovic et al. 2014) (Shibghatallah et al. 2013) Could be viable but would require significant R&D.

PEX tubing has greater chemical resistance and is easier to install. The fittings require a clamp tool (or expensive push-connectors). You can get away with using some wire dikes if you want.

Looking into cable management and connectors 2.

What size pump?

I need enough flow to work with the venturi. My vacuum aspirator requires a diaphragm pump to reach the high vacuums required. I doubt anything so drastic would be necessary here since the venturi will be mixing in atmospheric air. A simple magnetic drive pump should be sufficient.

This 4 bucket rDWC system comes with a 159 GPH magnetic drive pump. This one uses a 400 gph pump. Magnetic drive pumps can be restricted without harming the motor, which is nice. Since my system includes a venturi, those values will be low. I would prefer a non-submersible type for cleaning purposes.

Jims pond blog uses a 1600gph pump and a “1 inch venturi” and is surprised by the bubbling.

I think I will just go with a cheap 1200 gph pump and be done with it. The output looks like a 3/4 NPT so this venturi injector should do. It’s rated for “0.65-2.42m³/h 0.7-9.5bar”. Now that I look at this my 1200 gph pump might not be sufficient. It lists the pressure head at 13.0ft (5.6psi, 0.39bar). So does that mean I won’t have enough pressure? It has been too long since my fluid dynamics class…

12 Mar 2019

Syringe Pump

Update: Syringe pumps are a lot more expensive than perstaltic pumps.*

This is based on Open Source Syringe Pump (Wijnen et al. 2014). Fortunately, my local library offers free 3D printing. First, installing Lulzbot CURA software on Ubuntu 18.04:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i '$a deb http://download.alephobjects.com/ao/aodeb buster main' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install cura-lulzbot

I got an error following the installation guide saying that I needed to install a libssl package. I found a solution here. Basically it just grabs a debian 10 package (buster main) instead of the ubuntu 18 one (stretch main).

I also had to install openSCAD to work with the files from the project.

sudo add-apt-repository ppa:openscad/releases
sudo apt update
sudo apt install openscad

Capacitive Fluid Level Sensor

This DIY Fluid Level Sensor | Instructables seems like a good idea, but over constructed for my purposes. The inner, charged electrode can be any insulated wire. Preferably 12AWG solid wire for rigidity. The outer electrode can be any non reactive metal. Preferably stainless steel but copper would work.

The probe should be a centimeter or two in width and about 30cm in depth.

The capacitance-to-digital chip I found measures 0-13pF with 1fF sensitivity. That’s extremely low and won’t work for a cylindrical capacitance probe. A pair of insulated, parallel copper electrodes would work pretty well.

EC meter

$3 EC meter

Let’s look at automation. Arduino and raspberry pi are obvious choices for control.

A few arduino garden controllers use peristaltic pumps, but I would rather use syringe pumps. They are more accurate, but slower. Speed isn’t an issue for hydroponics. Equilibration of the dose with the reservoir will be an issue.

General hydroponics typical nutrient doses are less than 10ml per gallon. I’ll need to order syringes before printing the parts of the open source syringe pump. NEMA17 looks like a common stepper motor that’s relatively cheap.

Top Picks

part manufacturer cost quantity description
DS18B20‎ Maxim Integrated $3.06 5 digital temperature sensor
SEN0219‎ DFRobot $59.74 1 infrared CO2 sensor board
SEN0137 DFRobot $9.79 1 DHT22 temp/humidity sensor board
DFR0151 DFRobot $4.53 1 RTC module
161‎ Adafruit $0.95 3 photocell
TSW-10 Amphenol Advanced $7.70 1 turbidity sensor4
DFR0144‎ DFRobot $14.41 1 3A x 4 relay board
103030009 Seeed Technology $21.68 1 10A x 4 relay board
997 Adafruit $6.96 1 12V; 1/2" solenoid valve
ATMEGA328-PU‎ Microchip Tech $1.96 1 Bare arduino IC
AD7150BRMZ Analog Devices $3.88 1 Capacitance-to-Digital chip

The photocell will definitely saturate at the light levels I’m expecting (650 lux). If using multiple light sensors, one might be inclined to use an external DAC to save pins.

Air pump: rule-of-thumb 1W per gallon. Ideal water temperature for dissolved oxygen content of 8-9 ppm is 68F (source).

Appendix A

sudo qemu-system-arm -kernel ./kernel-qemu-4.4.34-jessie -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda raspbian-stretch-lite.qcow -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -net nic -net user -net tap,ifname=vnet0,script=no,downscript=no


sudo nano /etc/default/keyboard
sudo apt update
sudo apt upgrade -y
sudo shutdown -h now
sudo apt install -y python3-dev git
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --user
nano ~/.bashrc
`export PATH=$HOME/.local/bin/:$PATH`
pip3 install --user circuitpython-build-tools
pip3 install --user adafruit-circuitpython-lis3dh
sudo raspi-config

- interfacing options
    - P4 SPI
    - P5 I2C
    - P7 1-Wire
- reboot

wget https://github.com/adafruit/circuitpython/releases/download/3.1.2/mpy-cross-3.x-raspbian-stretch

wget https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/download/20190315/adafruit-circuitpython-bundle-3.x-mpy-20190315.zip

git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT/
python3 setup.py install --force-pi --user

pip3 install --user adafruit-circuitpython-DS18X20


Chan, Gilbert Y S, Yanfeng Li, Edward K H Lam, Carol Y Chen, Li Lin, Tiangang Luan, Chongyu Lan, and Peter H W Yeung. 2007. “Effects of Ozonated Water on Antioxidant and Phytohormones Level of Vegetable,” 15.

Ehret, David L., Diane Edwards, Tom Helmer, Wei Lin, Gary Jones, Martine Dorais, and Athanasios P. Papadopoulos. 2010. “Effects of Oxygen-Enriched Nutrient Solution on Greenhouse Cucumber and Pepper Production.” Scientia Horticulturae 125 (4): 602–7. https://doi.org/10.1016/j.scienta.2010.05.009.

Fox, Bradley K, Robert Howerton, and Clyde S Tamaru. 2010. “Construction of Automatic Bell Siphons for Backyard Aquaponic Systems,” 11.

Fujiwara, Kazuhiro, and Takuya Fujii. 2002. “Effects of Spraying Ozonated Water on the Severity of Powdery Mildew Infection on Cucumber Leaves.” Ozone: Science & Engineering 24 (6): 463–69. https://doi.org/10.1080/01919510208901635.

Goto, E., A.J. Both, L.D. Albright, R.W. Langhans, and A.R. Leed. 1996. “EFFECT OF DISSOLVED OXYGEN CONCENTRATION ON LETTUCE GROWTH IN FLOATING HYDROPONICS.” Acta Horticulturae, no. 440 (December): 205–10. https://doi.org/10.17660/ActaHortic.1996.440.36.

Graham, Thomas, Ping Zhang, and Michael Dixon. 2011. “Aqueous Ozone in the Root Zone: Friend or Foe?” February, 5.

Graham, Thomas, Ping Zhang, and Michael A. Dixon. 2012. “Closing in on Upper Limits for Root Zone Aqueous Ozone Application in Mineral Wool Hydroponic Tomato Culture.” Scientia Horticulturae 143 (August): 151–56. https://doi.org/10.1016/j.scienta.2012.06.003.

Naznin, M. T., Y. Kitaya, T. Shibuya, and H. Hirai. 2010. “Growth and Ajoene Concentrations in Garlic Plants Cultured Hydroponically with Different Aeration Regimes.” The Journal of Horticultural Science and Biotechnology 85 (2): 161–65. https://doi.org/10.1080/14620316.2010.11512648.

Pattillo, D Allen. 2017. “An Overview of Aquaponic Systems: Aquaculture Components,” 20.

Pavlovic, Danijela, Bogdan Nikolic, Sanja Djurovic, Hadi Waisi, Ana Andjelkovic, and Dragana Marisavljevic. 2014. “Chlorophyll as a Measure of Plant Health: Agroecological Aspects.” Pesticidi I Fitomedicina 29 (1): 21–34. https://doi.org/10.2298/PIF1401021P.

Saaid, M. F., N. A. M. Yahya, M. Z. H. Noor, and M. S. A. M. Ali. 2013. “A Development of an Automatic Microcontroller System for Deep Water Culture (DWC).” In 2013 IEEE 9th International Colloquium on Signal Processing and Its Applications, 328–32. https://doi.org/10.1109/CSPA.2013.6530066.

Shibghatallah, Muhammad Abdul Hakim, Siti Nurul Khotimah, Sony Suhandono, Sparisoma Viridi, and Teja Kesuma. 2013. “Measuring Leaf Chlorophyll Concentration from Its Color: A Way in Monitoring Environment Change to Plantations.” arXiv:1305.1148 [Physics, Q-Bio], 210–13. https://doi.org/10.1063/1.4820322.

Spinu, V.C., R.W. Langhans, and L.D. Albright. 1998. “ELECTROCHEMICAL PH CONTROL IN HYDROPONIC SYSTEMS.” Acta Horticulturae, no. 456 (March): 275–82. https://doi.org/10.17660/ActaHortic.1998.456.32.

Stevens, Micah E., and Paula M. Pijut. 2017. “Origin of Adventitious Roots in Black Walnut (Juglans Nigra) Softwood Cuttings Rooted Under Optimized Conditions in a Fog Chamber.” New Forests 48 (5): 685–97. https://doi.org/10.1007/s11056-017-9592-6.

Sudhakar, M., A. Trishul, Mukesh Doble, K. Suresh Kumar, S. Syed Jahan, D. Inbakandan, R. R. Viduthalai, V. R. Umadevi, P. Sriyutha Murthy, and R. Venkatesan. 2007. “Biofouling and Biodegradation of Polyolefins in Ocean Waters.” Polymer Degradation and Stability 92 (9): 1743–52. https://doi.org/10.1016/j.polymdegradstab.2007.03.029.

Wijnen, Bas, Emily J. Hunt, Gerald C. Anzalone, and Joshua M. Pearce. 2014. “Open-Source Syringe Pump Library.” PLOS ONE 9 (9): e107216. https://doi.org/10.1371/journal.pone.0107216.

Zheng, Youbin, Linping Wang, and Mike Dixon. 2007. “An Upper Limit for Elevated Root Zone Dissolved Oxygen Concentration for Tomato.” Scientia Horticulturae 113 (2): 162–65. https://doi.org/10.1016/j.scienta.2007.03.011.

  1. Optional; Used to monitor water quality in the reservoir and as a backup water level sensor.

  2. RTCs interface directly with the Pi and replace the fake-hwclock

  3. A few stainless steel plates and a cheap power supply would be sufficient, so the cost is minimal.

  4. Optional; Used to monitor water quality in the reservoir and as a backup water level sensor.