Automated water management for a Farm Well

A Farmer friend of mine has asked me about what an Arduino could do for automating the command and control of one of his water wells, with reporting back on a webpage and alerts. He already pays a large $$ of money per year for this service from a commercial water management company that has him on a subscription model that is expensive.

I want to use twitter/text as he tracks those in real time anyway. He has 17 wells, 14 of which are on leased expensive management feed back systems with yearly contracts based on $'s per acre, which control the feed of his giant circular water systems for the commercial corn he is growing.

When he told me how much it costs him to install, and what the price was per year, for hardware installed on his equipment, it made me blink. I did some searching online, and found a PDF of a project in India that uses an Arduino family member chip, in a system for managing smaller farmers. However, I haven't found a good Arduino example.

It made me wonder if there was any open source well water management solutions available that I haven't found yet? I would like to point my friend toward a solution he could install on his well's and own the equipment saving himself the cost of a Car per year (spread over his 14 wells) for what is basically simple digital data.

He says I can design and use one of his other wells as a test platform for controlling and reporting what that well is doing. A solution like this, could save a significant number of Farmers real money, as they gain control of better water management, and own the hardware installed on their equipment.

I believe I can put together a package using a Mega, a multi channel relay shield, and a GSM shield plus sensors. He needs to know which direction out of 360, the arm is currently located. If the well is pumping water. If there is a pressure drop. That's about it. I would want to include Temperature at well, Humidity at well, besides his basic info of: the point of rotation, if it is on or off, and if everything is nominal.

Any suggestions for my friend?

That sounds like a really good project, and something suitable for an arduino.

I don't understand this;

He needs to know which direction out of 360

Can you give more info on what the arm is when it moves and why?

If it was me I would start by looking carefully at what info the existing system provides e.g. does he get and need data on volume pumped etc.

My inclination is that there should be an arduino at each well which sends a periodic SMS message (perhaps every 3-4 hours) saying everything is fine. In addition it would send alarm messages immediately any problem arose.

The cost would just be the GSM for each well and the cost of the SMS messages.

That sounds as if it would take some significant work to wet up, but it all sounds perfectly feasible from a software point of view.

I don't know whether you will find any 'well management' projects (it doesn't hurt to look) but if you look for related projects such as a weather station I suspect you will find examples of remote data acquisition and web uploading via a cellular modem.

It is also probably woth adding that although the commercial operator sounds expensive make sure you fully understand what service they are provising. Perhaps they are monitoring 24x7 and dispatch people to site to make repairs when there are problems. Somebody does have to monitor the wells and the critical factor is how long the farmer can live with a faulty well. If he needs to know by the hour that everything is okay, including during the night, then he will need to perform that monitoring himself.

There might be a large insurance cost here.

If the SLA states that every problem is resolved within X-hours that adds a huge extra cost.

Imagine a faulty well causing 1/17 of his crop lost...

If I where you I would at least equip each well with a redundant arduino + sensors so if one of them fail the other is still feeding you data and giving you time to repair the fault.

Well as I'm sure you grasp:

automating the command and control of one of his water wells

is quite a different thing than

reporting back on a webpage and alerts.

Having some hardware in place that acts as long distance eyes and ears to provide monitoring data is one thing, being able to turn the pump off over the Web from the house is a bit more I would think. I only mention it to try to clarify the tasks.

I want to use twitter/text as he tracks those in real time anyway.

I think if it updated once a minute or so that would be enough, wouldn't it? Might make communication easier if it didn't have to be every second. Might want to consider a data logging shield to give the station local data storage in event of a temporary or permanent communication failure.

He says I can design and use one of his other wells as a test platform for controlling and reporting what that well is doing.

Man, that is a hell of an opportunity. I would encourage you to take full advantage of it if you can. People start businesses and new careers when stuff like this falls into their laps. You could be looking at a business if you can figure out how to do this right.

I believe I can put together a package using a Mega, a multi channel relay shield, and a GSM shield plus sensors. He needs to know which direction out of 360, the arm is currently located. If the well is pumping water. If there is a pressure drop. That's about it. I would want to include Temperature at well, Humidity at well, besides his basic info of: the point of rotation, if it is on or off, and if everything is nominal.

I like the idea that not only would your module be a feedback provider on the state of the pump, but also a weather station. How about wind speed? Maybe they would want to shut down spraying in winds exceeding 20 mph or something.

So that give you three functions at the pump end:

  1. Provide feedback on the pump apparatus- sensor to determine position of the arm, sensor to determine if pump is on, sensor to determine pumping pressure. Something to determine if the pump was on stall somehow (possible danger to the pump) might be nice. Battery backup that could indicate whether the pump station had power or was blacked out would be good. Maybe the temp of the pump itself somehow- I know that a really hot pump can indicate trouble. Something to monitor the water level of the well or the water supply?
    What are your thoughts on a remote controlled camera with the ability to send periodic shots back?

  2. Control the pump apparatus- The ability to shut down the pump, the ability to turn on the pump. The arm is rotated with water pressure I assume. That could require a beefy relay and some big transient protection.

  3. Weather station- temp sensor, humidity sensor, wind sensor. Maybe you do hours of light as a data point. I don't know what farmers look at.

Then on the farm house end:

  1. Take the incoming data, get it to a Web page or an Android app, have the ability to take user input from there and feed it back to the pump station.

It seems like there is a lot of stuff. But maybe it can be broken into chunks and attacked.

Very cool.

Thank you everyone for the responses, some answers to Questions already asked... Some additional background on the farm in question.

The farm is in Oklahoma. It has about 10,000 total acres with about 4,000 of that in watered commercial crops. His primary crop 50%+ is corn, with typically two smaller crops in % terms planted to hedge his single crop risk. He also runs between 400 & 1,200 cattle that needs to keep supplies of water available for. He feeds his cattle left over corn by products.

His wells are spread out over 30 miles. The 14 units have saved him the cost of one full time employee who drove the circuit each day. He is paying $3 per acre per year for his water automation system reporting subscription. This was after they charged him more than the cost of the equipment in leasing fee's to install it. The system in place gives him a single web page, with status of each well, the GPS (angle of the arm currently in its cycle) if well is performing to nominal expectations, if its turned on or off. I will try to get permission to share the page with you. Here is the exact columns. He monitors this stuff all day long. He has an ipad with cell connection in it. Uses it while driving his ranges.

site status psi gps day/rev control

The arm in question is a giant water wheel that circles his crop watering it. Here is a link to a wiki on one. Center-pivot irrigation - Wikipedia. It moves in a 360 degree arc. I believe his turn off between full circles. Its a slow crawler spraying water over corn.

I agree on redundant primary cpu and sensors the cost is insignificant. I am pondering dual reporting LEDs, and a web cam that sends an update of each well, to the web page that tracks this. We can use an touch screen to display the primary and secondary readings like temps and humidity, with a web picture of that unit updated every minute or on demand.

I am thinking about maybe using a Yun instead of the mega, with a built in web server on the board. It might make a better interface at the well. You get both Arduino and Linux on site.

I got involved in a "real" project many years ago as an attempt to make a few extra bucks. Looking back I think the result would have been very much better and no less appreciated if I hadn't been preoccupied with trying to keep every piece of the cost for the client as low as possible. In other words it would have been better to say "you need to spend X and have this, this and this, in order to have a system that is reliable, expandable and easily maintained by someone else if I'm not available".

...R

He monitors this stuff all day long

Nothing wrong with having a webpage but would he not be better to know he will get a txt if something is wrong and a txt every few hours just to say all is okay? That way he does not need to keep looking at the webpage.

I would recommend having a central server in a professional datacenter for three main reasons.

One, it can monitor frequent "I'm alive and ok" heartbeat messages without each well pestering the owner all day/night long.

Two, the server can dispatch a "well #13 down!" message when it stops receiving the heartbeats for a certain amount of time.

Three, it's going to be FAR easier to put web/twitter/email/whatever interface code on a Windows or Linux server with gobs of RAM/CPU than it is to cram those bloated functions into little microcontrollers. If a central server handles all that, then the microcontrollers just have to send simple messages to the server with minimal encoding, vastly simplifying firmware.

It's also "nice" to have one page displaying the status, though that is secondary to the main reasons.

As a failsafe, you may wish to have the microcontrollers send a canned SMS text message directly to the owner if they cannot reach the central server for X amount of time.

Couple more more thoughts -- extensive testing and extensive debug logging to SD card. I assume these well pumps and pivot motors are really expensive. You want to test in simulation to make sure you're not going to burn up a well pump by repeatedly flicking it "on" and "off" really fast or other such stupidity resulting from a bug in your code. And, if/when something does go wrong on real life and you blow up a $3,000 part, you need the detailed debug logs to see what you did to cause that problem so you can fix the code and prevent it from happening again.

Don't forget to use the watchdog. Even if you have dual redundant microcontrollers, you still want to make sure each can reliably monitor the other.

Ok one more thought -- keep your code simple. You may be a brilliant programmer, but dumb down your code anyway. Avoid excessive optimization, so that anybody can look at the code and clearly see what it's doing, even if it wastes a few bytes of RAM or KB of flash. Consider avoiding pointers, both for readability and for stability (a bad pointer can wreak all sorts of havoc). Comment your code, explaining WHY you're doing what you're doing, not WHAT you are doing (well-written code self-documents WHAT it is doing, the remaining non-obvious question is WHY did you choose to implement it that way). This is important not just for you two years from now when you've forgotten all about your code and now it's time to fix a bug, but also in case you're "gone" and someone else needs to fix/upgrade the code as Robin2 mentions.

I agree with Robin2. Part of why farmers pay this sort of big bucks is so they don't have to worry about problems and failures. If you are going to replace the expensive system, you better discuss long term maintenance, and who is going to handle problems. And what happens if your system fails and causes (or doesn't prevent) major crop loss?

TanHadron:
I agree with Robin2. Part of why farmers pay this sort of big bucks is so they don't have to worry about problems and failures. If you are going to replace the expensive system, you better discuss long term maintenance, and who is going to handle problems. And what happens if your system fails and causes (or doesn't prevent) major crop loss?

How about a service plan in exchange for free corn for life?

I don't think major crop loss would be much of a problem, its not like the farm is on Mars, it will be monitored by people occasionally.

Instead of having a server in a professionally datacenter, try something like Windows Azure or Amazon web services. You can rent a tiny percentage of a VM very cheaply.

I like the idea of an off site server for primary control. I already have an AWS server hosting a former project of mine. That part wont be a problem. I also agree with Robin2, about being too cheap. I am not going that route. I will end up spending to much, and have extra shields left over before I send him the first solution to try.

He has a well near his house that is not automated, that we can test the equipment on. I know his water table is dropping in places, he might even have a semi abandoned well or a cattle well, i can put the first test equipment on. Nothing in primary usage today, while we test the solution. I am not trying to replace his whole system in one event. This would be making one unit, testing it for months to a year, before pondering a larger roll out.

I love to work on solutions. He told me about his completely manual wells, besides his automated wells. I saw the chance to have a longer range project, I could help him with the solution, while I get a chance to gain new knowledge.

4 of his automated wells are on manual currently, as he turns off their water supply when they are fine. He checks his wells himself each day, as he works his fields. This system is really for the non working hours when he is at home.

Yes, he will want INSTANT alert if a well goes down.

JackHBarnes:
He has a well near his house that is not automated, that we can test the equipment on.

Excellent. What you can do then, is develop the solution but don't actually let it control the well. Just have it display what it wants to do, and let the human do it. After a few weeks, if it doesn't ask the human to do anything crazy, then you can give it direct control of the well.

The project sounds feasible to me. If you were worried about reliability you could always install two of them per well. Also make sure you have a heartbeat function that positively returns "well is up" rather than assume that "no data" means everything is OK.

If a failure of the sensor would be catastrophic I would be inclined to make two different designs. Just as an example, have a current sensor on the motor input as one way of detecting the pump is working, and for the second method have a flow meter or moisture detector on the pump output.

I set up something a little bit along those lines to warn me if my garage door is open ( here ). Since the device was on the network I then had a web page warn me if the door was open. But sometimes I wouldn't be looking at the web page. So I got another Arduino with an Ethernet shield to query the first one and flash an LED, which I positioned on my desk, so I would see it. I could have added a buzzer if I wanted to. There is also a "heartbeat" LED which flashes to confirm that the thing is actually turned on.

Being the practical type, I don't see where you have described the method of communication with the wells. Have you gone to a well and decided what the communication method will be? I assume the wells have electric power, but do they have any type of internet access or a land phone line? I haven't seen anybody running a server on a cell phone system.

If all you need are periodic heartbeat/status updates consisting of a few bytes, SMS text messages are a reasonable solution (many providers offer unlimited texting for a few extra dollars above the base rate, and you can choose a plan with low airtime).

GPRS/3G/4G are also options. If you stay below the monthly data cap by keeping your messages small, the cost shouldn't be prohibitive.

Wireless carriers may even offer "data only" plans. They may not always be advertised on their websites, but call their sales dept and I'm sure most would work out a deal.

tylernt:
If all you need are periodic heartbeat/status updates consisting of a few bytes, SMS text messages are a reasonable solution (many providers offer unlimited texting for a few extra dollars above the base rate, and you can choose a plan with low airtime).

GPRS/3G/4G are also options. If you stay below the monthly data cap by keeping your messages small, the cost shouldn't be prohibitive.

Wireless carriers may even offer "data only" plans. They may not always be advertised on their websites, but call their sales dept and I'm sure most would work out a deal.

If he can get a CDMA shield, or just use a wifi hotspot, Ting.com has very affordable plans. You would pay $6 per month per device, and then $3 a month for 100MB of data, that is pooled for all the devices. If you use more than 100MB, they just charge you for the next plan up, which is $13 for 500MB. They have some refurbished 4G wifi hotspots in their store for $21. Depending on the size of the farm, Ubiquiti wifi radios, or even Xbees may be enough. The wireless devices could sit on top of the center of the irrigation arms, giving the clear LOS to eachother.

Here is a youtube video of one of his water pumps. Its a 454 straight pipe V8 converted to run on pure Natural Gas pumping 750 gallons of water per minute from 300 ft down... The Arduino will be monitoring if its running. I am pondering tracking its RPMs as one of our read outs. I am still not sure if this is one of our pumps or not, but he took it today.

Huh, I was picturing a big three-phase electric motor. That's cool, but must cost a fortune in gas (even Natural Gas) eh?