Water collection and processing complete (eventually)

This is somewhat of an admission of failure. You can't easily pigeon-hole everything, and most real projects use commercial software, homebrew, and hardware all at once. So, for you makers out there (including me) - this is where to put whole projects that don't fit well in the other forums.

Water collection and processing complete (eventually)

Postby Doug Coulter » Mon Oct 29, 2018 10:38 am

I've gone and promised someone that I'd pull all the info on this project together so others can duplicate it more easily, and perhaps avoid some of the mistakes I made along the way. This one's been real important to me personally, as I'm almost fully off-grid and a well would have required various permits and a ton of money upfront I had other uses for - and I still have other uses for the money I'm saving in property taxes. Not having a well, or grid power makes all my campus essentially an undeveloped piece of land in the eyes of the tax people and while difficult to accomplish - hey, challenge accepted! Consider the yearly savings on 40+ acres and 4 buildings vs the tax burden of "nature preserve" and a lot of decisions I've made here make a lot more fiscal sense than some would have you believe. The difference has paid for the fusor project, most of these buildings...and not having to have a "Real job" since I was ~ 45 (20 years early "retirement").

Water is a biggie. I'm lucky to live (well, I did chose where to move to) in a place with more than adequate rainfall, and where the air is now pretty pure, so the water is pretty good. Wasn't always that way, but about the one major good thing the EPA did was shut down dirty coal plants west of me that were making the rain have the pH of lemon juice... After living here for awhile, you can smell a city or big town from miles away - that's some pure air you get used to.

Ok, that's the upfront line. Now for the real stuff.
Here's a block diagram overview. Sorry for my sloppy drawing/writing skilz..I hope it's kinda obvious from the rest.
Water.png
Overall system - click to embiggen



Collecting rain is theoretically trivial, but actually quite a trick if you want to use the water. Rain isn't pure already, and the collection surface - here a roof and solar panels, gets dirty with anything airborne - pollen is one of the worst, but tree seeds, leaves, bugs living and dead, little rocks from the shingles...you name it, also comes down, and sometimes it's so nasty that you'd not even want to clog a filter with it. And if you keep that crap, even post filtered a little, in a rain barrel, "stuff" is going to grow in there and render it really nasty. So, you first have to choose how big to make the barrel, so you don't have water sitting around in it for too long no matter what (or handle this some other way, but clogging filters isn't practical long term, nor is keeping it out of the sun so well algae won't grow).

I'm just one of me, and pretty frugal, so my initial barrel can be pretty small. There's another consideration in the pre-processing, in that having some overflow in every collection cycle is a good thing - my top filter uses overflow to self-wash, and any floating junk also comes out of the small overflow hole in the side of the barrel (about 3/4"). When things are scaled right, as here (tuned after some years experience), the system can be really low-effort maintenance.

The barrel is set up so there's a window screen on the top that keeps big junk out, the pickup is off the bottom so stuff that sinks will not be brought further into the system (you clean it out about once a year, easy to just tip the thing over), and so we start with fairly good stuff. The ratio of collection area x average rain amount to barrel size that gives you this overflow on any decent rain both solves and creates some problems...The coarse filtering becomes almost no maintenance, but there are times when you'd like to get more water during a big rain than one barrel full, so you need a way to see how good the water you have is, and can't always just wait a day for things to settle (if they will, pollen doesn't - it ferments...).

So, what is actually the last step I did was to make it so I didn't have to go look at this - it's in a building a little uphill from the one I live in so I can use gravity feed, but when you really want to check it, it's raining or cold and not fun to go out and look. So....raspberry pi to the rescue:
BarrelCam.png
Still picture taken this morning - without getting off the couch. (for noobs, click the pic for the big version)

At the moment, the barrel is full, and so is my cistern which IS in a crawl space away from the sun. Showers and clothes washing day! But the intake system first, I'll get to all the other details. Not shown in this picture is a little medium mesh filter on the takeout line that's easy to clean. Needs cleaned every few months, shaded from the sun, and kinda protected or removed in deep-freezing conditions, though I've had them live over a year without dealing with that one.
Here's an amazon link (not a recommendation) to one about like what I used. Small size is good when it comes to freezing and breaking.
https://www.amazon.com/SHURflow-MARINE- ... ef=sr_1_73
Whatever you get, get a spare...that's a rule in all off grid living.

