A guide to different pH up options in hydroponics

When is pH up needed?

The control of pH in hydroponics is critical. Most commonly, we need to decrease the pH of our solutions as most nutrients will initially be at a higher than desired pH. This is especially true when tap water or silicates are used, as both of these inputs will increase the overall pH of hydroponic nutrients after they are prepared. In recirculating systems, pH will also tend to drift up due to the charge imbalance created by the high active uptake of nitrate ions carried out by most plant species. For a discussion on pH down options, please read my previous post on this topic.

However, there are certain circumstances where the pH of hydroponic solutions needs to be increased. This can happen when tap water or silicates are not used or when plants decrease pH due to an aggressive uptake of some cations. Plants like tomatoes can do this when grown in solutions with high potassium contributions, as they will actively uptake these nutrients to the point of changing pH balance. Excess ammonium can be another common cause for pH decreases in hydroponic solutions that require the use of pH up solutions.

Potassium hydroxide pellets, the most powerful pH up option available to growers

With this in mind, let’s discuss the pH up options that are available in hydroponics. I only considered substances that are soluble enough to create concentrated solutions, such that they can be used with injector systems.

pH up options

Sodium or potassium hydroxide (NaOH, KOH)

These are the strongest. They are low cost, can be used to prepare highly concentrated solutions and will increase the pH most effectively. They are however unstable as a function of time because they react with carbon dioxide from the air to form sodium or potassium carbonates. This means that their concentrated solutions need to be kept in airtight containers and that their basic power will decrease with time if this is not the case. Additionally, these hydroxides are extremely corrosive and their powder is an important health hazard. Dissolving them in water also generates very large amounts of heat – sometimes even boiling the water – which makes their usage more dangerous. Although desirable when basic power is the most important short term concern, I recommend to avoid them giving their PPE requirements and the lack of long term stability.

When these hydroxides are used, potassium hydroxide is the recommended form, as potassium hydroxide is both more basic and a plant nutrient, while excess sodium can cause problems with plant development. However, sodium hydroxide might be more desirable if it can be obtained at a particularly low price and small additions of sodium are not a concern.

Potassium silicate

This is a soluble form of silicon that is stable at high pH values. While solutions of potassium silicate by itself can be prepared and used as a pH up option, it is usually stabilized with a small addition of potassium hydroxide to take the pH of solutions to the 11-12 range. Potassium silicate contributes both potassium and silicon to hydroponic solutions – both important nutrients – and its use can be more beneficial than the use of pure potassium hydroxide. While silicates are less basic and more mass is required for the same pH buffering effect, the preparation and handling can often be much simpler than those of potassium hydroxide.

Note that potassium silicate solutions are also unstable when left in open air, as they will also react with atmospheric carbon dioxide to generate potassium carbonate. It is also worth noting that not all potassium silicates are the same, when looking for a highly soluble potassium silicate for hydroponics, make sure you get potassium silicates that have higher K/Si ratios. Usually ratios of at least 1.05 are required (make sure you convert both K and Si to their elemental forms, as most of these products report K as K2O and Si as SiO2).

Potassium carbonate (K2CO3)

This basic salt is stable in air, has less demanding PPE requirements and can also be used to prepare concentrated solutions (more than 1g of potassium carbonate can be dissolved per mL of water). Because of its lower basicity compared to potassium hydroxide, more of it also needs to be used to increase the pH of a hydroponic solution. However, solutions of it are stable, so there is no concern for their stability or changes to its basic power.

Another advantage given by potassium carbonate is that – contrary to the previous two examples – it does increase the buffering capacity of the solution against pH increases, due to the addition of carbonate to the solution. As carbon dioxide is lost to the air at the pH used in hydroponics, the pH of the solutions tends to drift up, this means that the carbonate addition makes the pH more stable in solutions where the pH is being constantly pushed down. This is all part of the carbonic acid/bicarbonate equilibrium, which also helps chemically buffer the solutions at the pH used in hydroponics.

Overall potassium carbonate is one of my favorite choices when there is a downward drift of pH in recirculating solutions.

Potassium phosphate (K3PO4)

Another weak base, potassium phosphate, can be used to prepare concentrated solutions and increase the pH in hydroponic solutions. While its solubility and basicity are lower than that of potassium carbonate, it does provide additional phosphorus that can buffer the pH of the solution. This happens because mono and dibasic phosphate ions are anions that be taken up by plants, therefore decreasing the pH. While phosphates can help chemically buffer the hydroponic solution against pH increases, for decreases the phosphate buffer is ineffective as the pKa of the relevant equilibrium is 7.2.

An issue with potassium phosphate is that it provides large contributions of K to solution. These potassium additions can be quite counter productive if the cause of the pH drift towards the downside is related to potassium uptake.

Potassium Citrate/Lactate/Acetate

Basic organic salts of potassium can also be used to increase the pH. These are all much weaker than even the carbonate and phosphate bases mentioned above and relatively large additions are required for even a moderate immediate effect in pH. However, since these anions are actively taken up by microbes, the microbial metabolism of these ions will create a longer term effect on pH. A moderate addition of potassium citrate can only cause a small increase of pH in the short term, with a larger increase happening during the following 24 hours.

A disadvantage is that these anions can also lead to explosions in bad microbe populations if the environment does not have an adequate microbial population. When these salts are used, adequate microbial inoculations need to be carried out to ensure that the microbes that will proliferate will not be pathogenic in nature.

Protein Hydrolysates

While hydrolysates themselves can have an acidic pH when put in solution, their microbial metabolism aggressively increases the pH of solutions in the medium term. This means that these hydrolysates should not be used for immediate pH adjusting, as they will tend to decrease pH further in the very short term, but they can be used as a more long term management option.

As with the above organic salts, their use also requires the presence of adequate microbial life. If you neglect to properly inoculate the media before their addition, then pathogens can also make use of these amino acids to proliferate.

Combinations are also possible

As with the case of pH down options, some of the best solutions for a problem come when several of the above solutions are combined. For example the use of potassium rich pH up solutions in microbe containing soilless media can often cause pH drift issues related with potassium to worsen. For this reason, it can be desirable in these cases to prepare pH up solutions that include protein. This means that you reduce the pH fast but then you have a residual effect from protein metabolism that helps you fight the pH increase as a function of time.

However not all pH up drifts are caused by potassium, as in the case of plants where pH up drift happens due to low nitrate uptake (for example some flowering plants that stop producing a lot of additional leaves during their flowering stage). In these cases potassium based pH up solutions cause no additional issues and combinations of potassium carbonate and potassium phosphate might be best.

Choose according to your goals

As in most cases, the best solution will depend on your circumstances. Think about whether you’re just adjusting the pH of your initial solutions or whether you need to compensate for a constant drift, whether microbial life is present and whether you’re concerned with the accumulation of any substances in a recirculating solution. Once you consider these factors and review the above solutions, you should be able to find the pH up solution that is better suited to your particular needs.

