<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>day64 &amp;mdash; Gerrit Niezen</title>
    <link>https://gerritniezen.com/tag:day64</link>
    <description>Maker of open-source software and hardware.</description>
    <pubDate>Sat, 02 May 2026 11:37:44 +0000</pubDate>
    <image>
      <url>https://i.snap.as/aMPXpIot.png</url>
      <title>day64 &amp;mdash; Gerrit Niezen</title>
      <link>https://gerritniezen.com/tag:day64</link>
    </image>
    <item>
      <title>Hydroponics: Setting flood interval and duration</title>
      <link>https://gerritniezen.com/hydroponics-setting-flood-interval-and-duration?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[For my ebb-and-flood (also called flood-and-drain, or ebb-and-flow) hydroponics system, I need to pump water over the flood table at regular intervals. The time between flooding depends on various things, of which the growing medium is the deciding factor:&#xA;&#xA;Expanded clay pebbles: 4 to 8 times a day (every 2 to 4 hours)&#xA;Coconut coir: 3 to 5 times a day (every 3 to 5 hours)&#xA;Rockwool: 1 to 5 times a day (once a day to every 3 hours)&#xA;&#xA;I&#39;m going to put rockwool starter cubes in expanded clay pebbles, so every 3 hours sounds like a good idea. I then also need to figure out how long to flood the table for, which depends on how quickly the pump floods the table. Let&#39;s say it&#39;s around 30 seconds, which then leads to the following Espruino script for my Pixl.js:&#xA;&#xA;const floodIntervalMinutes = 180;&#xA;const floodDurationSeconds = 30;&#xA;&#xA;const pumpPin = B15;&#xA;const waterSensorPin = B3;&#xA;&#xA;setInterval(() =  {&#xA;  if (!digitalRead(waterSensorPin)) {&#xA;    console.log(&#39;Water detected!&#39;);&#xA;    digitalWrite(pumpPin, 0);&#xA;  }&#xA;}, 1000);&#xA;&#xA;setInterval(() =  {&#xA;  // TODO: check if daylight&#xA;  // TODO: max delay between floodings&#xA;&#xA;  digitalWrite(pumpPin, 1);&#xA;&#xA;  setTimeout(() =  {&#xA;    digitalWrite(pumpPin, 0);&#xA;  }, floodDurationSeconds  1000);&#xA;&#xA;}, floodIntervalMinutes  60 * 1000);&#xA;&#xA;function onInit() {&#xA;  pinMode(waterSensorPin, &#39;input&#39;);&#xA;  pinMode(pumpPin, &#39;output&#39;);&#xA;&#xA;  E.setTimeZone(1);&#xA;  console.log(&#39;Current time:&#39;, (new Date()).toString());&#xA;  digitalWrite(pumpPin, 0); // make sure pump is off&#xA;}&#xA;&#xA;Note that I also added a water sensor for switching off the pump in case there&#39;s an overflow.&#xA;&#xA;What I still need to do is to add a light sensor to check if there&#39;s daylight, and then only flood during daylight hours. I then also need add a maximum delay between floodings, so that the plants don&#39;t go for more than 12 hours without water. Thanks to ChilliChump for these ideas.&#xA;&#xA;---&#xA;I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.&#xA;&#xA;#100DaysToOffload #day64 #hydroponics&#xA;&#xA;iComment on this post/i&#xD;&#xA;div id=&#34;cusdisthread&#34;/div]]&gt;</description>
      <content:encoded><![CDATA[<p>For my ebb-and-flood (also called flood-and-drain, or ebb-and-flow) hydroponics system, I need to pump water over the flood table at regular intervals. The time between flooding depends on various things, of which the <a href="https://www.leaffin.com/flood-drain-hydroponics-watering-schedule/">growing medium is the deciding factor</a>:</p>
<ul><li>Expanded clay pebbles: 4 to 8 times a day (every 2 to 4 hours)</li>
<li>Coconut coir: 3 to 5 times a day (every 3 to 5 hours)</li>
<li>Rockwool: 1 to 5 times a day (once a day to every 3 hours)</li></ul>

<p>I&#39;m going to put rockwool starter cubes in expanded clay pebbles, so every 3 hours sounds like a good idea. I then also need to figure out how long to flood the table for, which depends on how quickly the pump floods the table. Let&#39;s say it&#39;s around 30 seconds, which then leads to the following Espruino script for my <a href="http://www.espruino.com/Pixl.js">Pixl.js</a>:</p>

<pre><code class="language-js">const floodIntervalMinutes = 180;
const floodDurationSeconds = 30;

const pumpPin = B15;
const waterSensorPin = B3;

setInterval(() =&gt; {
  if (!digitalRead(waterSensorPin)) {
    console.log(&#39;Water detected!&#39;);
    digitalWrite(pumpPin, 0);
  }
}, 1000);

setInterval(() =&gt; {
  // TODO: check if daylight
  // TODO: max delay between floodings

  digitalWrite(pumpPin, 1);

  setTimeout(() =&gt; {
    digitalWrite(pumpPin, 0);
  }, floodDurationSeconds * 1000);

}, floodIntervalMinutes * 60 * 1000);

function onInit() {
  pinMode(waterSensorPin, &#39;input&#39;);
  pinMode(pumpPin, &#39;output&#39;);

  E.setTimeZone(1);
  console.log(&#39;Current time:&#39;, (new Date()).toString());
  digitalWrite(pumpPin, 0); // make sure pump is off
}
</code></pre>

<p>Note that I also added a <a href="https://wiki.seeedstudio.com/Grove-Water_Sensor/">water sensor</a> for switching off the pump in case there&#39;s an overflow.</p>

<p>What I still need to do is to add a light sensor to check if there&#39;s daylight, and then only flood during daylight hours. I then also need add a maximum delay between floodings, so that the plants don&#39;t go for more than 12 hours without water. Thanks to <a href="https://www.chillichump.com/hydroponics-automation-ebb-flood-basic/">ChilliChump</a> for these ideas.</p>

<hr/>

<p>I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting <a href="https://100daystooffload.com">https://100daystooffload.com</a>.</p>

<p><a href="https://gerritniezen.com/tag:100DaysToOffload" class="hashtag"><span>#</span><span class="p-category">100DaysToOffload</span></a> <a href="https://gerritniezen.com/tag:day64" class="hashtag"><span>#</span><span class="p-category">day64</span></a> <a href="https://gerritniezen.com/tag:hydroponics" class="hashtag"><span>#</span><span class="p-category">hydroponics</span></a></p>

<p><i>Comment on this post</i>
<div id="cusdis_thread" id="cusdis_thread"></div></p>
]]></content:encoded>
      <guid>https://gerritniezen.com/hydroponics-setting-flood-interval-and-duration</guid>
      <pubDate>Wed, 23 Sep 2020 14:00:56 +0000</pubDate>
    </item>
  </channel>
</rss>