I keep saying things like the sentence above because some people have looked at my plans for various things and without really thinking things through, made "obvious to them" substitutions/improvements that then failed, and then handed me crap about it. So, this is "at your own risk" and if you want to scale it, there might be unexpected things you run into. It's why I'm using so many words to describe what is after all, a conceptually trivial and block-diagram-simple system. It's not simple in reality if you want to live on it rather than just fool around.

You can see the screen over the top which has caught some stuff. What you can't see without a movie (coming later after I do some editing) is all the junk that the high flow just washed off the top - this is pretty self-cleaning, a real boon. If you look carefully, you can see junk on the bottom of the barrel too - mostly little rocks from the shingles. OK, this is fine at some times of day, but what about others, or nighttime? I built a little submersible light with some high brightness LED chips out of a home LED light bulb that had a failed power supply and a piece of glass tubing, a few resistors, and some hot glue. The pi can blink this light source, which sits at at the bottom of the barrel, in the field of view, and shows me the turbidity of the water. Not that easy to automate, but a human can judge instantly. Commercial turbidity sensors, at least those you can afford, start at "way too nasty" and go up from there...this shows you how many feet you can see through the water, not how many millimeters, and doesn't need flow to self-clean, or at least not so far.


I'll be back, this is just a start. I'm going to try to have full plans, even the computer code and schematics in this thread. But this took years to fully work out, and it's going to take days to gather all that, so be patient. If you're in the 3rd world (no judgement call here, where I am might as well be about some things), maybe this will really help you. Just a little bit of inexpensive tech and some savvy can make the truly oldest profession - survival - a lot easier.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Water collection and processing complete (eventually)

Postby Doug Coulter » Mon Oct 29, 2018 1:00 pm

