I have started an open source rain barrel project over on GitHub.
I was earlier working with an Arduino Yun but I would rather do the wunderground web queries, JSON parsing, and control logic in the cloud, sending basic commands to the microcontroller.
if someone is interested in joining me, then I would be near ecstatic.
what do you think is the best way to do this? Is there a nice and simple yet powerful enough online development or interface environment to use that is compatible with the spark core?
Some background: I am an environmental engineer working on this as a side project. I would like to present on how the open source community canon develop environmentally relevant technologies. I like the idea of the spark core because most houses have wifi and the core can enable the rain barrel to be a simple wifi accessory to a household. There is also a wonderful group of people working with the core.
I could be persuaded; I just need to get rain barrels. Do you have any specific recommendations for this project?
You can use the existing Spark web IDE, or are you thinking something a little different?
If you can get started on the project, we can help you with any roadblocks or feedback.
Do you have any recommendations for controlling mosquito populations near a rain barrel? That has been one of my main sticking points with them. Even if you use the BT “mosquito dunks”, they still tend to swarm around the stagnant water, even if the larvae die off.
Here is the background for those who are interested
The automated rainbarrel project is designed to determine how quickly open-source collaborative efforts can result in a functioning, intelligent, “internet of things” product that can serve both people and the environment. This is part of an independent research project and the results (specifically documentation on who is contributing and how it takes shape) will be presented at a conference on water resources in June of 2014 and again when the project is considered complete (that is, a functioning automated rain barrel exists).
The current repository has some logical diagramming, hardware specifications, and open-source software. It is expected to change and multiple contributors are welcome.
The primary purpose is to provide homeowners with the water they need to irrigate (e.g. lawns, gardens) or use for non-potable purposes. It is designed to alert the homeowner when it hasn’t rained for some time. It can automatically irrigate, and it is designed to allow connectivity with other sensors (e.g. ground moisture sensors or an on-site weather station).
The second objective is to prepare the rainbarrel for an oncoming storm by emptying it beforehand. In stormwater control, the concept of Low Impact Development (LID), is to mitigate rainfall-runoff close to the source. Roofs are one of the largest producers of directly connected runoff from single family homes. Rainbarrels are generally full or near full before a storm, particularly in areas with rainy wet seasons. This doesn’t do anything to reduce urban runoff or “shave” the peak of the storm. If the rainbarrel is intelligent enough to prepare itself for an oncoming rainstorm, then it will make the correct volume available to mitigate runoff.
Wgbartley, the parts list on GitHub has what I am working with so far. I also have some pumps and valves. I think it will take less energy to use calving but considering both a pump and a valve for each of a regular drain and a drain to the sewer. (See the flow diagram or project description for details on why I’d want to drain to sewer).
Spark Core (if processing is done in cloud) allows connection to WiFi
–Recommended to combine the Spark Core with the solar power shield to minimize power consumption and also recharge (still in development)
It’s good to see the prices of rain barrels coming down! Last I checked, something like that was $150-200. It’s been a few years, so I guess competition is starting to drive prices down.
I just placed an order for some solar components today so that I can start learning that stuff. I’m also running uptime tests on the Core connected to a 3.7v 600mAh lipo battery to see just how long they’ll go. Sure, we can do math on it all day long, but A) I don’t feel like doing that math on a long weekend, and 2) Math doesn’t always equate to real world usage. Once I’ve finished my tests, I’ll write up a post here on the forums. Hopefully this will help in your project as well!
@wgbartley In response to your “2.” I am wondering how we would most easily allow a homeowner/tinkerer to run the following routine. Should they have their own we server somewhere? Run a local we page on their computer? or use a service like IFTTT, Heroku, Temboo, or the like?
The homeowner would need to be able to
Know how much water is in the rain barrel by sampling water depth (at this moment I am considering using a milonetech etape)
Know how much rain is coming and when by performing a query from wunderground (currently wunderground is the only service to offer hourly forecasting over many hours into the future, vs yahoo weather or NWS or other governmental sites)
Let the user specify the connected roof area in the web app, once, and use that data to calculate the potential volume of runoff during the next storm.
The web app then needs to do some high falutin’ calculations to determine how much of the barrel should be empty based upon the likelihood of the storm and how soon it is expected to rain, etc.
The web app could then either tell the rain barrel to open a valve to drain to the sewer or it can tell the homeowner (by email) to irrigate if the storm is days away or it could even automatically irrigate if the homeowner allows.
These steps require some logic that I don’t think can be done using the spark tools. Now, @bko has some good tutorials on setting up a webpage to do some reading and control using a spark. Others have contributed code to use node.js. I had always thought that this would be a project where the homeowner/tinkerer wouldn’t set up their own server but rely on available web services.
Does anybody have any good ideas?
Also, all the logic I just wrote out is in a flow diagram on the github repository
If it’s open source, I would give options for self-hosted and managed-hosted. Self-hosted being where the user can run a web app on their own server, and managed-hosted would be something that is hosted and managed by you (or someone else) that runs on a platform such as Heroku or the others you mentioned.
I would definitely offload all of the data processing to whatever is hosting the web app. It would take a lot of resources on the Spark Core to be able to reliably process that sort of information. The Core could then check the web app in frequent intervals (1 minute, 5 minutes, 1 hour, etc) to get its instructions.
I saw the flowchart in the GitHub repository, and it’s quite extensive! Very well done. It’s almost like a “scope”. After 15+ years of software/web development, I’ve never actually seen one of those mythical “scope” things.
I’m just getting back to it.I got some sweet performing automated ball valves hooked up to the rain barrel. I will KISS for now and simply open and close the two valves. I talked with the folks from Forecast but they can’t provide qpf, just the chance of rain, so I may have to stick w underground for now.
For mosquito control there are these little donut looking things, think they are calls mosquito dunks. They have work really well in my barrel over the last couple years. Also using a “closed” barrel is better than those that cascade water into an open vessel. This can be easily done with an earth minded barrel diverter. Cheap 55 gallon barrels can be had on most craiglist site locations. They are $20 in Ohio.
@ruben I have been looking into making something very similar. I think a raspberry pi arduino team would work well for this. I just built a brewpi and that got my wheels turning. The pi can deal with java stuff and host the web interface much like brewpi. Maybe even using a xino rf so that the pi can be kept indoors. Here is what I am currently looking into:
Sonar vs tape for h2o level
SureFlow or Jetflo 12v pump(w/ internal pressure switch)
Arduino and a Rpi
Rain gauge or local weather station and/or intake of underground forecast info
Solar powered of course so add a charge regulator, panel, and battery.
I have one 65gal barrel. I want to add two more. This is a pretty ambitious project as I am still very new to this. I travel a lot for work so the web interface would be clutch to have.
If you were okay with a simple web interface, you could use the Webduino (web server) library, and host a web server from and connect the sensors to a single Spark Core. (Please excuse the shameless promotion)
I have used them in other water features like water gardens over the years. They do well at killing the larvae (which is what the BT bacteria in those dunks do). However, mosquitoes still tend to congregate around open water. So you’re keeping the overall population down, but you’re inviting the survivors over to hang out near your water. I don’t have experience with a closed rain barrel system, so it’s probably not nearly as bad as an open water garden!
You can sometimes get them for free from a car wash. The soap they use is usually shipped in the 55 gallon barrels. Sometimes they’re free, but there could also be a waiting list.