Difference between revisions of "JacobSpringsFarm:Managewater"

From RAWiki
Jump to: navigation, search
(Controlling water pump manually or automatically)
Line 1: Line 1:
==Controlling water pump manually or automatically==
+
The old system failed for a multitude of reasons.
To turn pump on or off or to change settings visit the [http://wiki.jacobsprings.com/managewater.html pump control page]
+
  
 +
1.  The sensor connection on the water tank was broken as it was strung through the feed-through (the hole was too small for the RS9 connector, so the connector was jammed through, but it broke some of the connections).
 +
2.  The water tank sensor ran out of batteries.  Something was wrong with the solar-battery charging setup.
 +
3.  The code on the pump controller may or may not have had a fail-safe for hearing from the water tanks (will need to check).
 +
4.  We were using the wrong type of controller for the power control of the pump. We were using a 10A relay, when in fact we need a 2 hp contactor.  To use a relay, it should be rated for 50A of resistive load.  Anything less, and you risk fusing the relay in the 'open' position, leaving the pump on.  This happens because of the large influx of current during the pump startup, which overheats the relay.  This may have happened to the relay that was out there.
  
<h2>Configure water tank management:</h2>
+
I found this out by <a href="http://electronics.stackexchange.com/questions/196976/relay-ratings-at-120v-and-240v-can-i-use-a-20a-240v-relay-with-a-13a-120v-pump">asking the internet</a>.
  
<p>The water tanks can hold a maximum of 5 feet of water. This form can be used to configure the settings for turning on and off the pump, and for manually turning the pump on or off.</p>
+
The new system uses Particle Photon WIFI devices, but we still need a contactor to switch on and off the pump.  The code for the water tanks and pump control is tested and works, although the battery on the tank sensors seems to be dropping:
  
 +
[[File:JSF_tank_measurement_battery_SOC.png|State of charge of the tank measurement battery]]
  
 +
so I upped the sleep time from 10 mins to 20 mins, and we'll see how it does.
  
<h2>Configure water tank management:</h2>
+
Here's a contactor for $25: http://www.ebay.com/itm/like/272008316055?ul_noapp=true&chn=ps&lpid=82
  
<p>The water tanks can hold a maximum of 5 feet of water. This form can be used to configure the settings for turning on and off the pump, and for manually turning the pump on or off.</p>
+
A new 50A SSR is about $50: http://www.newark.com/crydom/cwu2450p-10/ssr-panel-24-280vac-50a-screw/dp/72W3889.
 
+
Water height:
+
 
+
<htmltag tagname= "iframe" width="450" height="260" style="border: 1px solid #cccccc;" src="http://api.thingspeak.com/channels/54556/charts/6?width=450&height=260&results=60&dynamic=true" form action="https://api.thingspeak.com/update" method="get" enctype="text/plain"></htmltag>
+
 
+
<htmltag tagname= "iframe" action="https://api.thingspeak.com/update" method="get" enctype="text/plain"></htmltag>
+
 
+
api key for changing settings:<br>
+
 
+
<htmltag tagname= "form" input type="text" name="key"></htmltag>
+
 
+
Water minimum height in feet (AC pump will turn on after going below this height):<br>
+
 
+
<input type="text" name="field1" value="2"><br>
+
 
+
Water maximum height in feet (AC pump will turn off after going below this height):<br>
+
 
+
<input type="text" name="field2" value="4" size="50"><br>
+
 
+
Maximum number of hours pump is allowed to be on without stopping for a 5 min break:<br>
+
 
+
<input type="text" name="field3" value="1"><br><br>
+
 
+
<input type="submit" value="Save settings">
+
 
+
</htmltag>
+
 
+
<h2>Run pump manually:</h2>
+
 
+
<form action="https://api.thingspeak.com/update" method="get" enctype="text/plain">
+
 
+
api key for turning on pump (same as above):<br>
+
 
+
<input type="text" name="key"><br>
+
 
+
minutes to turn pump on:<br>
+
 
+
<input type="hidden" name="field4" value="1">
+
 
+
<input type="text" name="field5" value="15"><br><br>
+
 
+
<input type="submit" value="Turn on pump">
+
 
+
</form>
+
 
+
<h2>Stop pump:</h2>
+
 
+
<form action="https://api.thingspeak.com/update" method="get" enctype="text/plain">
+
 
+
api key for turning off pump (same as above):<br>
+
 
+
<input type="text" name="key"><br>
+
 
+
<input type="hidden" name="field6" value="1"><br>
+
 
+
<input type="submit" value="Turn off pump">
+
 
+
</form>
+
 
+
<h2> Data channel links </h2>
+
<a href="https://thingspeak.com/channels/55384">pump settings</a>
+
<a href="https://thingspeak.com/channels/55118">pump status</a>
+
<a href="https://thingspeak.com/channels/54556">pump settings</a>
+
 
+
<h2> Creating the devices </h2>
+
I used 2 ESP8266-based nodemcu [https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=nodemcu+devkit&safe=off&tbm=shop devkits] as the microcontrollers/wifi connections.  The code is [https://github.com/wordsforthewise/esp8266-water-sensor here].<br>
+
 
+
I measured water level with 2 wires and 2 resistors, following [https://harizanov.com/2012/08/diy-soil-moisture-project/ this example].
+
I put the wires into a pvc pipe with holes drilled every foot. 
+
 
+
Then I connected the wires to the microcontroller, did some programming with the open source nodemcu firmware (writing in lua), and pushed and pulled the data to and from thingspeak, using another github library I wrote: https://github.com/wordsforthewise/esp8266-send-thingspeak
+

Revision as of 20:19, 29 October 2015

The old system failed for a multitude of reasons.

1. The sensor connection on the water tank was broken as it was strung through the feed-through (the hole was too small for the RS9 connector, so the connector was jammed through, but it broke some of the connections). 2. The water tank sensor ran out of batteries. Something was wrong with the solar-battery charging setup. 3. The code on the pump controller may or may not have had a fail-safe for hearing from the water tanks (will need to check). 4. We were using the wrong type of controller for the power control of the pump. We were using a 10A relay, when in fact we need a 2 hp contactor. To use a relay, it should be rated for 50A of resistive load. Anything less, and you risk fusing the relay in the 'open' position, leaving the pump on. This happens because of the large influx of current during the pump startup, which overheats the relay. This may have happened to the relay that was out there.

I found this out by <a href="http://electronics.stackexchange.com/questions/196976/relay-ratings-at-120v-and-240v-can-i-use-a-20a-240v-relay-with-a-13a-120v-pump">asking the internet</a>.

The new system uses Particle Photon WIFI devices, but we still need a contactor to switch on and off the pump. The code for the water tanks and pump control is tested and works, although the battery on the tank sensors seems to be dropping:

State of charge of the tank measurement battery

so I upped the sleep time from 10 mins to 20 mins, and we'll see how it does.

Here's a contactor for $25: http://www.ebay.com/itm/like/272008316055?ul_noapp=true&chn=ps&lpid=82

A new 50A SSR is about $50: http://www.newark.com/crydom/cwu2450p-10/ssr-panel-24-280vac-50a-screw/dp/72W3889.