Are you using a pH up? Let us know why and which one you’re using in the comments below!




How to make a stabilized ortho-silicic acid solution with only 3 inputs

In a previous post, which you can read here, I gave a procedure for the preparation of a stabilized mono-silicic acid using from potassium silicate. The procedure called for the usage of several stabilizing agents, including carnitine and propylene glycol, with phosphoric acid being used as the acidifying agent.

After trying this synthesis myself and talking with other people who tried this process, it seemed clear that the success rate was low and that the process was just too complicated and imprecise for most people to carry out (especially for the patience needed for the addition of the solid potassium silicate). There is a detailed discussion about this procedure, as well as mono-silicic acid synthesis in this forum thread.

Stabilized mono-silicic acid solution created using the procedure below. Note that mono-silicic acid and ortho-silicic acid are the exact same thing, they are two names for the same molecule (H4SiO4). Another molecule with the same nomenclature is ortho-phosphoric acid (H3PO4), which is also called mono-phosphoric acid.

Given these issues, I decided to look for a potentially easier synthesis starting from cheaper, more readily available materials, avoiding the use of Propylene Glycol (which concerned some people) and trying to simplify the steps involved.

The procedure I came up with simplifies the process by relying on the interaction of silicic acid with sorbitol as a stabilizing agent. This stabilization process is well documented in the literature (see here) and is caused by the formation of highly stable polyolate complexes between mono-silicic acid and molecules like sorbitol. These complexes form because molecules like sorbitol have adjacent hydroxy groups in what we call a threo configuration. These do not exist in sugars like glucose or sucrose, reason why these do not work for this process.

The raw inputs you will need are as followed

  1. A potassium silicate with a high K/Si ratio, such as AgSil 16H. You can also use a liquid potassium silicate, such as Grotek Pro-silicate.
  2. Sulfuric Acid (>90%)
  3. Sorbitol
  4. Distilled water.

If using AgSil16H follow this process first. In a 1000mL beaker, add 70g of AgSil16H and 450mL of distilled water. Stir – ideally with magnetic stirring – until the silicate has all dissolved. This will be the silicate solution.

This is now the procedure to prepare the stabilized ortho-silicic acid solution (700mL):

  1. In a 1000mL beaker, add 500mL of distilled water and a magnetic stirrer.
  2. Weigh 200g of Sorbitol and add them to the water.
  3. Start the magnetic stirring.
  4. After the sorbitol has completely dissolved, during a period of 30 seconds add 100mL of the silicate solution (either as prepared above or a commercial silicate equivalent to the Grotek suggestions above (around 7.5% Si as SiO2)).
  5. Stir the silicate and sorbitol solution for 10 minutes.
  6. Add 10mL of >90% sulfuric acid and stir for 5 minutes. The pH should now be lower than 2.
  7. The solution can now be stored.

The above process creates a stable mono-silicic acid solution that has an Si concentration of around 1% of Si as SiO2 and around 0.6% K as K2O. Used at 8mL gal it should provide around 20ppm of Si As SiO2 and 10 ppm of K.

A previous version of this procedure used 50mL of 80-85% phosphoric acid. However, phosphoric acid seems to generate solutions that are unstable after 1-2 weeks of preparation. Solutions prepared per the above process have been confirmed to be stable for at least 1 month.

Did you try it? How were your results? Let us know in the comments below!




A one-part hydroponic nutrient formulation for very hard water

What is water hardness?

There are many parameters that determine the quality of a water source. Water that has a composition closer to distilled water is considered of a higher quality, while water with many dissolved solids or high turbidity is considered low quality. Calcium carbonate, magnesium carbonate, calcium sulfate and calcium silicate are some of the most common minerals that get dissolved into water as it runs through river beds and underground aquifers. The carbonates and silicates will make water more basic, will increase the water’s buffering capacity and will also increase the amount of magnesium and calcium present in the water.

Water hardness is determined experimentally by measuring the amount of Calcium and Magnesium in solution using a colorimetric titration with EDTA. Although both Calcium hardness (specific amount of Ca) and Magnesium hardness (specific amount of Mg) are measured, total water hardness (the sum of both) is the usually reported value. The result is often expressed as mg/L of CaCO3, telling us how much CaCO3 we would require to get a solution that gave the same result in the EDTA titration.

The Calcium and Magnesium present in water sources with high hardness is fully available to plants – once the pH is reduced to the pH used in hydroponics – and it is therefore critical to take these into account when formulating nutrients using these water sources. It is a common myth that these Ca and Mg are unavailable, this is not true.

What about alkalinity?

Water alkalinity tells us the equivalent amount of calcium carbonate we would need to add to distilled water, to get water that has the same pH and buffering capacity. An alkalinity value of 100 mg/L of CaCO3 does not mean that the water has this amount of carbonate, but it means that the water behaves with some of the chemical properties of a solution containing 100mg/L of CaCO3. In this particular case, it means that the water requires the same amount of acid to be titrated as a solution that has 100mg/L of CaCO3.

Water sources with high hardness will also tend to have high alkalinity as the main salts that dissolve in the water are magnesium and calcium carbonates. Since these carbonates need to be neutralized to create a hydroponic solution suitable to plants, the anion contribution of the acid that we will use to perform the neutralization needs to be accounted for by the nutrient formulation.

An example using Valencia, Spain

Valencia, in the Mediterranean Spanish coast (my current home), has particularly bad water. Its water has both high alkalinity and high hardness, complicating its use in hydroponics. You can see some of the characteristics of the water below (taken from this analysis):

Name Value Unit
Calcium 136 ppm
Magnesium 42 ppm
Chloride 103 ppm
Sulfur 89 ppm
pH 7.6
Alkalinity 240 mg/L of CaCO3
Typical water quality values for water in Valencia, Spain.

Hard water creates several problems. Since Calcium nitrate is one of the most common sources of Nitrogen used in hydroponics, how can we avoid using Ca nitrate? Since we have more than enough. Also, how can we neutralize the input water so that we can make effective use of all the nutrients in it without overly increasing any nutrient, like P, N or S, by using too much of some mineral acids?

Creating a one-part solution for very hard water

HydroBuddy allows us to input the characteristics of the input water into the program so that we can work around them while designing nutrient solutions. To get around the above mentioned problems – but still ensure I could easily buy all the required chemicals – I decided to use a list of commonly available fertilizers. I used Calcium Nitrate, Magnesium Nitrate, Potassium Nitrate, Phosphoric acid (85%) and a micro nutrient mix called Force Mix Eco (to simplify the mixing process). This micronutrient mix is only available to people in the EU.

HydroBuddy results to create 1 gallon of 1:100 nutrient solution for Valencia’s very hard water.

