<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Battery-powered irrigation controller]]></title><description><![CDATA[<p dir="auto">Hi, this is still a work in progress but I wanted to share the approach I'm aiming to for a battery-powered irrigation controller in case can be useful to somebody else.</p>
<p dir="auto">Since I have no way to power a device in my garden, I cannot use neither an electrovalve nor a traditional relay controlling a valve (would drain the battery while staying on).</p>
<p dir="auto">I then found the following solenoid valves which works at a low voltage (3.6V) and requires just a pulse to switch (you may find the same also on amazon):</p>
<ul>
<li><a href="http://www.ebay.com/itm/Plastic-Toilet-Closestool-20mm-Male-Thread-Bi-stable-Pulse-Solenoid-Valve-/162277805621?hash=item25c882ce35:g:DCcAAOSw3ihXTc9L" rel="nofollow ugc">http://www.ebay.com/itm/Plastic-Toilet-Closestool-20mm-Male-Thread-Bi-stable-Pulse-Solenoid-Valve-/162277805621?hash=item25c882ce35:g:DCcAAOSw3ihXTc9L</a></li>
<li><a href="http://www.ebay.com/itm/Toilet-Closestool-20mm-Male-Thread-Bi-stable-Pulse-Solenoid-Valve-DC-3-6-/332118670306?hash=item4d53d0bbe2:g:ll8AAOSwA3dYlHDN" rel="nofollow ugc">http://www.ebay.com/itm/Toilet-Closestool-20mm-Male-Thread-Bi-stable-Pulse-Solenoid-Valve-DC-3-6-/332118670306?hash=item4d53d0bbe2:g:ll8AAOSwA3dYlHDN</a></li>
</ul>
<p dir="auto">The principle behind is to switch with positive/negative pulses which I've discovered means simply connecting the two wires to vcc and gnd to open and reverse the wires to close.</p>
<p dir="auto">All good but when I tried to control this with two arduino pins, there was no way to have it working and the reason simply is the solenoid requires a LOT of current (I've measured between 0.6 and 1A) which is of course way more than what the board the provide.</p>
<p dir="auto">After some googling I've discovered I needed a H-bridge (<a href="http://www.instructables.com/id/H-Bridge-on-a-Breadboard/?ALLSTEPS" rel="nofollow ugc">http://www.instructables.com/id/H-Bridge-on-a-Breadboard/?ALLSTEPS</a>) to control programmatically the valve. I've tried building mine on a breadboard with different transistors/resistor but the valve didn't switch due to a massive voltage drop. Once gain due to the current draw.</p>
<p dir="auto">I then bought the following and everything looks working just fine:</p>
<ul>
<li><a href="https://www.aliexpress.com/item/2-DC-motor-drive-module-reversing-PWM-speed-dual-H-bridge-stepper-motor-Mini-victory-L298N/32648692160.html?spm=2114.13010608.0.0.lvAQ6C" rel="nofollow ugc">https://www.aliexpress.com/item/2-DC-motor-drive-module-reversing-PWM-speed-dual-H-bridge-stepper-motor-Mini-victory-L298N/32648692160.html?spm=2114.13010608.0.0.lvAQ6C</a></li>
</ul>
<p dir="auto">I still need to build the rest but this looks like the easy part since I just need to connect the arduino board to IN1 and IN2 and use simple HIGH pulse to open or close.</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.mysensors.org/topic/6598/battery-powered-irrigation-controller</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 20:04:26 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/6598.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Apr 2017 16:05:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Battery-powered irrigation controller on Wed, 26 May 2021 01:14:40 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for sharing the code, it would be nice to have a video demo.</p>
]]></description><link>https://forum.mysensors.org/post/110334</link><guid isPermaLink="true">https://forum.mysensors.org/post/110334</guid><dc:creator><![CDATA[Ivanli]]></dc:creator><pubDate>Wed, 26 May 2021 01:14:40 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Sun, 23 May 2021 16:08:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I have already done all the same plus a flow control to check whether the valve is open or not and... it works perfectly.<br />
++</p>
]]></description><link>https://forum.mysensors.org/post/110310</link><guid isPermaLink="true">https://forum.mysensors.org/post/110310</guid><dc:creator><![CDATA[Gilles BILLARD]]></dc:creator><pubDate>Sun, 23 May 2021 16:08:33 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Sat, 22 May 2021 15:53:45 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/ciaocibai" aria-label="Profile: ciaocibai">@<bdi>ciaocibai</bdi></a>, no big changes to the code, maybe just MY_SMART_SLEEP_WAIT_DURATION_MS set to 1000 to ensure the valve is not impacting receiving/transmitting when triggering. All the rest is the same, just using the latest version of NodeManager. Ah, I also added a push button for turning irrigation on/off directly from the device.<br />
Difficult to say regarding battery usage: since I've placed it far away I had to do some changes in the radio management piece which is draining battery considerably. With this setup 3 AA batteries last for around 2 months which is nothing but I believe this is mainly due to the radio settings.<br />
Just for reference this is the latest version of the code:</p>
<pre><code>

/**********************************
 * MySensors node configuration
 */

// General settings
#define SKETCH_NAME "Irrigation"
#define SKETCH_VERSION "3.2"
//#define MY_DEBUG
#define MY_NODE_ID 6

// RFM69 radio settings
#define MY_RADIO_RFM69
#define MY_IS_RFM69HW
#define MY_RFM69_NEW_DRIVER
#define MY_RFM69_ATC_MODE_DISABLED
#define MY_RFM69_TX_POWER_DBM (10)
#define MY_RFM69_MAX_POWER_LEVEL_DBM (10)

// Advanced settings
#define MY_BAUD_RATE 9600
#define MY_SMART_SLEEP_WAIT_DURATION_MS 1000
#define MY_SPLASH_SCREEN_DISABLED
#define MY_SIGNAL_REPORT_ENABLED

/***********************************
 * NodeManager configuration
 */

#define NODEMANAGER_DEBUG ON
#define NODEMANAGER_INTERRUPTS ON
#define NODEMANAGER_SLEEP ON
#define NODEMANAGER_RECEIVE ON
#define NODEMANAGER_DEBUG_VERBOSE OFF
#define NODEMANAGER_POWER_MANAGER OFF
#define NODEMANAGER_CONDITIONAL_REPORT OFF
#define NODEMANAGER_EEPROM OFF
#define NODEMANAGER_TIME OFF
#define NODEMANAGER_RTC OFF
#define NODEMANAGER_SD OFF
#define NODEMANAGER_HOOKING ON
#define NODEMANAGER_OTA_CONFIGURATION OFF
#define NODEMANAGER_SERIAL_INPUT OFF

// import NodeManager library (a nodeManager object will be then made available)
#include &lt;MySensors_NodeManager.h&gt;

/***********************************
 * Add your sensors
 */

//PowerManager power(5,6);
 
#include &lt;sensors/SensorBattery.h&gt;
SensorBattery battery;

#include &lt;sensors/SensorSignal.h&gt;
SensorSignal signal;

#include &lt;sensors/SensorInterrupt.h&gt;
SensorInterrupt button(3);

#include &lt;sensors/SensorLatchingRelay2Pins.h&gt;
SensorLatchingRelay2Pins valve(5,6);

/***********************************
 * Main Sketch
 */

void toggleValve(Sensor* sensor) {
  valve.toggleStatus();
}

// before
void before() {
	
  /***********************************
   * Configure your sensors
   */

  // battery sensor
  battery.setMinVoltage(3.2);
  battery.setMaxVoltage(4.6);
  battery.setBatteryInternalVcc(false);
  battery.setBatteryPin(A0);
  battery.setBatteryVoltsPerBit(0.00459433);
  battery.setReportIntervalMinutes(30);

  //signal sensor
  signal.setReportIntervalMinutes(30);

  // button
  button.setInterruptHook(&amp;toggleValve);
  button.setInterruptMode(FALLING);
  button.setInvertValueToReport(true);
  nodeManager.setInterruptDebounce(1000);

  // valve
  valve.setSafeguard(120);
  valve.setWaitAfterSet(2000);
  valve.setLegacyMode(true);
  valve.children.get(1)-&gt;setChildId(4);

  // node configuration
  nodeManager.setSleepBetweenSendSleepOrWait(true);
  nodeManager.setSleepSeconds(60*5);
   
  // call NodeManager before routine
  nodeManager.before();
}

// presentation
void presentation() {
  // call NodeManager presentation routine
  nodeManager.presentation();
}

// setup
void setup() {
  // call NodeManager setup routine
  nodeManager.setup();
}

// loop
void loop() {
  // call NodeManager loop routine
  nodeManager.loop();
}

#if NODEMANAGER_RECEIVE == ON
// receive
void receive(const MyMessage &amp;message) {
  // call NodeManager receive routine
  nodeManager.receive(message);
}
#endif

#if NODEMANAGER_TIME == ON
// receiveTime
void receiveTime(unsigned long ts) {
  // call NodeManager receiveTime routine
  nodeManager.receiveTime(ts);
}
#endif
</code></pre>
]]></description><link>https://forum.mysensors.org/post/110301</link><guid isPermaLink="true">https://forum.mysensors.org/post/110301</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Sat, 22 May 2021 15:53:45 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Mon, 17 May 2021 11:34:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user2684" aria-label="Profile: user2684">@<bdi>user2684</bdi></a> I've just been tinkering on a project like this, so happy to find this and learn from you. Wondering if you've made any significant changes to your circuit and code that you could share so we can learn from your updated experience. How long at you getting from 3AA batteries typically? Love the project.</p>
]]></description><link>https://forum.mysensors.org/post/110249</link><guid isPermaLink="true">https://forum.mysensors.org/post/110249</guid><dc:creator><![CDATA[ciaocibai]]></dc:creator><pubDate>Mon, 17 May 2021 11:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Mon, 26 Apr 2021 12:22:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chamroeun-ou" aria-label="Profile: chamroeun-ou">@<bdi>chamroeun-ou</bdi></a> said in <a href="/post/110006">Battery-powered irrigation controller</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user2684" aria-label="Profile: user2684">@<bdi>user2684</bdi></a> I am also planning to build latching valve controller. But my valve is 2" to 4"  and Its coil specifications are as follow:<br />
<strong>V: 6-20Volt DC (optimal is above 9volt)<br />
Capacitance Required: 4700uF<br />
Coil inductance: 90mH<br />
Pulse duration: 20 to 200mili seconds.</strong></p>
<p dir="auto">Do you think h-bridge will work or do you have a better suggestion for this? My goal is also to run the controller on battery and place in farm so it must be waterproof.</p>
</blockquote>
<p dir="auto">HI,<br />
I'm doing quite the same project at the moment; I ordered H bridge and also some flow detectors to check if the bistable valve is really in the desired position ( open not to see a desert, closed not to flood everything)<br />
Powered by 1 solar panel + 9v batteries + load controler + step down converters for Arduino and radio.</p>
]]></description><link>https://forum.mysensors.org/post/110053</link><guid isPermaLink="true">https://forum.mysensors.org/post/110053</guid><dc:creator><![CDATA[Gilles BILLARD]]></dc:creator><pubDate>Mon, 26 Apr 2021 12:22:43 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Mon, 26 Apr 2021 08:55:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chamroeun-ou" aria-label="Profile: chamroeun-ou">@<bdi>chamroeun-ou</bdi></a> If you need to reverse polarity then a H bridge would be good - I would aim for 12V (maybe a lead acid battery with solar panel and small charge controler). This assumes a coil pules reversal to change over the relay, if it is dual coil relay then it will be different, but we don't have that info. Also note the coil resistance and therefore current needed. A 6681FNG H bridge would be good as it is rated up to 15V and handles 1A with ease...</p>
]]></description><link>https://forum.mysensors.org/post/110052</link><guid isPermaLink="true">https://forum.mysensors.org/post/110052</guid><dc:creator><![CDATA[skywatch]]></dc:creator><pubDate>Mon, 26 Apr 2021 08:55:19 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Sun, 25 Apr 2021 20:12:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user2684" aria-label="Profile: user2684">@<bdi>user2684</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/skywatch" aria-label="Profile: skywatch">@<bdi>skywatch</bdi></a> thank you for your feedback! :)</p>
]]></description><link>https://forum.mysensors.org/post/110049</link><guid isPermaLink="true">https://forum.mysensors.org/post/110049</guid><dc:creator><![CDATA[Andreas Menzel]]></dc:creator><pubDate>Sun, 25 Apr 2021 20:12:43 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Tue, 20 Apr 2021 15:03:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user2684" aria-label="Profile: user2684">@<bdi>user2684</bdi></a> I am also planning to build latching valve controller. But my valve is 2" to 4"  and Its coil specifications are as follow:<br />
<strong>V: 6-20Volt DC (optimal is above 9volt)<br />
Capacitance Required: 4700uF<br />
Coil inductance: 90mH<br />
Pulse duration: 20 to 200mili seconds.</strong></p>
<p dir="auto">Do you think h-bridge will work or do you have a better suggestion for this? My goal is also to run the controller on battery and place in farm so it must be waterproof.</p>
]]></description><link>https://forum.mysensors.org/post/110006</link><guid isPermaLink="true">https://forum.mysensors.org/post/110006</guid><dc:creator><![CDATA[chamroeun ou]]></dc:creator><pubDate>Tue, 20 Apr 2021 15:03:51 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Mon, 12 Apr 2021 16:15:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andreas-menzel" aria-label="Profile: Andreas-Menzel">@<bdi>Andreas-Menzel</bdi></a> I personally tend to replace the batteries early enough. I also have at the controller level a couple of safety checks with are ensuring 1) the "close" message is acknowledged by the sensor and if not resend it again 2) a humidity sensor in the ground checking if it is still irrigating after e.g. 2-3 hours the valve is supposed to be closed.<br />
I've noticed if the battery is almost over and unable to close the valve once, it will likely succeed when retrying. Then of course batteries have to be changed.<br />
Over the years I've refined this old project over and over mainly making the capacitor bigger since the valve would otherwise drain so much current to dramatically shorten the battery's life. But this is still border line for the capability of a battery powered sensor I believe.</p>
]]></description><link>https://forum.mysensors.org/post/109905</link><guid isPermaLink="true">https://forum.mysensors.org/post/109905</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Mon, 12 Apr 2021 16:15:24 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Fri, 02 Apr 2021 09:19:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andreas-menzel" aria-label="Profile: Andreas-Menzel">@<bdi>Andreas-Menzel</bdi></a> That is an old thread, but my thoughts would be to send battery level back often enough so you have time to change it, or better yet send battery level and add solar panel to recharge battery. A lot will depend on usage frequency, temperature, levels of sunlight etc...</p>
<p dir="auto">You could also add a flow sensor or pressure switch to alert you if the water does not turn off.</p>
]]></description><link>https://forum.mysensors.org/post/109750</link><guid isPermaLink="true">https://forum.mysensors.org/post/109750</guid><dc:creator><![CDATA[skywatch]]></dc:creator><pubDate>Fri, 02 Apr 2021 09:19:22 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Thu, 01 Apr 2021 20:47:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user2684" aria-label="Profile: user2684">@<bdi>user2684</bdi></a> hi,<br />
Thank you for sharing your project here!!! I've been looking quite a long time until I found it :)</p>
<p dir="auto">I have a question regarding safety problem. In case the battery drops after opening below the voltage needed to close it again the water would not stop. Do you have an idea how to solve this problem?<br />
Or do you just replace the batteries "early" enough?</p>
]]></description><link>https://forum.mysensors.org/post/109747</link><guid isPermaLink="true">https://forum.mysensors.org/post/109747</guid><dc:creator><![CDATA[Andreas Menzel]]></dc:creator><pubDate>Thu, 01 Apr 2021 20:47:42 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Mon, 04 Jun 2018 22:08:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ionu" aria-label="Profile: ionu">@<bdi>ionu</bdi></a> very sorry for missing your reply for more than 6 months but I didn't get any notification :-( Your understanding is correct, if you just connect the + and - of the battery to the valve you should hear a "click" and if you reverse the wire, another "click". I wonder if that battery would be powerful enough, I've noticed that valve drains really a lot of current (&gt;1A) when triggering. Try with AA batteries at first, just to check if the valve is functioning.</p>
<p dir="auto">My project has evolved over the time, let me share a picture below:<br />
<img src="/assets/uploads/files/1528148462209-irrigation.png" alt="0_1528148437750_irrigation.png" class=" img-fluid img-markdown" /></p>
<ul>
<li>1: is the amazing EasyPCB from <a class="plugin-mentions-user plugin-mentions-a" href="/user/sundberg84" aria-label="Profile: sundberg84">@<bdi>sundberg84</bdi></a> RFM69 version</li>
<li>2: since the valve works at 3.7v I'm powering the project with 3 AA batteries. I've noticed the valve works just fine with 4.5v when full, till down to around 3v</li>
<li>3: this is a step down regulator for providing 3.3v to the arduino and the radio. I've soldered it there on the EasyPCB (where a booster is supposed to be soldered) since I needed to use the voltage divider which is not available when using the voltage regulator spot. For this reason the battery is connected to the "&lt;=3.3" plug</li>
<li>4: this is the voltage divider for measuring the battery, since we have 4.5v I've coupled the 1M with a 300k</li>
<li>5: this is the bi-stable valve. Can be found on amazon for 5 euros. Ships from china of course</li>
<li>6: this is a 2200uF capacitor placed between the + and the - of the H bridge controlling the valve. Without it, the huge current drain would destroy the battery shortly</li>
<li>7: this is an analog rain sensor. It is powered on by an arduino pin so to save battery while sleeping</li>
<li>8: this is an analog soil moisture. It is powered on by an arduino pin so to save battery while sleeping</li>
<li>9: this is a button to manually turn the valve on or off. It is connected to the arduino pin 3</li>
<li>10: this is the H-bridge capable of controlling the valve since rated at 2A</li>
</ul>
<p dir="auto">The code I'm using, based on NodeManager, is the following:</p>
<pre><code>/**********************************
 * MySensors node configuration
 */

// General settings
#define SKETCH_NAME "Irrigation"
#define SKETCH_VERSION "2.0"
#define MY_NODE_ID 6

// RFM69 radio settings
#define MY_RADIO_RFM69
#define MY_IS_RFM69HW
#define MY_RFM69_NEW_DRIVER

// Advanced settings
#define MY_BAUD_RATE 9600
#define MY_SMART_SLEEP_WAIT_DURATION_MS 1000
#define MY_SPLASH_SCREEN_DISABLED

/***********************************
 * NodeManager modules for supported sensors
 */

#define USE_BATTERY
#define USE_SIGNAL
#define USE_CONFIGURATION
#define USE_ANALOG_INPUT
#define USE_DIGITAL_OUTPUT
#define USE_INTERRUPT

/***********************************
 * NodeManager built-in features
 */

// Enable/disable NodeManager's features
#define FEATURE_DEBUG ON
#define FEATURE_POWER_MANAGER ON
#define FEATURE_INTERRUPTS ON
#define FEATURE_CONDITIONAL_REPORT OFF
#define FEATURE_EEPROM OFF
#define FEATURE_SLEEP ON
#define FEATURE_RECEIVE ON
#define FEATURE_TIME OFF
#define FEATURE_RTC OFF
#define FEATURE_SD OFF
#define FEATURE_HOOKING ON

/***********************************
 * Load NodeManager Library
 */

#include "NodeManagerLibrary.h"
NodeManager node;

/***********************************
 * Add your sensors below
 */

// built-in sensors
SensorBattery battery(node);
SensorConfiguration configuration(node);
SensorSignal signal(node);
PowerManager power(-1,A1,300);

// Attached sensors
SensorRain rain(node,A4);
SensorSoilMoisture soil(node,A5);
SensorInterrupt button(node,3);
SensorLatchingRelay2Pins valve(node,5,6);

/***********************************
 * Main Sketch
 */

void toggleValve(Sensor* sensor) {
  valve.toggleStatus();
}

// before
void before() {
  // setup the serial port baud rate
  Serial.begin(MY_BAUD_RATE);
  /*
  * Configure your sensors below
  */

  // battery sensor
  battery.setMinVoltage(3.2);
  battery.setMaxVoltage(4.6);
  battery.setBatteryInternalVcc(false);
  battery.setBatteryPin(A0);
  battery.setBatteryVoltsPerBit(0.00459433);
  battery.setReportIntervalMinutes(30);

  //signal sensor
  signal.setReportIntervalMinutes(30);

  // valve
  valve.setSafeguard(60);
  valve.setWaitAfterSet(2000);
  valve.setLegacyMode(true);

  // button
  button.setInterruptHook(&amp;toggleValve);
  button.setInitialValue(HIGH);
  button.setInterruptMode(FALLING);
  button.setInvertValueToReport(true);
  node.setInterruptDebounce(1000);
  
  // rain sensor
  rain.setPowerManager(power);
  rain.setReportIntervalMinutes(10);
  rain.setRangeMin(300);
  rain.setReverse(true);

  // soil moisture sensor
  soil.setPowerManager(power);
  soil.setReportIntervalMinutes(10);
  soil.setRangeMin(500);

  // node configuration
  node.setSleepSeconds(60);
 
  /*
  * Configure your sensors above
  */
  node.before();
}

