|
Post by papa on Nov 11, 2016 1:35:05 GMT
On my to-do list was a node to monitor the water level in my sump pump hole. I also wanted to experiment with an Ultrasonic Sensor, an HC_SR04. One “cylinder” of an ultrasonic sensor sends a pulse of “sound” (ultra, pitched beyond human hearing range) & the other “cylinder” receives the sound echoed back & the sensor senses how long the two way journey took. Using sound’s speed, one can calculate the distance between the sensor & a surface in its path that reflects its sound. This works nicely for measuring the distance to relatively hard, flat surfaces including still water. In my experience, measuring distances to “fuzzy” surfaces like water that is trickling & sometimes surging in a sump hole is more challenging & takes more coding. I want to measure the (changing) distance from the hole’s top to the water’s surface; set a code that indicates if the water level is OK, too low, or too high; AND be notified if the water level is not OK. What I got has a somewhat limited accuracy (because of the “fuzzy” water surface), but it seems reliable enough to get what I wanted. This node assumes a computourist style gateway unless you are using a Wi-Fi module to connect to OpenHAB (not covered in this documentation). To build & program the gateway, see this thread at the Oct 8, 2015 at 6:40pm post. Installation of OpenHAB & MQTT (Mosquitto) is needed to benefit fully from this Sump Monitor Node. If you need help doing this see the Nov 11, 2016 at 2:57pm post below. Note: You can use an ultrasonic node to measure distances to other things besides the top surface of sump hole water. In fact, measuring the distance to hard surfaces is more reliable. In the Nov 11, 2016 at 2:34pm post below, see the bold, blue text for one hint.
|
|
|
Post by papa on Nov 11, 2016 1:36:06 GMT
Build a Sump Monitor End Node (on a prototyping shield) with DHT temp/humidity sensor & Ultrasonic Distance Sensor
Next build the Sump Monitor Node itself which will include a DHT11 sensor & an HC_SR04 Ultrasonic sensor. The DHT sensor not only provides temperature / humidity data for their own sake, but also helps the accuracy of the Ultrasonic sensor (sound’s speed varies according to temperature.) Parts needed for each Sump Monitor end node: You need a Buono Uno Arduino compatible switched to 3.3 volt mode. (Or instead use a regular Arduino Uno compatible hacked to 3.3 volt operation like this.) You also need an Arduino prototyping shield with soldering strips in the middle originally intended for mounting Integrated Circuit packages (pics below show its top & bottom). You also need an HC_SR04 Ultrasonic Sensor (3 volt compatible or 5 volt compatible. See notes with schematics below.) You also need four 10cm Female To Female Dupont Cables (red & black, plus 2 more like yellow & green). You also need: a DHT11 temperature / humidity sensor, a supply of 22 gauge insulated wire (at least red, black, plus 2 more like yellow & green) plus tools & solder to assemble the above. Somewhat optional but recommended: heat shrink tubing. You also need one 5-socket strip of break away female headers. Here's a source for Break Away Female Headers (.1" spacing). These have female sockets on top & male pins for installation on the bottom. To use: Count how many female sockets you need (5), then pull the male pin beneath the next socket (#6). Cut a small groove around all sides of that "wasted" socket. Put a set of pliers on each side of the groove. Gently twist to break the strip at the groove. Trim off the wasted socket remains.
|
|
|
Post by papa on Nov 11, 2016 1:41:31 GMT
Build a Sump Monitor End Node (on a prototyping shield) Continued
<< If you do not yet have an HC_SR04 Ultrasonic sensor or if your Arduino compatible circuit canNOT supply 5 volts, buy a newer version HC_SR04 Ultrasonic sensor that can work with 3 volts & use this schematic. << Use this schematic if you already have an HC_SR04 Ultrasonic sensor that needs a 5 volt power supply & your Arduino compatible circuit (like a Buono Uno) can supply the 5 volts.
|
|
|
Post by papa on Nov 11, 2016 1:47:10 GMT
Build a Sump Monitor End Node (on a prototyping shield) Continued
In this thread, the Oct 10, 2015 at 8:01am post, follow the instructions from “ Prepare a DHT11 Temperature / Humidity sensor” to the end of the post. << This will also prepare the RFM69 radio for installation. To the ultrasonic sensor pins, connect the red dupont cable to vcc, black to gnd, green? to TRIG, & yellow? to ECHO.
|
|
|
Post by papa on Nov 11, 2016 1:50:07 GMT
Build a Sump Monitor End Node (on a prototyping shield) Continued
<< Top of Prototyping Shield (labels added by Papa) << Bottom of Prototyping Shield (labels added by Papa) 1) In the following text & above pics, labels starting with “A” (NOT “ Arduino A”) or “B” are ones I added to indicate places on the Prototype Shield. Labels like “D8” refer to an Arduino digital connection labeled such on the Arduino compatible & on the Prototype Shield. (Many of the labels are NOT used for this node.) 2) Female header sockets A1 & power strip A2 will be changed from 5 volts to 3.3 volts. Important: To first remove those from 5 volt, cut trace B1 on the shield's bottom. 3) [ You may want to review soldering techniques described here at the Sept. 28, 6:52pm post & the break away header techniques at the Oct. 10, 8:01am post. The aim is to help stabilize components to be soldered, sufficiently solder components (enough for a good connection, not getting solder on nearby locations), & to assemble things in an order to provide the most possible working space on the shield. An Arduino compatible & a plug in prototyping shield have 3 GND sockets & only one each of these sockets: 3.3 volts, D0-D13. However, for what an End Node schematic requires, those Arduino connections are not necessarily enough or in a convenient location. Soldering break away headers on the shield's soldering strips will increase access to needed Arduino connections. Now to continue the assembly.] 4) Prepare a break away header with 5 sockets. Into the A9 red rectangle on the shield's top, insert the 5 socket header. Hold the new, still loose header in place with strips of cellophane tape that cross at right angles. Turn shield to the bottom side so tape, gravity, & table top pressure hold the new socket header securely in its solder holes & ready to solder. 5) To their strip holes, solder ONLY the 2 header pins enclosed by B8’s orange rectangle. Against the 3 header pins exiting the B9 red rectangle, put a left over piece of resistor wire. Pressing your hot soldering tip against them, solder each of the 3 junctions of resistor wire, header pin, & solder hole. 6) Prepare a short red jumper wire with insulated area to bridge between the new A19 socket & the existing A13 Arduino 3.3 volt socket AND stripped right angle ends that will just bottom out in the sockets. Now all the A9 sockets will have 3.3 volts. 7) Strip an end of your supply of red wire & insert it from the shield’s top into the B2 solder hole. Holding the insulation against the hole, turn to the shield’s bottom, bend the stripped end to hold it. On the bottom, carefully solder the wire only to B2, & snip off extra wire extending from the solder. Back to the shield’s top, cut enough of the red wire to reach from B2 to an A9 socket. Slip a little heat shrink tubing (red?) next to B2 on the red wire & shrink the tubing with gentle heat. Next make sure the red wire’s free end is stripped enough to bottom out in a socket & bent at a right angle. Insert the free end into an A9 socket. Now all the A1 sockets & all the A2 solder strip holes will provide 3.3 volts (instead of 5 volts). 8) As the Sump Monitor Node schematic indicates, insert the stripped RFM69 wire ends into the appropriate shield's Arduino connections: Connect SCK to D13, MISO to D12, MOSI to D11, NSS to D10, & DIO0 to D2. Connect the RFM69 GND you wired to the shield's closest source of an Arduino GND. Connect the RFM69's 3.3v wire to a source of Arduino 3.3 volts (I suggest in the new A9 header). 9) Install the DHT11 sensor on the shield: (DHT) vcc to a (shield) A17 3.3v socket, gnd to an A18 GND socket, & data to Arduino D4 on the shield. 10) Make sure the Arduino compatible is switched to 3.3 volt mode & maybe recheck to make sure the above connections were done correctly. 11) When your Sump Monitor Node on a shield is built, insert the shield into the Arduino compatible switched to (mostly) 3.3 volt mode, but do NOT force this. That could crack things on either unit & cause frustrating malfunctions. If necessary, bend the long pins slightly to make the insertion relatively easy. 12) Connect the ultrasonic sensor to the Shield: Long enough to reach from the dupont cables on the ultrasonic sensor to where you want to place the Arduino / Shield, cut four (color-coded?) lengths of 22 gauge insulated wire, each with one end stripped to bottom out in an Arduino Shield socket & one end stripped to bottom out in a dupont cable’s female socket. Use red wire to connect sensor’s vcc pin / dupont cable to 3.3 volts at an A9 header socket. Use black wire to connect the sensor’s gnd pin to GND at an A18 header socket or another GND socket on the shield. Use green? wire to connect the sensor’s TRIG pin to Arduino A2. Use yellow? wire to connect the sensor’s ECHO pin to Arduino A1. Next: The Sump Monitor Node Programming
|
|
|
Post by papa on Nov 11, 2016 20:34:35 GMT
Sump Monitor Node 20 (Software)
computourist_node_v2.2Me_choices_pub.ino (56.76 KB) << Download this sketch, source of the Sump Monitor Node Programming. (Note: this sketch can be customized for several types of nodes.) With the Arduino IDE, appropriately customize the sketch, as follows: At lines 147-148, UNcomment one line (no "//") for your Temperature Scale Line 150, UNcomment to use inches. Leave commented for centimeters Make sure line 153 is UNcommented, i.e. to read #define HT ... (no "//") Line 157, UNcomment #define SUMP Line 158, notice the possible need for new values at line 234f. More on this below. Note: To use an ultrasonic node for other purposes, leave line 157 (#define SUMP) commented & UNcomment line 160 (ultrasonic)Line 191, leave UNcommented, unless you’ll use the earlier Gateway version Line 193, use a NODEID unique to your system. I'll assume 20 in the following. Line 194, change "xxxx..." to YOUR 16 character key used on ALL your nodes. Lines 197-199, UNcomment one line according to your RFM69 radio’s frequency. Comment the other two lines. Line 200, UNcomment it ONLY IF your RFM69 radio has "H" (high power) in its part #. Note: If you UNcomment line 195), the Arduino serial monitor can use 115200 baud (line 221) to display node debugging output, at least while you test the node. With Arduino IDE running on a computer & the Sump Monitor Node 20 connected via USB, upload the sketch program to the node. Then with the node still on USB, the Gateway successfully running connected to your Ethernet network & the IDE serial monitor running at 115200 baud, the serial monitor (in DEBUG mode) will display connection & data info about the node. << Fulfill the conditions in this paragraph to see if things are working so far. -------------------------------------------------------- At Line 235f, set SafeTop, LowLevel, & STUCK (used by code at lines 1458f): If the calculated distance from sensor to water surface is more than LowLevel for longer than STUCK, it’s flagged as LevelStat = 1 (meaning “Stuck Low).” If the calculated distance is less than SafeTop for longer than STUCK, it’s flagged as LevelStat = 2 (meaning “Too High ?)” Otherwise, it’s flagged as LevelStat = 0 (or OK). My sensor is at the top of my sump hole & SafeTop & LowLevel are based on my measurements there. To allow for “fuzzy” measurements to the trickling water surface & yet catch possible problems fairly soon, an out of OK distance must stay so for a length of time set by the STUCK value (45 seconds in the original sketch). [In the sketch, all ultrasonic measured distances are in centimeters until they are perhaps converted to inches by the #define INCH setting.] My sump pump hole is 24 inches deep. When the water level reaches 16 inches below the hole’s top, a mechanical float switch activates the sump pump until the water level reaches 20.5 inches below the hole’s top. However, if the pump switch gets “stuck” in the on position, the water level sinks to about 23 inches. Also if the pump does not activate when the water level is 16 inches from the hole’s top, the water level continues to rise, but slowly because water can back up in the feeding tiles & can continue to fill the top 8 inches of the sump hole. The above measurements give a start on programming a sump monitor node. In the original sketch, SafeTop = (16*2.54), 16 inches converted to centimeters. LowLevel = (20.5*2.54), 20.5 inches converted to centimeters.At Line 235f, you’ll probably need to change SafeTop & LowLevel according to your sump hole measurements. You may need to increase STUCK to prevent false positives. The OpenHAB configurations below, especially the Sump_Chart in the sitemap file, can help you refine the node’s performance. Note: At Line 1423f, is a version of ultrasonic sensor coding that differs from others I've seen. I borrowed it from Felix at lowpower.com because it seemed to improve distance readings from the "fuzzy" surface of trickling water. -------------------------------------------------------- For initial testing, leave the Sump Monitor Node connected (USB) to the computer that programmed it via the Arduino IDE. On the IDE’s Serial Monitor, watch the results from the following: At a distance greater than your LowLevel value & for longer than your STUCK value, aim the ultrasonic sensor’s “cylinders” at a surface like the floor. At a distance less than your LowLevel & greater than SafeTop, hold a surface under the ultrasonic sensor. At a distance less than SafeTop & for longer than your STUCK value, hold a surface under the ultrasonic sensor. On the Serial Monitor, LevelStat should respond accordingly. See more above related to Line 235f in the Nodes Program Sketch.
|
|
|
Post by papa on Nov 11, 2016 20:57:47 GMT
Sump Monitor Node 20 (Software) If Still Needed ... Install OpenHAB & MQTT (Mosquitto)
Installation of OpenHAB & MQTT (Mosquitto) is needed to benefit fully from this Sump Monitor Node. For the Windows install, see this thread, all the posts from Oct 16, 2015 at 8:52am through Oct 17, 2015 at 6:10pm posts. For the Linux install, see this thread. For Raspberry Pi, see this thread.
|
|
|
Post by papa on Nov 11, 2016 21:06:29 GMT
Sump Monitor Node 20 (Software) OpenHAB config file entries needed for the Sump Monitor Node:(Presupposes NODEID is 20. In the following, replace 20 with the NODEID you assign) ================== Add to items file entries: ------------------------ Group Sump_Chart Number Sump_Node20 "ToSurface20 [%.1f in]" <sump> (Sump_Chart) {mqtt="<[mosquitto:home/rfm_gw/nb/node20/dev51:state:default]"} // ^^ UNComment this line to display distance in inches & comment the following item // Number Sump_Node20 "ToSurface20 [%.1f cm]" <sump> (Sump_Chart) {mqtt="<[mosquitto:home/rfm_gw/nb/node20/dev51:state:default]"} // ^^ UNComment this line to display distance in centimeters & comment the previous item Number Sump_Chart_Period "Chart Period" Number Sump_Stat20 "Sump Surface [MAP(sump.map):%s]" <sump> {mqtt="<[mosquitto:home/rfm_gw/nb/node20/dev65:state:default]"} // Note: Above items gather the sensor’s distance from surface & how safe the distance is & report it on the Classic UI (user interface) displayed on a browser. ================== Add to sitemap file entries: ------------------------ Frame label="Sump Level" { Text item=Sump_Stat20 Text item=Sump_Node20 { Frame { Text item=Sump_Stat20 Switch item=Sump_Chart_Period label="Chart Period" mappings=[0="Hour", 1="Day", 2="Week"] Chart item=Sump_Chart period=h refresh=6000 visibility=[Sump_Chart_Period==0, Sump_Chart_Period=="Uninitialized"] Chart item=Sump_Chart period=D refresh=30000 visibility=[Sump_Chart_Period==1] Chart item=Sump_Chart period=W refresh=30000 visibility=[Sump_Chart_Period==2] } } } ================== Add to rules file entries: No changes needed. ================== Add to transform files: ------------------------ sump.map (63 B) << Download this file & add it to this folder: For Windows, C:\openhab\configurations\transform For Linux (incl. Raspberry Pi), /etc/openhab/configurations/transform ================== Add to icon files: ------------------------ In your \webapps\images folder, copy cistern-20.png to sump.png For Windows, go to C:\openhab\webapps\images For Linux (incl. Raspberry Pi), go to /usr/share/openhab/webapps/images/ ================== See this thread for configuring OpenHAB persistence as needed. ------------------------
|
|
|
Post by papa on Nov 11, 2016 21:35:03 GMT
Display Sump Monitor Data on the OpenHAB User Interface
Powered, the Sump Monitor Node should be ready to connect & work with the Gateway & with a computer's running MQTT service & OpenHAB. Once the node & OpenHAB (& its configuration files) are started & working, have your browser display the Classic User Interface (UI) by entering the address http://localhost:8080/openhab.app?sitemap=My [ ^^ … IF the first line of your sitemap config file starts with: sitemap My Change accordingly for a different first line. ] Or view / control your DIY home automation network via your smart phone: See my Success... thread at the end of the Oct 17, 2015 at 6:10pm post. For further testing, power the Sump Monitor Node via the USB of the programming computer or separately. On the OpenHAB User Interface’s main page, you should see the Sump Surface status (OK, Suck Low, Too High) & “ToSurface20” plus the distance from the sensor to the nearest surface. There watch the results from the following: At a distance greater than your LowLevel value & for longer than your STUCK value, aim the ultrasonic sensor’s “cylinders” at a surface like the floor. At a distance less than your LowLevel & greater than SafeTop, hold a surface under the ultrasonic sensor. At a distance less than SafeTop & for longer than your STUCK value, hold a surface under the ultrasonic sensor. On OpenHAB’s User Interface, “Sump Surface” & “ToSurface20” should respond accordingly. See more above related to Line 235f in the Nodes Program Sketch.
|
|
|
Post by papa on Nov 11, 2016 21:41:09 GMT
Install Sump Monitor Node at the Sump Hole & Refine the Node's Performance
After tests confirm the Sump Monitor Node is basically working with the Gateway & OpenHAB, put the Ultrasonic sensor near the top of your sump hole & aim its “cylinders” at the largest, calmest space on the water surface. If your sump hole has a cover or something else over the hole’s top, you might velcro the sensor there. (When I put velcro over the sensor's chips, the sensor did not work right so avoid that. In fact, the sensor did not work right after I removed the velcro from the chips.) If your sump hole has no cover, you might mount the sensor on the top & at one end of a paint stirring stick or lath extending over the hole. Weight or fasten the end opposite from the sensor. Use OpenHAB’s User Interface to refine the Node’s performance: On the OpenHAB User Interface’s main page, click on the ToSurface20 item (& link) & you should see Sump Surface status report (OK, Suck Low, Too High) & a graph of distances from the sensor to the sump water surface. On the graph, you hope to see peak values something like LowLevel, valley values something like SafeTop, & (at the top,) Sump Surface … OK. You can force a Stuck Low error by hooking & lifting the pump’s mechanical float switch so it stays on. Leave it on for a minute or so after the water surface bottoms out. Force a Too High error by unplugging your sump pump & using a hose to fill the hole above SafeTop. Use your observations of the Sump Chart to refine the sensor’s aim & the SafeTop, LowLevel, & STUCK values in the node’s program sketch. See more above related to Line 235f in the Nodes Program Sketch. Hint for programming the node at the Sump Hole. If possible: Power the node with a phone charger adapter via a cable to the node's USB port. Have the Arduino IDE & customized sketch program on a laptop you can put near the sump hole. Connect the node to the laptop via the USB cable & upload. This way you won't have to re-aim the sensor after re-programming the node.
|
|
|
Post by papa on Nov 11, 2016 23:28:40 GMT
Analyzing Some Sump Node Chart Results << Click on pic for larger display A one hour snapshot of charted Sump Monitor results More than once, the chart seems to record the hole rapidly filling to less than 8 inches from the top. What actually happened in the sump hole during this whole time matched the chart's last lopsided "V:" emptied to about 20.5 inches below the hole's top, filling to about 16 inches below the top, & finally emptying to about 20.5 inches below the top. Before what the picture shows, the chart mostly matched the last "V" in this picture. I don't believe the sensor moved so I'm not sure what happened. The good news so far is that the false readings (less than 16 inches) last a short time, shorter than what the node's programming will flag as "Too high." Yet if the distance values are outside the SafeTop to LowLevel zone for more than 45 seconds (STUCK), the error status is still flagged. I will continue to check the results & what they might mean. As I wrote above, it can be challenging to use an ultrasonic sensor to measure distances to a "fuzzy" surface like trickling water.
|
|
|
Post by jimmys01 on Nov 12, 2016 0:10:13 GMT
thank you for posting all this!! Good to know that this forum is somewhat active.
|
|
|
Post by papa on Nov 12, 2016 2:17:44 GMT
You're welcome, jimmys01. Good to know someone is reading the posts.
|
|
|
Post by papa on Nov 14, 2016 18:30:58 GMT
Some More Sump Monitor Node Chart Results << Click on pic for larger display Another one hour snapshot of charted Sump Monitor results Likely explanations & fixes for previously less satisfying results (besides the challenges of reading a distance to a "fuzzy" water surface): Turns out the ultrasonic sensor was moving some due to sump pump vibration. It is now more secure. Then as already mentioned, Velcro on the sensor chips made the sensor defective. I installed a new sensor. Note: Node programming sends the measured distance every 30 seconds, but apparently the rrd4j database saves the reads no less than every 60 seconds. The latter is what shows on the chart. To improve the chart appearance, I tried some "smoothing," sending running averages of the distance readings. That did not seem to help so that is not in the program sketch. Looking at the chart above, the current results have some spurious zig zags ("fuzzy" water surface), but we see much of the peaks & valleys we'd expect from a hole that fills to about 16 inches from the top & then the pump empties it to about 20 inches from the top. Status stays OK between those points, but will flag "too high" or" stuck low?" if the distance read is steadily outside those boundaries for longer than 45 seconds. At this point, the current installation & programming is giving what I wanted. I will continue to check the results & consider what they might mean.
|
|
brump
Junior Member
Posts: 81
|
Post by brump on Nov 15, 2016 20:10:27 GMT
Hi Papa, Congratulations on your new implemented node.
|
|
|
Post by papa on Nov 15, 2016 22:37:39 GMT
Thanks, brump. So far, so good. I'm glad the write up is getting read.
|
|
|
Post by papa on Nov 21, 2016 3:28:06 GMT
With Dynamic Icons, Enhance the User Interface Display of Sump Data
I noticed that in the \webapps\images folder, the OpenHAB install includes icons cistern-0.png thru cistern-100.png, useful to display sump cistern levels via what are called "dynamic icons." So I've experimented with this. Notice that each cistern icon has a dash (-) followed by an integer. When a sitemap line displays an item on a User Interface (UI) line, if the item's state is one of the integers following "cistern-" then that icon displays at the start of the UI line. So far this is fairly easy. What can be challenging is processing the item’s state to get relevant integers. I wanted to use the icons to visualize the percentage of fill within the 4.5 inches between the SafeTop level where the sump pump should turn on & the LowLevel where the sump pump should turn off. To add to the challenge, I wanted to create & use a new cistern-0 icon with a red bottom (for “Stuck low ?” status), a new cistern-5 icon (used for 0% - 5% of fill), & a new cistern-110 icon (for “Too high” status). In the sitemap file I can comment (disable) the line, Text item=Sump_Stat20
|
|
|
Post by papa on Nov 21, 2016 3:30:33 GMT
Continued: With Dynamic Icons, Enhance the User Interface Display of Sump Data
First, stop OpenHAB from running. Add / Change icons in the \webapps\images folder: For Windows, go to C:\openhab\webapps\images For Linux (incl. Raspberry Pi), go to /usr/share/openhab/webapps/images/ There rename the present cistern-0 icon to a new name (cistern-0-old.png). Download & copy the following 3 icons to that folder. << cistern-0.png cistern-5.png cistern-110.png To the items file, add (to the items above): Number Sump_Display "Sump Level [%d %%]" <cistern> To the sitemap file, I add (to the sitemap lines above): Text item=Sump_Display Optional, comment out the sitemap line above: Text item=Sump_Stat20 (change it to // Text item=Sump_Stat20). I believe the Sump Level icon can adequately (visually) indicate "OK", "Too high", or “Stuck low ?”
|
|
|
Post by papa on Nov 21, 2016 3:42:20 GMT
Continued: With Dynamic Icons, Enhance the User Interface Display of Sump Data
To the rules file, add: rule Sump_Level when Item Sump_Node20 changed then var Number DIF = 19.75 - (Sump_Node20.state as DecimalType) var Number FRAC = (DIF / 4.5) * 10 if(FRAC >= 10) FRAC = 10 if(Sump_Stat20.state == 2) FRAC = 11 var Number S20_r = (Math::round((FRAC.floatValue)) * 10.0).intValue if((FRAC*10) >= 5) { if(FRAC <= 1) S20_r = 5 } if(Sump_Stat20.state == 1) S20_r = 0 Sump_Display.postUpdate(S20_r) end Note 1: This rule calculates the DIFference between SafeTop & the distance the ultrasonic sensor reads. Divide DIF by 4.5 (inches between LowLevel & SafeTop) which usually gives a decimal FRACtion (of usual fill). The FRAC value is usually processed to give an integer divisible by 10 that represents the percentage of fill. Except if FRAC is 10 (represents 100 %) or more, it's kept at 10 (100 %). Then again, if Sump_Stat20 is 2 (for “Too high” too long), FRAC is made 11 (converts to 110 %) & cistern-110 (cistern filled with red) will display. If FRAC times 10 is 5 or more & if FRAC is 1 or less, the resulting 5 value displays the cistern-5 icon & 5%. If Sump_Stat20 is 1 (for “Stuck low ?”), the value becomes zero which will display cistern-0 icon (red bottom) & 0%. The rule’s last line updates the value & the icon to be displayed. Note 2: The User Interface display for Sump Level may briefly display some negative percentages & wrong icons until the rule finishes updating the display. Note 3: The percentages & icon fill will fluctuate somewhat different than the fill of the sump cistern. Remember that the fuzzy nature of trickling water confuses the ultrasonic sensor's read of distances. Restart OpenHAB.
|
|
|
Post by papa on Nov 21, 2016 3:46:32 GMT
Continued: With Dynamic Icons, Enhance the User Interface Display of Sump Data
Examples of the resulting User Interface Displays ( click on pic for larger view): << blue Sump Level fill for 40%, in the safe range << total red Sump Level fill & 110% for "Too high" << red bottom Sump Level fill & 0% for "Stuck low ?"
|
|
brump
Junior Member
Posts: 81
|
Post by brump on May 3, 2019 1:17:50 GMT
I am starting a cistern monitor and the water tanl. As the water tank descends the level, the pump will be activated until the water tank level is reached. I've created a schedule for daily manual triggering and I'm trying to create some conditionals in openhab to ensure perfect functioning.
|
|
|
Post by papa on May 3, 2019 20:05:44 GMT
Greetings, brump. Good to hear from you on the forum. I do NOT recommend using the ultrasonic sensor (as this thread does) for monitoring water. Even small trickles on the water surface confuses the measurement. This thread of mine documents very reliable method for monitoring water depth that is working very well for me.
Keep us posted on what works & does not work for you.
|
|
brump
Junior Member
Posts: 81
|
Post by brump on May 15, 2019 2:46:38 GMT
I simulated some tests with ultrasonic sensor.
I took a 50mm (2 inches) PVC tube and fixed the sensor on the surface of it, the tube goes to the bottom of the tank and on the sides I made a few holes with a 6mm (.25 inch) drill bit for water to pass easily. Inside the tube the uneven surface is not noticed. Besides this test, I ordered two pressure differential sensors MPX5100DP, with this model we can measure a water column from 0 to 10m with excellent precision. When I receive the sensors, I will make a dedicated post.
papa: These ideas sound like creative ways to get better results. I hope your idea for the ultrasonic sensor works because it would be simpler to wire than the node with water probes & avoid a yearly need to remove corrosion from the probes. Thanks, brump. I look forward to hearing more.
|
|
brump
Junior Member
Posts: 81
|
Post by brump on Jun 25, 2019 16:31:17 GMT
I implemented the level control in a water tank and in the cistern. The cistern receives water and a submerged pump, throws water into the water tank. In this project, I used an ultrasonic sensor for each reservoir. The cistern is constructed of concrete, and the water has high levels of chlorine. As chlorine is corrosive to our fragile equipment, I had to look at the small details. The sensor used was the SR-04. I created an encapsulation for it using resin, in which case I used the 3M ™ Scotchcast ™ Resin. I took a 5mm thick aluminum bar and made two holes and screwed them in to screw an M6 bolt to fix the sensor if necessary.
I removed the pinhead from the board and soldered a PP cable to connect the board. After that, I used four wire terminals and glued loctite 401 in the four existing holes of the SR-04 plate to ensure spacing between the plate and the aluminum rod. (I tried soldering, but the heat from the soldering iron melts the plastic, so it was best to glue.)
I picked up a rectangular plastic box and set the sensors to the bottom of the box. To ensure that the resin did not penetrate the transducers, I isolated them with molykote 111 silicone paste, applying sufficient amount to "glue" the transducers to the bottom and the resin did not penetrate. I also applied molykote 111 across the length of the screw and the newly opened thread on the aluminum bar, ensuring that the resin does not penetrate into them. After this, mixed the resin and filled the sensor, after the cure time, all right. For installation in the reservototios, I created a support with PVC. I used a 100mm "T" connection and a 100mm x 1m long tube (Depth of my tank). The PVC connection has a shoulder, so it was enough to cut the resin to fit the pipe. I did not even have to fasten the screws. The box used to accommodate the node, was IP68 and INOX terminals.
|
|
brump
Junior Member
Posts: 81
|
Post by brump on Jun 25, 2019 16:33:04 GMT
|
|
brump
Junior Member
Posts: 81
|
Post by brump on Jun 25, 2019 16:34:07 GMT
Papa: Yes, brump, thanks for sharing your approaches on this.
For measuring water level in a small tank, I have also been trying an ultrasonic sensor at the top of a perforated PVC pipe (2-inch diameter). I have mixed results so far, probably because I don't yet have a good way to mount the sensor & keep the PVC pipe vertical. I don't believe the sensor is reliably aimed at the water surface. I will experiment more when I get time.
|
|