Note that we use absolutely no phosphates or sulfates, since the solution already contains more than enough sulfur (89 ppm) and we need to add all the Phosphorus as phosphoric acid to be able to lower the alkalinity. I determined the amount of P to add by setting P to zero, then using the “Adjust Alkalinity” to remove half of the alkalinity of the water using phosphoric acid. This is more than enough P to be sufficient for higher plants. The above nutrient ratios should be adequate for the growth of a large variety of plants, although they are a compromise and not ideal for any particular type of plant.

Since we are adding no sulfates and the pH of the solution is going to be very low (because of the phosphoric acid), we can add all of these chemicals to the same solution (no need to make A and B solutions). The values in the image above are for the preparation of 1 gallon of concentrated solution. This solution is then added to the water at 38mL/gal of tap water to create the final hydroponic solution.

Does it work?

I have experimentally prepared the above concentrated solution – which yields a completely transparent solution – and have created hydroponic solutions I am now using to feed my home garden plants. After adding to my tap water – initial pH of 7.6 – I end up with a solution at a pH of 5.6-5.8 with around 1.5-1.8mS/cm of electrical conductivity. The plants I’m currently growing – basil, rosemary, chives, mint, malabar spinach and spear mint – all seem to thrive with the above solution. I am yet to try it on any fruiting crops, that might be something to try next year!

Are you growing using hard water, have you prepared a similar one-part for your hard-water needs? Let us know what you think in the comments below!




New tissue analysis feature in HydroBuddy v1.99

Tissue Analysis

To grow great plants, we need to grow plants that have a healthy mineral composition. Although there are no theoretically established values for what the mineral composition of a plant should look like, we have grown healthy plants and have established, through analysis of their tissue, what this mineral composition should empirically be. By sampling the leaf tissue from your plants and sending it to a lab for analysis, you can know what the composition of your tissue is and how it compares to healthy plants grown by others.

The question is, can we create a nutrient formulation just from the tissue composition we want to get?

Nutrient solution targets from tissue analysis

Turns out, you can figure out the elemental concentrations that are required in solution to get to certain concentrations in tissue. My colleague and friend – Bruce Bugbee – proposed in this paper about nutrient management in 2004 how this could be done. To achieve this, we make the assumption that all elements taken up by the plant will be deposited as minerals upon transpiration – because minerals cannot leave the plant as gases – so knowing the amount of water that will transpired per amount of tissue grown, we can figure out how much of that element needs to be in the water.

The volume of water required to grow a certain mass of tissue is called Water Use Efficiency (WUE). It is expressed as gram of tissue per liter of water transpired and has values from 3.0 to 6.0. Higher WUE values imply the plant is growing more efficiently, requires less water to grow the same mass of tissue, while a lower WUE implies the plant is less efficient and needs to transpire more to grow. Conditions that increase growing efficiency and decrease transpiration, such as carbon dioxide enrichment and high humidity, tend to increase WUE, while conditions that create inefficient growing – like low humidity with high temperature – tend to decrease it.

If we grow plants with a solution where we determine the nutrients according to the WUE and the concentrations in tissue we want, we can create very effective solutions that lower the probability of over accumulation of nutrients in the root zone and the solution. This allows for solutions that require no dumping and create very healthy plants in recirculating systems (for which Deep Water Culture, DWC, is the most common example).

Doing this process in HydroBuddy

From v1.99, HydroBuddy now includes a “Tissue Analysis” dialogue that allows you to use target tissue concentrations and a certain WUE value, to figure out what the required nutrient concentrations in a hydroponic solution would be like. The program also includes a small Database with tissue targets for certain plants and certain stages of development. There are also a couple of links that point you to resources where you can find a wide variety of different plant species and development stages if the ones that interest you are not included in the software’s default DB configuration.

The image below shows you an example where I determined the target solution concentrations required to grow a tomato plant that has the composition expected for a tomato plant in early flower.

Nutrient solution targets for a hydroponic solution to grow tomatoes with a leaf tissue composition equal to that expected for tomatoes under initial flower (MRM = most recent mature leaf). This assumes the WUE is 3.5 g/L.

How do I figure out the WUE?

As you can see, the above process requires you to input the WUE. This ranges from 3 to 6. It is not easy to measure in the environment, so the best practical solution is to assume your WUE is about 3.5 (the default value), prepare solutions with those concentrations and then observe how the EC of the solution changes as a function of time.

A solution that is prepared with a concentration that would be appropriate for the exact WUE of the plants will have an initial decrease in EC – as nutrients that are taken actively are rapidly taken up – followed by more stable to slightly decreasing EC conditions as uptake changes to be mostly passive. This cycle is repeated when solution is replenished to recover the initial volume in a recirculating system. A solution that is prepared too concentrated will have an increasing EC while a solution that is prepared too diluted will show a consistently decreasing EC. If your EC decreases more sharply with time then you need to assume a higher WUE, if your EC increases then you need to lower your WUE assumption.

Limits of the approach

While this approach can be very useful to create long lasting solutions, especially in recirculating systems, it suffers from some important limitations.

The first is that it doesn’t account for changes in uptake due to changes in pH or availability in solution. This is the reason why the recommendations for elements like Fe and Mn, might be significantly lower than what you commonly see in nutrient solutions. In the above example, the solution requires only around 0.35ppm of Fe, but this means we need 0.35ppm of fully available Fe for the plant, which in reality might mean having 1.5ppm of Fe or more of added Fe, depending on the chemical form of Fe and the pH of the solution.

The above implies that values should not be used without considering the context and that this context might be much more important for some nutrients, for example micro nutrients, than for other elements, for example K and Ca, for which the availability windows and plant uptake are much more straightforward. The plant characteristics should also be taken into account. While a leaf tissue derived approach might only require 50 ppm of Ca in a lettuce crop, we know we need to feed more due to the poor water transport of this plant into new leaves.

Second, the approach assumes that all we care about is leaf composition. This is a perfectly fine if we are growing leafy greens, but if you’re growing a tomato plant, the composition will be heavily split between leaves and fruits as soon as flower pollination ends. For this reason, the nutritional needs of other important tissues – such as sink organs – should be considered very carefully when following this approach. In the case of tomatoes, this might mean feeding substantially higher levels of K, as this element has a much higher concentration in fruits than it has in leaves.

Crops that have changing nutritional needs due to changes in the composition of the tissue formed, require different nutrient solutions as a function of time, as we need to match the overall expected composition of the entire plant, not just the leaves.

Conclusions

Nutrient formulations do not need to be just trial and error. Up until now, besides a formulation database, HydroBuddy had no feature to help growers create formulations with any scientific basis. This new feature, introduces the ability to use target leaf tissue composition and WUE as a way to guide the initial formulation of nutrient solutions. While you still need experience to figure out when to overrule these values and increase or decrease concentrations, it does provide basic blue prints to build from. An analysis of how a formulation derived from tissue compares with your current formulation might also give you some insights into whether you are over or under feeding any elements.

Have you use the HydroBuddy’s leaf tissue analysis feature? Leave us some comments below!




The Potassium to Calcium ratio in hydroponics

To have a healthy hydroponic crop, you need to supply plants with all the nutrients they need. One of the most important variables that determine proper nutrient absorption, is the ratio of Potassium to Calcium in the nutrient solution. These two elements compete between themselves and have different absorption profiles depending on the environment, and the plant species you are growing. For this reason, it is important to pay close attention to this ratio, and how it changes with time, in your nutrient solution. In this post, we are going to examine peer-reviewed research about this ratio and how changing it affects the growth, quality, and yield of different plant species.

Two vital elements that compete against each other. Their ratio is fundamental to maximize yields and changes depending on the plant species, environmental conditions and absolute concentrations used

Two ions with very different properties

Potassium and Calcium are very different. Potassium ions have only one positive charge and do not form any insoluble salts with any common anions. On the other hand, calcium ions have two positive charges and form insoluble substances with a large array of anions. This creates several differences in the way plants transport and use these two nutrients.

While potassium is transported easily and in high concentrations through the inside of cells, Calcium needs to be transported in the space between cells and its intracellular concentration needs to be very closely regulated. Calcium can also only be transported up the plant – from roots to shoots – while potassium can be transported up and down as it pleases.

Calcium transport – happening around cells – is heavily dependent on transpiration, which is what causes water to flow through this space. Potassium transport is not so closely related to transpiration, as it can move directly through the inside of cells in large amounts, which means it can be actively transported through the plant in an effective manner.

Note that the above is a broad over-simplification of Potassium and Calcium transport. If you would like to learn more about this topic, I suggest reading these reviews (1,2).

Competition between K and Ca

Potassium and Calcium are both positively charged, so they do compete to a certain extent. The competition is both because they compete for anions – which they need to be paired with for transport – and for the use of electrochemical potential, which they take advantage of to get transported across membranes. However, they do not have the same transport mechanisms, so the competition is limited.

Table taken from this article (3)

The table above illustrates this point. This study (3) looked into different K:Ca ratios in the growing of lettuce and the effect these ratios had on yield, tip burn, and nutrient concentrations in tissue. You can see that at low total concentrations (0.4 mS/cm EC) the K in tissue is very low when the amount of Ca is high relative to K, while at higher EC values (1.6 mS/cm EC), the K concentration remains basically unaffected, even if the Ca concentration is 3.5 times the K concentration. While Ca competes effectively with K when the absolute concentration of both is low, this competition of Ca becomes quite weak as the concentration of K and Ca increase. At very high concentrations (3.6 mS/cm EC), the potassium does start to heavily outcompete the Ca, especially when the K:Ca ratio is high (3.5x).

The above is also not common to all plants. For some plants, the competition of Ca and K actually reverses compared to the results shown above. However, it is typical for low and high absolute concentration behaviors to be different, and for the influence of K or Ca to become much lower in one of the two cases.

Optimal K:Ca ratios

The K:Ca ratio has been studied for many of the most popularly grown plants in hydroponics. The table below shows you some of these results. It is worth noting, that the results that maximized yields, often did so at a significant compromise. For example, the highest yield for lettuce came at the cost of a significantly higher incidence of inner leaf tip burn. In a similar vein, the highest yields in tomatoes, at a 3:1 ratio, came at the cost of additional blossom end rot problems. This is to say that, although these ratios maximized yields, they often did so with consequences that wouldn’t be acceptable in a commercial setup. For lettuce, 1.25:1 proved to be much more commercially viable, while still giving high yields.

Ref Plant Specie Optimal K:Ca
4 Rose  1.5:1
5 Tomato 3:1
6 Tomato 1.7:1
7 Marjoram 0.5:1
8 Strawberry 1.4:1
9 Cucumber 1:1
10 Lettuce 3.5:1
Optimal K:Ca – in terms of yields per plant – found for different plant species

You can see in the above results, that fairly high K:Ca ratios are typically required to increase yields. For most of the commercially grown flowering plants studied, it seems that a ratio of 1.5-2.0:1 will maximize yields without generating substantial problems in terms of Ca uptake. As mentioned above, higher K:Ca often push yields further, but with the presence of some Ca transport issues. A notable exception might be cucumber, for which the publication I cited achieved the maximum yield at a ratio of 1:1. However, good results were still achieved for 1.5:1.

Another important point about the ratio is that it is not independent of absolute concentration. As we saw in the previous section, the nature of the competition between K and Ca can change substantially depending on the absolute ion concentrations, so the above ratios must be taken within the context of their absolute concentration. The above ratios are generally given for relatively high EC solutions (1.5-3mS/cm).

Conclusion

The K:Ca ratio is a key property of hydroponic nutrient solutions. While the optimal ratio for a given plant species cannot be known apriori, it is reasonable to assume that the optimal ratio will be between 1:1 and 1:2 for most large fruiting crops and flowering plants that are popularly grown in soilless culture. This is especially the case if the hydroponic solution does not have a low EC. An optimal value below 1:1 is unlikely for most plants, although exceptions do exist in certain plant families that have peculiar Ca metabolisms.

To obtain the largest benefit, it would be advisable to run trials to optimize the K:Ca ratio for your particular crop, by changing the K:Ca ratio between 1:1, 1.5:1, and 2:1. You will likely see important differences when you carry out these trials, which will be useful to determine the highest yielding configuration for your setup. To perform these variations, it is usually easiest to change the ratio of potassium to calcium nitrate used in the nutrient solution.

Have you tried different K:Ca ratios? What do you grow and what has worked for you? Share with us in the comments below!




How to use organic fertilizers in Kratky hydroponics

I’ve written several posts in this blog about Kratky hydroponics (for example here and here). In this method, you use a bucket, a net pot, a small amount of media, and some nutrient solution, to grow a plant from start to finish. It requires no power or interventions in the case of leafy greens or small flowering plants. However, one of the requirements of a traditional Kratky setup is the use of regular hydroponic nutrients that are created from synthetic inputs. In this post, we are going to talk about the use of organic fertilizers in Kratky hydroponics, which inputs might work, and which will be problematic.

Plant grown in a traditional Kratky setup using synthetic fertilizers

The types of organic inputs

When people talk about “organic fertilizers”, they usually refer to inputs that can be used in the growing of organically certifiable foods. The easiest way to fit this definition is to look at the inputs that are listed by organizations like OMRI. However, among OMRI-listed products, we have significant differences in where the products come from, and this makes a huge difference in whether or not we could use them in a Kratky setup.

For the purposes of this post, we can divide the OMRI-listed products into three categories. We have mined materials, which are extracted and used in their raw form from the earth. We also have animal or vegetable sourced products, which are byproducts of some animal or vegetable industry, and we have processed products, which involve some postprocessing or mixing of products in the former categories.

In the first category of products, we have things like mined magnesium sulfate, potassium sulfate, rock phosphate, sodium nitrate, or limestone. In the second category, we have things like fish emulsion, kelp extract, blood meal, and bone meal, while in the third category we have products like the Biomin series of transition metal chelates or any liquid or solid organic fertilizer blended products.

Why origin matters

The type of organic input matters, because Kratky hydroponic systems lack one important element. Oxygenation.

Since oxygen is not going to be injected into the nutrient solution, any input we use that requires oxygen for decomposition or absorption, or that requires oxygen for its proper uptake, is not going to work well. If you add any animal or vegetable product to a Kratky setup, the lack of oxygen in the solution is going to give way to the growth of anaerobic organisms that are going to be detrimental to plant growth and will lead to root rot.

Things like blood meal – which would be great amendments in soil with good aeration where oxygen can do its job – turn into foul mixes when put into a Kratky setup. This is because a Kratky setup has a stagnant body of water that is going to turn into a very unfavorable medium for plants as soon as we add anything that creates a heavily reducing environment.

The Kratky Method of Hydroponics - uPONICs, Hydroponics and Aquaponics  Information
A traditional Kratky setup. Note that the solution at the bottom is stagnant and not actively oxygenated in anyway. Only the oxygen that diffuses from the air gets into the water. This is enough to keep the submerged roots alive, provided that the solution itself does not act as a sink for oxygen. In these cases, root rot is quickly experienced.

Plant roots can tolerate a relatively oxygen-deprived solution to some extent, provided that enough root mass is above the water to take in oxygen, but they cannot tolerate a solution that is rid of all oxygen by anaerobic microbial activity. This is because oxygen deprivation makes the plant more vulnerable to attack by pathogens and hinders the respiration of plant roots, which is needed for root survival.

Which inputs can you use

In general, any input that heavily removes oxygen cannot be used as-is. This means that anything that contains plant or animal proteins, fats or carbohydrates, is not going to work well. Inputs that are heavily rich in bacteria or fungi, even beneficial ones, are also going to fail. This is because these beneficial microorganisms also require oxygen and, when they are put in a Kratky solution and die, they are digested by anaerobic organisms that can take their place.

Animal or vegetable inputs that are relatively inert in origin, such as bone meal, would not be problematic, but their ability to release nutrients is going to be limited in a Kratky solution. Mined inputs are going to be mostly fine. Soluble ones, like mined magnesium sulfate and potassium sulfate, are ideal replacements, as they are chemically identical to the synthetic ones, except for a higher content of impurities due to their raw origin. However, it will be difficult to provide enough nitrogen in an organic Kratky hydroponic setup using only this type of inputs.

A potential solution

Since the problem is mainly oxygen deprivation, we can use an organic hydroponic solution, as long as it is processed for long enough to completely eliminate the oxygen depriving capacity of the inputs. As an example, you can follow my instructions on preparing an organic hydroponic solution. This requires fermenting of the solution for a significant period of time, in order to ensure most of the oxygen requiring reactions have been carried out.

To use this solution in a Kratky setup, we would need to give it a longer period of time. We can verify that the solution is ready for Kratky by using an ORP meter and checking that the solution is at an ORP above 300mV after removing active oxygenation for a day. This means that the solution is able to keep enough dissolved oxygen and that most of the oxygen-hungry processes in the solution are done. This might take substantially longer than the 12-15 days suggested in my original article, probably around 30 days.

Another important step is the removal of bacteria and fungi, which could be very problematic once the solution reaches the stagnant conditions of the Kratky setup. To do this, the easiest solution would be to run the solution through a UV filtering system, in order to make sure all fungi and bacteria are removed from the solution. This might sound counterintuitive, but the Kratky system conditions are not ideal growing conditions for plants and do require us to minimize oxygen sinks in the system.

Conclusion

You can run a Kratky system using an organically derived fertilizer. However, it is not straightforward, as we need to consider that a Kratky system lacks the oxygenation required to carry out a lot of the processes that are taken for granted in organic growing (such as protein decomposition). Without aeration of the solution, we need to provide an organic solution that has already exhausted its hunger for oxygen and can already provide nutrients in a manner that is available to plants. We also need to ensure we add no fungi or bacteria that can work anaerobically and attack roots in the stagnant Kratky solution conditions. We can use tools like long-term fermentation with aeration, ORP meters, and UV systems to achieve this goal.

Have you ever grown in a Kratky setup using organic fertilizers? Let us know about your experience in the comments below!




The importance of accuracy in hydroponic nutrient preparation

When you prepare your own concentrated hydroponic nutrients, you need to carry out a significant number of measurements. As a consequence, you will deviate from your intended preparation by the errors inherent to these operations. Plants tolerate a significant array of conditions, so these errors – even though sometimes quite big – are often not big enough to kill plants and are therefore ignored by growers. These errors will, however, greatly hinder your ability to optimize and evolve your crop nutrition to a higher standard. In this post, we will talk about these errors, why and how they happen, when they are important, and how you can minimize them in order to obtain more reproducible results.

The Brushman | 5-Gallon Plastic Pail w/Handle & Graduated Markings | PAIL-5  GAL-W-GR
The markings in buckets can carry high systematic and random errors.

Types of error

Systematic Error

There are two types of errors that happen when anything is measured. The first is systematic error, which is the error inherent to calibration problems of the instrument. For example, you might be using a 1 gallon jug to prepare concentrated nutrients and always filling the jug to a mark you made on it. This mark is not going to be 1 gallon, but probably significantly over or under it. As long as you always use the same jug and fill to the same mark, this large deviation from 1 gallon will always be the same. As long as the measuring instrument is unchanged – meaning not recalibrated – the systematic error always remains the same in sign and magnitude.

Random Error

The second type of error relates to the randomness of the measuring process. Imagine that you used a sharpie to make the mark on the above-mentioned one-gallon jug, and you always try to measure to the same mark. The mark has some width, sometimes you will fill your jug up to the bottom of the mark, sometimes up to the top. Sometimes the surface where you place the jug where you measure will not be perfectly leveled, so the mark will be off because it will be higher at one side of the jug vs the other, etc. This error changes randomly, every time you measure. One time you might be +1%, the other -4%, etc.

Where the biggest errors happen

When you make your own hydroponic nutrients, you will be measuring two things: volume and mass. These two measurements will both carry systematic and random errors. The errors in scales are more obvious, so growers will always make an effort to get scales that are accurate enough for the measurements they want to make. For small growers, this means getting scales that can measure +/-0.01g with a decent capacity, normally 500g is fine. Buying weights to properly calibrate these scales is also recommended, in order to reduce systematic errors as much as possible.

However, always make sure you read at least 3 significant digits when making a weight measurement. This means if you need to measure 1.673485g, you need a scale that measures at least 2 digits, so that you can measure 1.67 +/- 0.01g. This will keep your error below the 1% mark. This is why it is often common to also get a +/-0.001g scale, to measure things like sodium molybdate. You can also go around this problem by preparing more concentrated solution, as your weights become larger, with larger volumes.