// presentation
void presentation() {
  // call NodeManager presentation routine
  node.presentation();
}

// setup
void setup() {
  // call NodeManager setup routine
  node.setup();
}

// loop
void loop() {
  // call NodeManager loop routine
  node.loop();
}

#if FEATURE_RECEIVE == ON
// receive
void receive(const MyMessage &amp;message) {
  // call NodeManager receive routine
  node.receive(message);
}
#endif

#if FEATURE_TIME == ON
// receiveTime
void receiveTime(unsigned long ts) {
  // call NodeManager receiveTime routine
  node.receiveTime(ts);
}
#endif
</code></pre>
<p dir="auto">Rain and soil moisture are connected to A4 and A5, reports every 10 minutes and are powered on just before taking the measure through pin A1. The button through the hooking function toggles the valve, when pressed. The valve (or better the H-bridge) is connected through pin 5 and 6 (off and on). The node wakes up every minute to pick up from the controller new orders (using smart sleep). There is also a safeguard of 60 minutes (if something goes wrong with the communication, irrigation is turned off regardless after 60 minutes).</p>
]]></description><link>https://forum.mysensors.org/post/90750</link><guid isPermaLink="true">https://forum.mysensors.org/post/90750</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Mon, 04 Jun 2018 22:08:20 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Sun, 10 Dec 2017 07:53:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user2684" aria-label="Profile: user2684">@<bdi>user2684</bdi></a> How is your project going now? I am trying to use the same valves and diver board but I can not seem to get it to work. Could you answer some questions for me in order to help me get it to work.</p>
<p dir="auto">Am i right in saying that if I connect the power leads of the valve to a + source (Li 18650 4.1v 2500ma) it should open the valve and the if I reverse the the leads it should close the valve?</p>
]]></description><link>https://forum.mysensors.org/post/81586</link><guid isPermaLink="true">https://forum.mysensors.org/post/81586</guid><dc:creator><![CDATA[ionu]]></dc:creator><pubDate>Sun, 10 Dec 2017 07:53:55 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Sat, 05 Aug 2017 13:33:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi, just to spend a final word on this project. Despite the battery consumption is not that great (even if I believe by better sizing the capacitor the result would be much better), three AA battery lasted for more than two months powering the valve on and off twice a day and checking in with the controller every minute. I've changed the battery recently just because the valve operates at 3.6v and I was unsure there was enough power to still perform in a good shape for long. Below the battery discharging trend:</p>
<p dir="auto"><img src="/assets/uploads/files/1501939555808-untitled-resized.png" alt="0_1501939556969_Untitled.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mysensors.org/post/73103</link><guid isPermaLink="true">https://forum.mysensors.org/post/73103</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Sat, 05 Aug 2017 13:33:54 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Wed, 31 May 2017 13:08:52 GMT]]></title><description><![CDATA[<p dir="auto">Hi all, I just wan't to share with You my idea about controlling bi-stable solenoids (let it be valves or latching relay, doesn't matter). And I wonder why nowbody considering this solution. I'm talking about this kind of circuit <a href="http://www.avrfreaks.net/sites/default/files/Latching%20relay%20driver.jpg" rel="nofollow ugc">http://www.avrfreaks.net/sites/default/files/Latching relay driver.jpg</a>. And those two transistors that have to be controlled with two pins may be replaced with a push-pull driver like L293 (or L203DD which has built-in clamping diodes) which can be cotrolled with just one pin (HIGH - open; LOW - closed). This L293 will make the hardware interface the same as with monostable relays.<br />
So pros are:</p>
<ol>
<li>simple circuit (relay, capacitor, L293 IC and additional capacitor for power supply filtering)</li>
<li>simple interface (use it like normal relay)</li>
<li>safe - bi-stable solenoids have maximum pulse with, with this circuit there is no possibility to cross that requirement (the pulse width is defined by the RC constant of the capacitor and solenoid)</li>
</ol>
<p dir="auto">Cons are:</p>
<ol>
<li>the capacitor between relay and the ground has to be quite large about 1-2mF so its size is significant</li>
<li>the l293 ic maybe not very cheap</li>
</ol>
]]></description><link>https://forum.mysensors.org/post/68109</link><guid isPermaLink="true">https://forum.mysensors.org/post/68109</guid><dc:creator><![CDATA[rozpruwacz]]></dc:creator><pubDate>Wed, 31 May 2017 13:08:52 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Wed, 31 May 2017 11:41:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tmaster" aria-label="Profile: Tmaster">@<bdi>Tmaster</bdi></a> thanks, I'll give it a try as well! regarding the voltage regulator, is there anything able to provide &gt;1A as output as far as you know? Thanks</p>
]]></description><link>https://forum.mysensors.org/post/68106</link><guid isPermaLink="true">https://forum.mysensors.org/post/68106</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Wed, 31 May 2017 11:41:47 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Wed, 31 May 2017 09:33:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user2684" aria-label="Profile: user2684">@<bdi>user2684</bdi></a> said in <a href="/post/68090">Battery-powered irrigation controller</a>:</p>
<blockquote>
<p dir="auto">Regarding the abnormal battery consumption, I placed two 330uF capacitor between gnd and Vcc of the H-bridge powering the valve and they seem to help. After a few on and off the battery went from 4.70V to 4.68V so it was not affected at all. Not sure if it is a good idea or not but I thought could help the valve to be more gentle against the battery. I've also added a sleep of two seconds just after the digitalOutput pulse so to allow the board not to suffer of the voltage drop before sending the ack back to the controller (it was sometimes lost before).</p>
</blockquote>
<p dir="auto">AA bateries can't handle much current. You are feeding an solenoid (coil) that probably requires 1A for switch state and it drains too much from aa battery.   Buy a 12v /7a  battery from chinese brand  for 10€ and use a voltage regulator from ebay and you have you problems gone.</p>
]]></description><link>https://forum.mysensors.org/post/68097</link><guid isPermaLink="true">https://forum.mysensors.org/post/68097</guid><dc:creator><![CDATA[Tmaster]]></dc:creator><pubDate>Wed, 31 May 2017 09:33:18 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Wed, 31 May 2017 08:18:52 GMT]]></title><description><![CDATA[<p dir="auto">Yet another quick update on this. I think I was able to mitigate somehow the few issues I had:</p>
<ul>
<li>Regarding the abnormal battery consumption, I placed two 330uF capacitor between gnd and Vcc of the H-bridge powering the valve and they seem to help. After a few on and off the battery went from 4.70V to 4.68V so it was not affected at all. Not sure if it is a good idea or not but I thought could help the valve to be more gentle against the battery. I've also added a sleep of two seconds just after the digitalOutput pulse so to allow the board not to suffer of the voltage drop before sending the ack back to the controller (it was sometimes lost before).</li>
<li>Regarding the pressure lost at the valve, I was able to gain this pressure somewhere else. First of all I bought new, high quality irrigation sprinklers and they cover with exactly the same pressure almost 50% more ground than the old one. Then I removed a few junctions which were losing additional pressure. Now at least it is usable since I have full coverage of the garden (about 100 square meters) with a single sprinkler.</li>
<li>Regarding the safeguard, I've added a very simple timer to my sketch. When a valve is turned on, the time starts (it just counts the number of cycles to make it simple). If too many cycles have passed by and the valve is still on, turns it off automatically.</li>
</ul>
<p dir="auto">Bottom line, I was about to give up with this but now I'm back on track :)</p>
]]></description><link>https://forum.mysensors.org/post/68090</link><guid isPermaLink="true">https://forum.mysensors.org/post/68090</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Wed, 31 May 2017 08:18:52 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Sun, 28 May 2017 13:13:48 GMT]]></title><description><![CDATA[<p dir="auto">Just to share this pointer from a similar project: <a href="http://rayshobby.blogspot.it/2010/06/minty-water-valve-controller.html" rel="nofollow ugc">http://rayshobby.blogspot.it/2010/06/minty-water-valve-controller.html</a>. It is actually way beyond my knowledge to understand all the steps but I guess could be useful for somebody here.</p>
<p dir="auto">Changing valve and stepping up to 24v seems too complex for my requirements but adding a big capacitor could be something worth trying also here.</p>
]]></description><link>https://forum.mysensors.org/post/67834</link><guid isPermaLink="true">https://forum.mysensors.org/post/67834</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Sun, 28 May 2017 13:13:48 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Tue, 23 May 2017 16:24:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tmaster" aria-label="Profile: Tmaster">@<bdi>Tmaster</bdi></a> that's my issue, I don't have power there so I was trying to find out a way to have this working with batteries. But regardless of the issues I'm experiencing, the idea to add an additional safe guard is definitely great, thanks again for the advice!</p>
]]></description><link>https://forum.mysensors.org/post/67478</link><guid isPermaLink="true">https://forum.mysensors.org/post/67478</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Tue, 23 May 2017 16:24:27 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Tue, 23 May 2017 16:22:58 GMT]]></title><description><![CDATA[<p dir="auto">Timeout is a nice safe feature, but also could be that if you loose connection to controller for more than X minutes it should shut everything down.</p>
]]></description><link>https://forum.mysensors.org/post/67477</link><guid isPermaLink="true">https://forum.mysensors.org/post/67477</guid><dc:creator><![CDATA[gohan]]></dc:creator><pubDate>Tue, 23 May 2017 16:22:58 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Tue, 23 May 2017 16:17:52 GMT]]></title><description><![CDATA[<p dir="auto">the only desvantagem you have is ; not having main power there .Because if you have it you coud use standart 24v AC irrigation valves ,controlled by 5vDC as i did and then if power fails it just goes off, because they need current(+-200mha) for work. And they are cheap. the bi state 9v version cost more than 30€  and i never use it</p>
]]></description><link>https://forum.mysensors.org/post/67476</link><guid isPermaLink="true">https://forum.mysensors.org/post/67476</guid><dc:creator><![CDATA[Tmaster]]></dc:creator><pubDate>Tue, 23 May 2017 16:17:52 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Tue, 23 May 2017 16:07:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tmaster" aria-label="Profile: Tmaster">@<bdi>Tmaster</bdi></a> that's a very good advice, especially if keeping it open for too long could create any damage. But I'd rather keep the logic on the controller otherwise I'd need to flash a new sketch on a weekly basis. The timeout approach would probably be more close to my requirements, even if millis() doesn't work for sleeping nodes, I can still work with the time as you suggested.<br />
Another issue I'm experimenting with this valve is the loss of pressure, which is of course expected but it is so strong I cannot cover my garden correctly :-/ So an alternative I was evaluating is to hack my legacy irrigation controller which is very basic but I need to find a way to handle the rotary encoder. But on the same time I don't want to move away so soon from those valves ;-)</p>
]]></description><link>https://forum.mysensors.org/post/67469</link><guid isPermaLink="true">https://forum.mysensors.org/post/67469</guid><dc:creator><![CDATA[user2684]]></dc:creator><pubDate>Tue, 23 May 2017 16:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to Battery-powered irrigation controller on Tue, 23 May 2017 15:55:55 GMT]]></title><description><![CDATA[<p dir="auto">i think that AA batteries hardly approach the 1A discharge if its your selenoid rate.<br />
Another thing you can change is NEVER trust on a incoming signal to shutdown you valve. if power fails or signal is missing ,you selenoid will be open all life because gw never send the signal in time .</p>
<p dir="auto">what i did is: call time from GW , store it on irrigation node ,and then after time out(2 hours) it shuts off alone .in fact i don't have any code to control valves from gw . Gw only receive status for domotics. all time for valves On and Off its on the node.<br />
See the timeaware sensor example to know how get time from gw and how handle it<br />
you can just use for ex:<br />
if(hour()==09) {  //if its 9 hour  AM  TURN ON<br />
digitalwrite (valve, HIGH)<br />
}<br />
if(hour()==10) {  //if its 10 hour  AM  TURN OFF<br />
digitalwrite (valve,LOW)<br />
}</p>
<p dir="auto">Or on shutdown implement a "time out"timer (if millis have been passed turn off) like on "blink without delay" example</p>
<p dir="auto"><a href="https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/TimeAwareSensor/TimeAwareSensor.ino" rel="nofollow ugc">https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/TimeAwareSensor/TimeAwareSensor.ino</a></p>
]]></description><link>https://forum.mysensors.org/post/67467</link><guid isPermaLink="true">https://forum.mysensors.org/post/67467</guid><dc:creator><![CDATA[Tmaster]]></dc:creator><pubDate>Tue, 23 May 2017 15:55:55 GMT</pubDate></item></channel></rss>