-
Change in Philosophy Regarding Nutrient Solution Replacement
08/06/2017 at 16:35 • 0 commentsAfter a distraction from my yearly camping trip to AirVenture, getting ready to teach my Fall class and other Summer distractions it is becoming very clear that this project is actually for next Summer's growing season...
That being said, through observation and solution monitoring during this hot summer I have learned that the new direction regarding nutrient solution maintenance is the right one. Originally I was going to have a reserve tank of full strength nutrient solution and fill the active sump tank from that. However, as the summer progressed, plants grew and temperatures rose. There were days that the sump level fell over three gallons in 24 hours. As the level fell, the total dissolved solids (TDS) rose to somewhat alarming levels. I surmise that this was a combination of evaporation and plant transpiration. The conclusion is that the system needs to do much more fresh water replacement than adding nutrient solution.
The new design eliminates the reserve tank and replaces it with an electrically operated valve that connects to the outside faucet. It adds a five gallon tank of concentrated nutrient solution with a dosing pump. When the sump level switch indicates a low level it operates the valve and fills the sump to the "full" level. Logic is added to the NodeRed flow that measures Electric Conductivity (EC) to determine TDS each day, after the pumping session. This allows the solution to naturally mix before the reading. This is done three times a day so if enough concentrated solution is not added, it will be supplemented after the next pumping cycle.
I still need to create my temperature compensation lookup table. I plan on making a standard concentration of the nutrient solution, cooling it to the lowest temperature (50 degrees) and while heating the solution to 100 degrees, correlating the temperature with the EC.
I added my most recent code and schematic to the project files.
-
Nutrient Solution Maintenance and the Reservoir Revisited
06/15/2017 at 19:43 • 0 commentsI have been working on the instrument assembly that would be partially submerged in the nutrient solution sump tank; both from a reservoir refill perspective as well as a nutrient replenishment standpoint (compensating for evaporation and rain-fill). My plan was to handle these as two separate problems to be solved: deciding when the sump needs to refilled from the reservoir and measuring the total dissolved solids (TDS) in the solution and dosing with concentrated nutrient as needed.
The reservoir solution was fairly straightforward. I was planning on a vertical tube that contained two magnetic reed switches: one each for low solution and proper fill level. A float would travel along this tube and as the solution level dropped it would eventually come close enough to the lower reed switch to close it, triggering a pump in the reservoir to start refilling the sump. The program would then monitor the upper reed switch and when the float reached the appropriate level, the switch would close and the pump would be turned off. I've been playing with this design and, using high density foam, clear rigid tube from the local aquarium shop, a neodymium magnet embedded in a high density foam float and two magnetic reed switches, the design seemed fairly robust.
Next I started researching electric conductivity (EC) and total dissolved solids (TDS) measurements I found quite a bit of DIY solutions, including some great ones on Hackaday. I was worried about doing constant measurement because of electrolysis and the effect on the electrodes so was going down the road of doing one brief measurement each day. As it turns out, most commercial units use alternating current (AC) to help mitigate this problem although I did find one reference that was using the fast-read approach. I also discovered that temperature had a direct bearing on the measurement so, rather than being an interesting variable to measure, solution temperature is a requirement. So, with a little modification, my approach to measurement looked promising. When TDS dropped I was planning on injecting small amounts of concentrated nutrient solution with a peristaltic dosing pump. waiting until a scheduled bucket flood had finished (to mix the solution) then re-measuring and adjusting as necessary.
Then the obvious became clear. The reservoir had several drawbacks. First, it was another tank that took up space, needed maintenance and most of all, had a finite volume. If I were gone for an extended period of time (vacation, during the hot summer when transpiration rates are highest) I would need a very big tank. Also, I could correct for a diluted solution from rain-fill with the dosing pump, but I couldn't correct for an overly concentrated solution. If I replaced the reservoir with plumbing to my outside faucet, and the pump with an electric valve, I could solve these problems.
Starting out with a good basic design is important, but I really enjoy the dynamic nature of evolving the design.
-
Wi-Fi Range Test
06/12/2017 at 00:02 • 0 commentsSince the ESP is a remote node and accessed by Wi-Fi I decided that it would be wise to do some distance tests. Although the hydroponics setup is only about 50 feet (linear distance) from my main Wi-Fi access point it is located in the (totally submerged) basement so I wanted to check for any potential problems. I found one, but it wasn’t related to distance.
I manually sent dozens of sump pump on/off commands but did not consistently receive acknowledgements. I moved the ESP closer to the basement window which did fix the problem. Since this appeared to be a range problem I added a “dash” to Node-Red which creates a web page that can be populated with buttons, gauges and graphs. I added a button to turn the pump on and off. This way I could be outside moving the ESP while triggering it from my phone. I discovered that I could actually get quite a bit farther from my access point than my hydroponics garden and get consistent results. It was only as I got closer to the hydroponics that things became erratic. Then something occurred to me. I have an electric fence charger to keep the squirrels from harvesting my tomato crop before I do. The charger doesn’t operate continuously but instead charges the fence periodically. When the fence was electrified it created interference with the ESP’s Wi-Fi. Sometimes it would get the command, but the acknowledgement was affected and other times it would not receive the on command at all.
This is definitely a problem so I will have to figure out how to guarantee the receipt of the message. I could add a relay for the fence charger and have Node-Red turn the fence off before sending/receiving commands but I still have the same problem of guaranteeing that the relay command is received. Since the ESP sends a confirmation it would be relatively easy in a normal programming environment to go into a loop, resending the command until a confirmation is received. Node-Red has a “function” node but I’ve never used it so that may be an answer. The MQTT protocol also supports three Class Of Service (COS) modes but I seem to remember reading that the SubPub library on the ESP only supports a COS of 0. Another thing that I need to research. Although most implementations of this design won't have to deal with this type of interference it does cause me to consider how to make the communications more robust.
The “real world” can really mess with a design…
-
Solution level, temperature and conductivity sensors
06/11/2017 at 13:16 • 0 commentsI started working on the sensor cluster that will be placed inside the sump pump container. I anticipate that this sensor group will do several things:
- Sense low solution level and send (publish) a request to Node-Red to turn on the reserve pump to begin refilling the sump.
- Sense high solution level indicating that the sump is full and send (publish) a request to Node-Red to turn the reserve pump off.
- Sense the temperature of the nutrient solution in the sump.
- Possible test the electric conductivity of the solution to indicate if the nutrient solution mix needs correction.
This sensor needs to be relatively simple as there will be some mechanical aspects to it that could fail. It must also be water-proof as it will be submerged in the nutrient solution.
My first design idea is to use a ridged plastic tube that holds two magnetic reed switches, each at the appropriate point to indicate low solution level and sump full. A float made out of something that floats could hold a neodymium magnet. This float would follow the solution level and the magnet would activate one of the two magnetic reed switches as required. I found two different corks as well as some high density foam to test as floats. I looked for rigid plastic tubing at the hardware store but the best that I found was grey water supply line. It isn’t really rigid enough and has a slight curve which could be a problem with smooth operation of the float. It would also be nice to get a clear tube to observe the location of the internal components. Ideally I can find a set of tubes that are rigid, clear, and easily nest. Then I could cut a small section of one to insert into the float to act as a sort of bearing surface.
This tube could also house the DS18B20 temperature sensor providing the needed water-proofing.
I’m trying to decide about the solution conductivity portion. It would be fairly easy to put two electrodes extending from the tube but I need to do some experimentation to see if this is valid. I have a small handheld testing unit that shows the level of dissolved solids but I have a feeling that it is more sophisticated than simply measuring conductivity. It’s possible that, although conductivity might not be a “laboratory” measurement, it might be enough to signal that the nutrient solution has changed.
I've also included the relays that I plan to use to control the two pumps.
-
Dutch Bucket Hydroponics
06/11/2017 at 03:23 • 0 commentsNot really a post about my IUT project but it occurred to me that many would not be familiar with hydroponic gardening. Hydroponics is basically a way to grow plants without using dirt. The method I’m using is called the “Dutch Bucket” method. The plants are placed in a neutral growing medium, perlite in my case, and specifically formulated nutrient solutions are pumped from a large container (sump) into the plan’ts container which is allowed to filter down through the growing medium, both watering and feeding the plants. The solution goes to the bottom of the container where it is drained back to the sump. I run the pumps three times a day for 30 minutes each time. When the pumps aren’t running the perlite maintains enough moisture so that the roots don’t dry out, but also allow the roots to get air so the plant doesn’t drown.
If you want to know more about Dutch Bucket hydroponics, mphgardner is where I discovered the method: https://www.youtube.com/watch?v=nXy32Dr4Z4A
-
Temperature Sensing and Initial Node-Red Config
06/11/2017 at 02:26 • 0 commentsThe initial bugs are worked out of the Arduino code for the ESP8266. Pushing and holding the “sump low” button triggers the “sump pump” LED simulating the sump pump running. Then pushing the “sump high” button turns the LED off simulating the sump pump stopping.
I decided to use DS18B20 temperature sensors for the nutrient solution and ambient temperature sensing. These sensors are reasonably accurate, small, inexpensive, and have good Arduino library support.
I started work on the flow description in Node-Red running on the Raspberry Pi that will control everything. If you aren’t familiar with Node-Red, Richard Wenner did an outstanding step-by-step overview and installation YouTube tutorial at: https://www.youtube.com/watch?v=WxUTYzxIDns&t=379s
My initial flows look like this:
/hydroponics/sumpTemperature --> requests sump temperature
/hydroponics/ambientTemperature --> requests ambient temperature
/hydroponics/sumpPump --> Turn sump pump on(1)/off(0)
/hydroponics/reservePump --> Turn reserve pump on(1)/off(0)
/hydroponics/sumpPumpConfirm <-- Confirm receipt of sump command
/hydroponics/reservePumpConfirm <-- Confirm receipt of reserve command
I am using the Node-Red time inject function to turn the sump pump on at 07:00, 12:00 and 19:00 and run for 30 minutes each time. The ESP sends a confirmation which I display in the debug window as well as sending me an email for now. Since this is Wi-Fi and the ESP is going to be out in the garden I need some assurance, at least in the beginning, that it is receiving both pump on and off commands. For now the Pi is requesting both temperatures every hour (using Node-Red inject) and displaying them in the debug window. I intend on either logging these temperatures locally or possibly doing an integration with my Azure account. -
Beginning Hardware Build
06/10/2017 at 01:26 • 0 commentsI built an initial breadboard for this project. The two push buttons next to the ESP are for programming the chip since I want to easily debug my code as I add the hardware components. The next two buttons emulate the high and low nutrient solution mark for the sump. Pressing the "Sump Low" button starts the pump from the reservoir to refill the sump. This activity is represented by the red LED, indicating the pump is running. Pressing the "Sump High" button simulates the level indicator detecting that the sump is full and stops the reservoir pump and turns off the red LED. The sump pump is activated three times a day for 15 minute intervals to flood the growing tubs with nutrient solution. The command to turn this pump on comes from the Mosquitto MQTT message broker running on a Raspberry Pi and originated by a Node-Red service running on the same PI. Activation of this pump is indicated by the yellow LED.