Volumes however are where the largest errors are accrued. Most growers will use non-calibrated receptacles to measure volume. The fact that something has a line drawn on it with a volume marking, does not mean that this line is accurate. The systematic errors in these receptacles are usually very large because these were never intended for accurate measurements of volume. Things like buckets, beakers, tanks, and jugs, should not be used to measure volumes. Wide containers, like buckets and tanks, also enhance errors that relate to parallax – your ability to judge whether a level of water is at a line – so the random component of your error will be quite large.

Consequences in nutrient values

In the best cases – for jugs, buckets, and tanks – the systematic error is around 10% with a random error of +/- 5% (3 sigma). If you are preparing a concentrated solution where the final expected concentration after dilution is 200 ppm of K, then this means that your actual K value in solution will start by being 10% over or under it – depending on which way the systematic error of your volume measurement goes – and then deviate +/-5% from there. This means that you are expected to get values all the way from 170 to 230 ppm in the final solution.

This is fine as far as keeping plants alive goes. A solution with 170 ppm will keep plants alive as well as a 230ppm solution would. This is the reason why most growers don’t see an immediate need to reduce these errors. If you’re growing healthy plants and you have less or more than what you intended, what is the problem?

How inaccuracy affects your process

There are three ways in which having inaccurately prepared solutions can affect your process. The first is that it makes you very vulnerable to changes. The second is that it makes it difficult for you to effectively optimize your setup, and the third is that it prevents others from being able to reproduce your results.

Changes in your setup can affect you deeply

Let’s say you optimized your nutrients with time and found that the optimal is 200ppm of K. In reality you have a bucket that always measures 10% less volume and you randomly deviate +/- 5% from that as well. This means that your final solutions are majorly in the 210-230 ppm range. Your trusty plastic bucket then cracks and you need to go and buy another one, you suddenly find that you’re not getting the same results. Now you have a bucket that just by chance, happens to measure the volume more accurately. You are now feeding 190-210ppm, substantially less K. You never knew that, you’re confused, you’re preparing everything the same way.

Your ability to optimize is hindered

The second problem is similar. Let’s say you prepared a batch of concentrated solution to compare feeding K at 180 ppm and K at 200 ppm. You prepare a single-stock solution to carry out the test. This bucket has a systematic error of +10% and a random error of +/-5%. For this batch, the solution happens to be 6% more concentrated than intended (+10% systematic, -4% random), so you end up with 190.8ppm and 212ppm. You find out that the 200 ppm preparation works better, so you decide to use it.

However, you run out of the stock solution you prepared for the experiment, so you prepare it again. However, you incur a different random error in this preparation – remember random errors are different every time you measure – and you end up being with a +1% random error, so a +11% total error. Your results are not as good as before, you don’t know why. The reason, you’re feeding 222ppm while in your previous experiment you had fed 212ppm. All while thinking you were feeding 200 ppm.

It becomes hard to share

Systematic and random errors can make effective sharing of results impractical. Imagine you have optimized your setup to the point where you’re sure that the solution you prepare is the best one for a given plant under some given conditions. Then, you want to share this with another grower and tell him how to mix your formulation. This person tries it and tells you that your solution doesn’t actually work the way you think. You might both be aiming for the same targets but hitting completely different numbers in reality. When sharing, it is important to share the numbers you aim for, as well as the error related to these values.

How to reduce errors

Prepare highly accurate small scale solutions

The easiest way to reduce errors when preparing hydroponic solutions is to base all preparations on small-scale experiments where the preparation can be done much more accurately, using calibrated volumetric material. Watch my videos on preparing hydroponic solutions, how to correctly prepare dilutions and how to characterize stock solutions, to learn more about how this is done.

Volumetric Flask Class A pennyhead Stopper 250ml Pack of 6: Amazon.in:  Industrial & Scientific
Volumetric flasks can be used for highly accurate small scale preparations

The idea is that these small-scale preparations can tell you things such as: the amount of water you need to add for a given volume of stock solution, the expected conductivity of dilutions, and the expected density of the stock solution. Remember that salts take up volume, so to prepare 1 gallon of a concentrated stock solution you will need much less than 1 gallon of water. With this information, you can then prepare larger amounts of stock solutions, since you know the exact amount of water to add for a final volume, which you can accurately measure with a flow meter instead of having to use markings of any kind. You can then use the density measurement to check the accuracy of the preparation.

Perform fewer measurements

Every measurement you make incurs an additional error. It is better to prepare 2 concentrated nutrient solutions than to have 10 solutions with the salts being separated because you need to make 8 fewer volume measurements. If you minimize the number of measurements that you need to do to arrive at the nutrient solution that is fed to plants, you will also minimize the error incurred in these measurements. Minimize measurements from instruments with high errors. If your volumes have much more inaccuracy than your weights, prioritize lowering the number of times you measure volume vs weights.

Conclusion

Accuracy is something to strive for. It closes no doors, only opens them. It is not about being overly fuzzy or obsessive about it, it’s about using it to help you get better. Better practices, lower errors, more reproducibility, more learning. It’s a virtuous cycle. Errors are always there, whether you’re aware of them or not. Ignore them at your own peril.

If you have a process that is inaccurate that generates significant variations in your nutrient solution makeup, then these will be a problem, one way or another. You might be unable to judge whether changes in your crop are due to errors or due to changes, you might be unable to reproduce results and you might find yourself unable to meaningfully share results and explore with others. High accuracy is often not substantially expensive in hydroponics – instruments for accurate small-scale preparation are generally below the 200 USD mark total – and they can dramatically enhance the quality of your solutions and the conclusions you can make from experiments.

Do you prepare your own nutrient solutions? Do you know what your systematic and random errors are? Share with us in the comments below!




My Kratky tomato project, tracking a Kratky setup from start to finish

Fully passive, hydroponic setups are now everywhere. However, it seems no one has taken the time to diligently record how the nutrient solution changes through time in these setups and what problems these changes can generate for plant growth. In my Kratky tomato project, I will be closely monitoring a completely passive Kratky setup from start to finish. In this post, I will describe how this project will work, what I will be recording, and what I’m hoping to achieve. Check out the youtube video below for an initial intro to this project.

Introduction video for this Kratky project.

The goals

It is tough to grow large flowering plants using truly passive Kratky setups (read my blog post on the matter). We know this is because of issues related to their increased water uptake and the large nutrient and pH imbalances these plants create in nutrient solutions. However, I haven’t found any data set that shows how these problems develop as a function of time. By measuring different variables in a Kratky setup through an entire crop cycle, I hope to gather data to help us understand what goes wrong, why it goes wrong and when it goes wrong. With this information, we should be able to develop better nutrient solutions and management techniques, for more successful Kratky hydroponic setups for large flowering plants.

The setup

The setup is a 13L bucket wrapped in duct tape – to prevent light from entering the system – with a hole at the top and a net pot containing a tomato plant. The tomato – which I have named Bernard – is an indeterminate cherry tomato that was germinated in the net pot. The net pot contains a medium consisting of 50% rice hulls and 50% river sand. The bucket has been filled with a store-bought generic hydroponic nutrient solution up to the point where it touches the bottom of the net pot. Furthermore, the bucket is placed inside a grow tent and receives 12 hours of light from a Mars Hydro TS 600 Full Spectrum lamp. The light has been initially placed around 10 inches above the plant and will be moved as needed to maintain proper leaf temperature and light coverage of the plant.

The experimental Kratky setup. You can see the project box housing the Arduino and sensor boards at the bottom. Bernard has been growing for 2 weeks and is already showing its second set of true leaves.

The measurements

I will be monitoring as many variables as I can within this experiment. To do this I have set up an Arduino MKR Wifi 1010 that uses self-isolated uFire pH and EC probes, a BME280 sensor to monitor air temperature and humidity, and a DS18B20 sensor to monitor the temperature of the solution. I will also be using Horiba probes to track the Nitrate, Potassium, and Calcium concentrations once per day. All the Arduino’s readings are being sent via Wifi to a MyCodo server in a Raspberry Pi, using the MQTT messaging protocol. The data is then recorded into the MyCodo’s database and also displayed in a custom dashboard. The ISE measurements are manually recorded on a spreadsheet.

The dashboard of my MyCodo server, showing the measurements of the system as a function of time. All readings are also recorded in the MyCodo database for future reference and processing.

Furthermore, I am also taking photographs every 15 minutes – when the lights are on – using a smartphone. This will allow me to create a time-lapse showing the growth of the plant from the very early seedling to late fruiting stages.

Conclusion

I have started a new project where I will fully record the complete development process of a large flowering plant in a Kratky setup. We will have information about the EC and pH changes of the solution, as well as information about how different nutrient concentrations (N, K and Ca) change through the life of the plant. With this information, we should be able to figure out how to modify the nutrient solution to grow large flowering plants more successfully, and what interventions might be critical in case fully passive growth is not possible.

I will continue to share updates of this project in both my blog and YouTube channel.

What do you think about this project? Do you think Bernard will make it? Let us know in the comments below!




Kinetin, a powerful hormone for flowering plants

Kinetin was the first cytokinin ever discovered. Scientists have used it extensively to stimulate cell division in tissue culture, as it is a powerful growth hormone. However, there isn’t a clear understanding of the effects of kinetin in large flowering plants, reason why it hasn’t been widely used as an additive in plant culture. In this post, we are going to take a look into the practical application of kinetin. We are going to look into published research and discuss whether kinetin could be used to enhance plant yields. I will refrain from discussing the history and chemical structure of kinetin, for a basic introduction about kinetin and its history, I suggest reading this paper (1). I will also use some information contained in this review (5).

Tomatoes, peas and cucumbers grown in solutions containing kinetin were significantly shorter. Root and flowering changes were also present. Taken from (2).

The effects of exogenous kinetin

In tissue culture, what kinetin does seems to be clear, it promotes cell division in the presence of auxins. However, for large plants in soilless media, the effect does not seem to be that straightforward. One of the first thorough studies of kinetin in flowering plants was done in the early 1960s (2). In this study, tomatoes, cucumbers, and peats were grown in solutions containing different concentrations of kinetin, going from 10-5 to 10-7 molar. The researchers showed that kinetin in solution behaved like a gibberellin inhibitor, directly suppressing plant height as a function of concentration. The plants developed several root abnormalities and changes in their flowering cycle, with kinetin inhibiting flowering in tomatoes, but accelerating it in peas.

You can see in this study that the effective concentration is quite low. The range of kinetin concentrations tested goes from 0.0215mg/L to 2.15 mg/L. These values are quite small compared to the amounts of other hormones, such as IBA or NAA, generally used in plant culture. The concentration of kinetin plays a key role in its effect. A 2008 study on red goosefoot (3) shows the strong impact kinetin concentration can have. These researchers showed that low concentrations of kinetin increased bud formation and increased the height of the apical meristem, while large concentrations inhibited flowering and made the plants shorter.

The entire literature on exogenous kinetin applications is therefore split between apparently contradictory effects. Some studies show effects that are more in line with a gibberellin inhibitor, with shorter plants, while others show stimulation of shoot growth. What you get is dependent on concentration and plant species, making kinetin a hard hormone to use. Use too much and you might compromise flowering and yields, use too little and you might have undesirable elongation effects or simply no effects at all (4, 6).

Kinetin can also have an effect on the sex determination of plants. For example, kinetin induces female flowers in cannabis and can ameliorate the production of male flowers in female plants (12).

Kinetin foliar sprays

The mode of application makes a big difference as well. While most of the root studies I read using kinetin kept their application rates below 3mg/L, many foliar studies explore kinetin application rates that are significantly higher. In this study (9), for example, they perform kinetin applications at 100 ppm. From the foliar studies I read, I found this study (7) particularly interesting. In it, kinetin applications at 2.5, 5, and 10 mg/L were done using foliar spraying on tomato, cucumber, and pepper plants.

The researchers found that the cucumbers had an excellent response to the 2.5 mg/L treatment, with taller plants, larger leaf area, and bigger yields, while they showed negative responses to the 10ppm treatment, with lower yields. While tomatoes showed a similar response, peppers gave their best results with the 10 ppm kinetin sprays. This again highlights not only that plants will respond negatively to excessive doses of kinetin, but that this response is significantly species-dependent.

Environmental conditions

Furthermore, environmental conditions can play a significant role in the effects of kinetin. This study (8) found that kinetin could help rice plants give better yields under carbon dioxide enrichment. However, this worked only for some of the varieties of rice used. For the varieties for which it worked, kinetin applied as a foliar at 10.75 ppm was able to enhance the carbon dioxide fertilization effect.

Effect of kinetin application in several different rice cultivars with or without carbon dioxide enrichment (8)

Other environmental conditions, such as salinity stress and oxidative stress, can also play a big role in the effect of kinetin. As a strong antioxidant, kinetin can help plants deal with oxidative stress (10). It has also been tested many times as a way to deal with salinity-induced stress, for example, see this article on kinetin applications in soybeans (11). In this last study, you can see how kinetin upregulates the gibberellin biosynthesis pathway when it was actively suppressed by the high salinity. Some effects, such as the production of jasmonic acid, are actually opposite in the control and in the salinity-induced environments as a function of kinetin concentration.

Changes in jasmonic acid content for soybean plants grown with or without salt stress and treated with kinetin. Kinetin increases JA when no salt stress is present and decreases it otherwise.

Conclusion

Kinetin can be a powerful and versatile hormone in flowering plants. It can be used to achieve a variety of different effects, including making plants shorter, increasing budding sites, increasing yields, or relieving sources of stress. However, the choice of concentration, method, and application time is critical and can lead to completely opposite effects if not done correctly. Low applications tend to increase growth and leaf area, while larger concentrations will show an effect similar to a gibberellin inhibitor. However, the concentrations that work best for a given plant cannot be known before experimentation is done. However, do consider that higher concentrations consistently lead to decreases in yields.

If you want to use kinetin in your crop, start with a foliar dose at around 2ppm and take note of the effects. From there, you will be able to gauge whether you want to have a higher or lower concentration of kinetin. If the dose is too high, you will start to see some negative effects. Also, time your applications so that they are in line with the effects you want to achieve. If you want to feed kinetin through the roots, use an even lower concentration and make sure your applications are properly timed, avoid having permanent exposure of roots to kinetin, as this is likely to be negative.

Have you ever used kinetin in your crops? What concentrations have you used and what effects have you seen? Let us know in the comments below!




Arduino hydroponics, how to build a sensor station with an online dashboard

In a previous post about Arduino hydroponics, I talked about some of the simplest projects you could build with Arduinos. We also talked about how you could steadily advance towards more complex projects, if you started with the right boards and shields. In this post, I am going to show you how to build a simple sensor station that measures media moisture and is also connected to a free dashboard platform (flespi). The Arduino will take and display readings from the sensor and transmit them over the internet, where we will be able to monitor them using a custom-made dashboard. This project requires no proto-boards or soldering skills.

An Arduino Wifi Rev2 connected to a moisture sensor, transmitting readings to an MQTT server hosted by flespi that generates an online dashboard

The idea of this project is to provide you with a simple start to the world of Arduino hydroponics and IoT interfacing. Although the project is quite simple, you can use it as a base to build on. You can add more sensors, improve the display, create more complicated dashboards, etc.

What you will need

For this build, we are going to use an Arduino Wifi Rev2 and an LCD shield from DFRobot. For our sensor, we are going to be using these low-cost capacitive moisture sensors. This sample project uses only one sensor, but you can connect up to five sensors to the LCD shield. Since this project is going to be connected to the internet, it requires access to an internet-connected WiFi network.

Additionally, you will also need a free flespi account. Go to the flespi page and create an account before you continue with the project. You should select the MQTT option when creating your account since the project uses the MQTT protocol for transmission. After logging into your account, copy the token shown on the “Tokens” page, as you will need it to set up the code.

Copy the token from the “Tokens” menu in flespi

Libraries and code

This project uses the U8g2, ArduinoMQTTClient and WiFiNINA libraries. You should install them before attempting to run the code. The code below is all you need for the project. Make sure you edit the code to input your WiFi SSID, password, and Flespi token, before uploading it to your Arduino. This also assumes you will connect the moisture sensor to the analogue 2 port of your Arduino. You should change the ANALOG_PORT variable to point to the correct port if needed.

#include <Arduino.h>
#include <U8g2lib.h>
#include <WiFiNINA.h>
#include <ArduinoMqttClient.h>
#include <SPI.h>

#define SECRET_SSID "enter your wifi ssid here"
#define SECRET_PASS "enter your password here"
#define FLESPI_TOKEN "enter your flespi token here"
#define ANALOG_PORT  A2

#define MQTT_BROKER    "mqtt.flespi.io"
#define MQTT_PORT      1883

U8G2_ST7565_NHD_C12864_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
float capacitance;
WiFiClient wifiClient;
MqttClient mqttClient(wifiClient);

// checks connection to wifi network and flespi MQTT server
void check_connection()
{
  if (!mqttClient.connected()) {
    WiFi.end();
    WiFi.begin(SECRET_SSID, SECRET_PASS);
    delay(10000);
    mqttClient.setUsernamePassword(FLESPI_TOKEN, "");
    if (!mqttClient.connect(MQTT_BROKER, MQTT_PORT)) {
      Serial.print("MQTT connection failed! Error code = ");
      Serial.println(mqttClient.connectError());
      delay(100);
    }
  }
}

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(4, OUTPUT);
  Serial.begin(9600);
  analogReference(DEFAULT);
  check_connection();
}

void loop() {

  String moisture_string;
  check_connection();

  // read moisture sensor, since this is a wifiRev2 we need to set the reference to VDD
  analogReference(VDD);
  capacitance = analogRead(ANALOG_PORT);
  
  // form the string we will display on the Arduino LCD screen
  moisture_string = String(capacitance) + " mV";
  Serial.println(moisture_string);
  
  // send moisture sensor reading to flespi
  mqttClient.beginMessage("MOISTURE1");
  mqttClient.print(capacitance);
  mqttClient.endMessage();

  // the LCD screen only works if I reinitialize it on every loop
  // I also need to reset the analogReference for it to properly work
  analogReference(DEFAULT);
  u8g2.begin();
  u8g2.setFont(u8g2_font_crox3h_tf); 
  u8g2.clearBuffer();          // clear the internal memory
  u8g2.drawStr(10,15,moisture_string.c_str());  // write something to the internal memory
  u8g2.sendBuffer();          // transfer internal memory to the display

  delay(5000);
  
}

Your Arduino should now connect to the internet, take a reading from the moisture sensor, display it on the LCD shield and send it to flespi for recording. Note that the display of the data on the LCD shield is quite rudimentary. This is because I didn’t optimize the font or play too much with the interface. However, this code should provide you with a good template if you want to refine the display.

Configure Flespi

The next step is to configure flespi to record and display our readings. First, click the MQTT option to the left and then go into the “MQTT Board” (click the button, no the arrow that opens up a new page). Here, you will be able to add a new subscriber. A “subscriber” is an instance that listens to MQTT messages being published and “MOISTURE1” is the topic that our Arduino will be publishing messages to. If you want to publish data for multiple sensors, you should give each sensor its own topic, then add one flespi subscriber for each sensor.

Go to flespi and create a new “subscriber”, set the topic to MOISTURE1

Create the Dashboard

The last step, is to use the “MQTT Titles” menu to create a dashboard. I added a gauge widget to a new dashboard, and then set the topic of it to MOISTURE1, so that its data is updated with our MQTT messages. I set the minimum value to 200; the maximum value to 460; and the low, mid, and high levels to 250, 325, and 400 respectively.

Use the MQTT titles menu to add widgets to a new dashboard

After you finish creating the dashboard, you can then use the “Get link” button, which looks like a link from a chain next to your dashboard’s title. You will need to create an additional token in the “Tokens” menu so that you can use it for the sharing of the dashboard. After you generate the link, it should be publicly available for anyone who is interested. This is the link to the dashboard I created.

Conclusion

You can create a simple and expandable sensor station using an Arduino Wifi Rev2, a capacitive moisture sensor, and an LCD shield. This station can be connected to the internet via Wifi and send its data to flespi, which allows us to create free online dashboards. You can expand on this sensor station by adding more moisture sensors or any other Gravity shield compatible sensors, such as a BME280 sensor for temperature, humidity, and atmospheric pressure readings.