So, after 3 way pre-filtering at the first stage (at least 3..) we get into a buried pipe (1/2" qest/pex stuff used throughout) down to the home office crawl space.
The prefilter is that screen over the top, the ability to let things settle to the bottom, and the strainer inline with pipe cap over its head to keep the sun off - algae is the enemy here, we're not doing aquaculture (at least, not on purpose). Luckily, it appears to be the main enemy and that only for a week or two twice a year when things are making a lot of that. But you never know, so there's more to make this safe, and at this point, it's about as good as it can get by the time it gets to my kitchen.
Showers and toilets not as much, but it looks good and doesn't smell funny or stain anything - pH measures right at 7 almost all the time, rain is pretty pure with added pollen and dust, otherwise it's distilled water more or less. At least where I chose to live. YMMV.

I should also add that I have a backup on the backup, like everything else you do off-grid. I made a nice "Water getter" setup that uses a 55 gal plastic drum that fits in my truck bed, an inverter, and a really neat floating pump I can drop on any creek or lake (plenty of those around here) and get a fillup. The floating pump avoids eating sand and crud on the creek bottom, and the fact that it is slightly underwater avoids floating crud, while the noise scares the fish away (and yes, that'd been an issue).

Now for the balancing act. All this off-grid stuff is famine or flood. I'd have used a larger cistern ( a farm tractor sprayer tank was usedm HDPE) if a larger one would fit where I wanted it, but life is what it is. Like with solar power - or for that matter, my toy budget which competes with food, heat, medical expenses - you roll with it somewhat, and adapt. Use less when there's less, and pig out when there's too much. One gets used to it after awhile, it feels like being in tune with reality.
So, when it's very dry, I don't wash clothes or myself quite as often, but when there's too much, the challenge can be finding something to do with it all, and collecting as much as possible before it all goes to overflow and the storage tanks still not full. Some of what lands in that rain barrel (actually a big industrial grade trash can, plastic) isn't good enough for any use I have, so it wants to be dumped on the ground. Some is medium not so great, but fine for the washing machine. If it's good, the crawl space cistern being full is priority 1. Whew! First thing any control system - even manual - needs to know is the state of everything - input quality and amount as well as storage capacity in the two places I have for that. And it'd be nice to know if it's going to keep raining or rain again soon as well.

I've not yet gotten to the point of writing AI software to do all that yet...and frankly, getting reliable sensors that I can deal with manually and valves that work correctly every time with automation, has been enough work to suit me for awhile. It's nice to have my dried leaves in boiling water on demand...

What I have done is put sensors in where it counts, and some really nifty (finally, earlier attempts stank by comparison) motorized ball valves in the crawl space where it's not fun to go unless you like spiders and hitting your head. I've managed to remote control/monitor those things well enough now, most can be done without getting off the couch, though the cistern re-circulation filter and UV sterilizer and heater are all manual by "plugging in extension cord" where those come up from the crawl space - those don't need to happen often at all so I haven't put in the work to make that stuff remote.

So, still describing this in the rough order of the water flow rather than when I did each part, here's some pix of the rain barrel and pi camera mount, which also has a BME-280 weather sensor in the box as part of indoor-outdoor weather data collection - the pi is there, so why not use it for whatever else? The pi runs off the house power - basically that's a huge UPS anyway, and connects via wifi (it's a pi-3) to a wireless access point in that building as part of my LAN of things in general.
20181029-Water-1.jpg
Another view of the rain barrel, showing the camera mount and the external strainer with a pipe cap over its head. Water line is buried down to here.

The pink insulation glued to the top of the camera box keeps it from overheating when it's in the sun - that temperature sensor and all. Also helps keep it dry.

A little out of order, but since the water flow can be split, so can this. I put an extra 55 gal drum down by my ancient Maytag. This gets water when I have extra or if it's not good enough for the main house. The Washer does a really good job, still. I added an electric motor to it around a decade ago, and welded up and reground a worn cam and it's been good. I think this one is from the 1930's era. The barrel here has an open bung for overflow, I can see this out a window so no level sensor yet. If the water in the rain barrel is so nasty I don't even want to wash clothes in it, I can dump it by undoing a fitting here, or up at the rain barrel by unscrewing the post-strainer, which at that point would probably like to be rinsed clean anyway.
20181029-Water-4.jpg
Yeah, it's a mess out there...and I don't wash clothes much when it's freezing cold, at least not here (there is a laundromat in town for emergencies).

The machine can get 2 or 3 loads out of 55 gal of water. More if you push things a little. Much more if you push hard. You can use the same wash/rinse water for more than will fit in there in one go if you really have to. I like the manual control here, it's more flexible than most new machines

(still editing)
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Water collection and processing upstream pi

Postby Doug Coulter » Mon Oct 29, 2018 1:54 pm

The rain-barrel pi. This is fairly simple. It's running the latest Raspian at time of writing, and [urlhttps://elinux.org/RPi-Cam-Web-Interface]RPi_Cam_Web_Interface[/url] for the camera. I diddled the php a little (and I see it needs a little more) just to personalize it and get the name of the host in there and so forth. I wrote a perl script to add the ability to blink the light at the bottom of the rain barrel, which is interesting on its own.

It also runs a little script I wrote to read two BME 280 sensors - one indoor, and one in the camera box, for weather data collection - so I can know if for example, I need to run over there and put wood in the woodstove, assuming I'm heating, or open a ceiling vent, whatever, should I care or plan to be working in the shop and want it nice over there.

It also runs my LANDNS scripts as daemons, which kinda make sure internal DNS works right no matter what bug systemd has introduced today...everything here has some version of that stuff in it, I even did it for ESP boards. Now my /etc/hosts files are always up to date and a quick cat of them shows me who's alive really easily as a side product.

I run SSH and tightvncserver here on everything that can run those. I usually will have a Samba or NFS share on each thing too, to facilitate editing remotely (I like my couch environment...). Pies won't run my editor of choice (let the flames begin) which is sublime text at the moment, so it's nice to be able to remotely edit stuff from here with the nice keyboard and big screen in the climate controlled spot.

//////
So, following the directions on the elinux link above, renaming a file gets you some extra buttons in the web UI for the camera. I only needed one but left the other example one in just because. It seems that these have to be shell scripts...but you can call perl from one if you like, so that's what I did.
So, you edit userbuttons after renaming it to be recognized (see link) and here is that - compressed as the board here doesn't like some file extensions.
This one's pretty simple, and goes into the web root for the camera, in my case /var/www/html.
userbuttons.7z
simple file to setup additional buttons for camera
(241 Bytes) Downloaded 613 times


Then, you need to add the actual called macro - here called button1.sh, and in my case, the thing that calls that gets the light flashed so I can see this at night. This goes into /var/www/html/macros on my setup:
macros.7z
the .sh macro and the perl that does the work
(874 Bytes) Downloaded 619 times


Perhaps interesting in another way, this perl uses python inline to grab a couple things that someone else worked up for the pi, and I didn't feel like duplicating the work for something otherwise so simple. It's a good trick to know when dealing with, say, Adafruit's device drivers which are all in the python-fad-of-the-year language/version. For fun, a screenshot of this code in gedit on my desktop. It's so simple I lazily didn't even rewrite the comments as it was re-used from code that flashed a led on the fusor data aq setup as a "clapboard" to sync all the video cameras at startup - like hollywood and stuff...heh. I mean, blink exists in how many incarnations now?
flash_pl.png
A picture of code, how cute...no you don't have to type this in like the old computer magazine days...


////////////////////////////////////////////////////////////////////////////////////////////////////
Now, so as not to quite utterly and completely waste a pi's resources ("only" about 4-5 nines worth are wasted), I also added a couple of BME-280s to this on I2C, and will probably also add a DHT22 in the crawl space over there - humidity has been an issue this year and mold is attacking things if I let it get out of hand.
I ran that code as a daemon/service - all it does is read the sensors when someone hits on it via a message to a UDP socket, and answer with the readings. A busier pi elsewhere on my LAN has the database and plotting software to handle this.
Here's the code:
BMEs.7z
(3.05 KiB) Downloaded 594 times


The .service file goes into /etc/systemd/system.
The .pl file goes into /usr/bin.
Set the permissions as appropriate, and do
sudo systemctl enable weather
and it'll run on boot from now on.
This one uses Inline:C - yes you can do anything in perl, which is probably why some people hate it. Lots to learn if someone got too clever. In this case, I couldn't use Ada's python driver as it's broken anyway - and...trying to get it right in perl's different loose typing was a non starter unless I wanted to make a hobby out of it, after understanding python's different duck typing first (and then I'd have just fixed the python and used that). But here - the C code for Aduino works! And being lazy as I am (one of the prime virtues of a perl programmer) I just used that...

For completeness, and to confirm the immortal words of Grumpy Jenkins - "purty don't make it run good." He said this when another racer looked under his hood and was aghast at the duct tape and baling wire there. Just before Grumpy beat the crap out of him (on the track). Half the rules in his racing class were made to create a more level playing field with Grumpy who did more innovation in drag racing than any other one guy, probably. He didn't have time for purty - he was busy winning. (I happened to be there when he said those words...he was a good dude, actually, just didn't suffer fools gladly)
20181029-Water-5.jpg
Doesn't take much. This one had been used for something else, and I left the down-switcher board on there and used a 12v wall wart, just because - no extra work to do it. Just hanging on a screw on the wall.


I like my swiss army chainsaw...perl. I admit getting the permissions right so it could compile these languages into .so (dlls for you windows types) under where they run was slightly painful. FWIW, python runs faster this way than in python...as it's compiled, not that it matters for this use. It can break bad python code that used sleeps instead of checking for ready bits, though -
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Water collection and processing complete (eventually)

Postby Doug Coulter » Mon Oct 29, 2018 2:47 pm

Whew, for my next trick, I was afraid I'd have to go down into the crawl space for pictures, but almost all of it is already covered here.
Some basic plumbing isn't in the pix there, but it's basic plumbing...

The water level sensor really is something special and does represent overcoming a serious challenge - there's a lot of stuff sold but nearly all of it won't last a season in the real world, this just works. And works.

The ESP8266 board here is what controls things down there - the valves - and handles data gathering on indoor/outdoor/crawlspace weather, which is nice to have and a really good thing when it's super cold outside and I want to know if I need to plug in the water heater for the cistern. That's an immersion heater, much like one for aquariums, but fully immersible from an electroplating setup (cleaned up for this use). For the UV sterilizer and the gonzo fish-store type super filter, I just have extension cords running up here I can plug in as needed - rarely, so it wasn't worth doing relays and software and failsafes and....

Since those pictures were taken, I've added a "normal person" house water pump instead of the noisy spot-sprayer pump I'd been using, and an under-sink reverse osmosis and re-mineralization filter to complete the system. I don't use much water so the pump was harbor frieght's cheapest <1 HP version. The RO filter which is outstanding in performance for my use-case, is an iSpring model, the only thing I changed is to run the bypass water back to the cistern. This would be bad if there was no turnover in the cistern, but of course there is, and putting lots of water trickling down the drainfield is a waste and might cause a freeze or other issues.
So, I just recycle it - I'm not convinced that the RO filter takes out that much - boiling the "raw" water down to nothing leaves almost no residue in the pan, it's a lot less junky than well or city water already. I just wanted it biologically safe as well.
Here's the RO system link: https://www.amazon.com/gp/product/B005L ... UTF8&psc=1
I've had it for a few months now. It's great. It did take a lot of initial flushing to get the sediment out of the re-mineralizer, but has been perfect since.

Oh, those valves. That's another thing I'd struggled with over the years. Most electrically operated water valves only operate a pilot and need a lot of pressure drop to get any flow - and I only have a couple of feet worth. Or they have tiny orifices - and when I'm trying to grab as much rainwater as I can while it's raining, I care.
These things rock: https://www.amazon.com/Motorized-Stainl ... ref=sr_1_6 and used to cost $100's for pro industrial uses. Now cheap, and they only draw 60 milliamps while actuating, and nothing at all to just hold a state.
This is one of the few things much better than the good old days, a real treasure.

So, to borrow a phrase "Free at last, thank god almighty, I'm free at last"!
It may not take a village but it does take a lot of work...

So here's a screenshot of some of my LAN of things in Vivaldi, which I run just to look at all this and the cameras I have around, keeping Chrome for normal (for me, anyway) browsing.
LOT2.png
Just now

I like being able to tile stuff in Vivaldi - it's the main feature that makes the bugs worth it. FWIW, even though it's based on the same rendering engine as Chrome, it has a bug that shows when a pi camera is stopped - it doesn't always stop trying to refresh at the frame rate and really hogs things...admittedly, it's a corner case and the pi software is very strange to allow for this to happen anyway - it's showing video by a fast refresh of jpeg stills....
LOT.png
One of the other panes awhile back
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: Water collection and processing complete (eventually)

Postby Doug Coulter » Mon Oct 29, 2018 4:12 pm

And here's the code for the ESP 8266 down there.
This ESP code can update over the air, thus the OTA at the end of the name. More crawling saved.

The LOT master code is another story...an ongoing one. We'll get there...I haven't yet added the plots for the new weather data.

This has some other dox in the directory, which is from my arudino sketch stuff. I added ESP 8266 support the usual way via the json link in preferences, and the board manager.
See, for example, Andreas Speiss' youtube channel for more on arduino if you need it. He's really good despite the accent :D The guy is a real resource who does all this stuff quicker than I get around to it and finds the potholes so I don't always have to go first. Thanks, Andreas.

That shower was nice...enough sun today to heat it electrically (another famine-flood system), and water that would otherwise go to waste. Thanks, Nature!
Attachments
OTLoTOTA.7z
esp crawlspace code and some dox
(2.33 MiB) Downloaded 585 times
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA


Return to Combined projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron