How AI Can Help Farmers Save Water: Build an Irrigation Log

Coding Liquids tutorial cover featuring Sagnik Bhattacharya for How AI Can Help Farmers Save Water: Build an Irrigation Log.
Coding Liquids tutorial cover featuring Sagnik Bhattacharya for How AI Can Help Farmers Save Water: Build an Irrigation Log.

A farmer can use ChatGPT and free weather data to cut irrigation by keeping a daily log of rainfall, evapotranspiration (the water a crop and soil lose to the air), soil notes and crop stage in a spreadsheet, then asking the AI to draft next week's schedule from it. You check the draft against local crop advice before any tap opens.

The AI does not know your soil or your crop, so it cannot decide how much water to give. What it does well is arithmetic, tidy tables and plain-language summaries of your own records. The decisions stay with you and your adviser, and the log is how you prove to yourself that the schedule worked.

Follow me on Instagram@sagnikteaches

Why a log beats a calendar

Many small growers water on a fixed pattern: every other evening, or Monday, Wednesday and Friday. It is simple and it is wrong half the time, because the crop's water use swings with the weather. A hot, windy day can pull 6 mm out of the soil. A cool, damp one pulls 1 mm. Rain can cancel an irrigation session altogether. A calendar ignores all of it.

Connect on LinkedInSagnik Bhattacharya

A water log works like a bank account for the root zone. Water leaves each day through the crop and soil surface (the withdrawal), and arrives as rain or irrigation (the deposit). When the balance gets low enough that the crop would start to struggle, you irrigate. The method is standard in irrigation advice; the point of this tutorial is to make it practical in one spreadsheet, without sensors or controllers.

Subscribe on YouTube@sagnikteaches

This is deliberately not an internet-of-things project. There are no probes to buy or wire. If you later add sensors, the log still works as the place where their readings and your own notes meet.

The Complete Excel Course with AI Integration thumbnail

The Complete Excel Course with AI Integration

From formulas and pivot tables to Power Query, DAX, VBA and AI with Copilot, ChatGPT and Claude — hands-on from the first lesson.

By Sagnik Bhattacharya and Virginia Thorn, Primetime Emmy Award winner

Buy now

The five columns that do the work

Keep one tab per field or block with the same columns, and one settings tab. The daily tab needs these:

ColumnWhere it comes fromNotes
DateYouOne row a day through the season
Crop stageYouChoose from a short list: establishing, rapid growth, flowering or fruit set, ripening
Reference ET0 (mm)Weather dataThe daily water loss of a well-watered reference grass surface
Rain (mm)Rain gauge, with weather data as a cross-checkYour own gauge beats a model for your field
Irrigation applied (mm)Pump hours times your application rateConvert minutes to millimetres once, on the settings tab
Soil noteYouFinger test or spade check: dry, moist, wet, crusting, cracking

A column for "crop water use" is calculated, not typed: reference ET0 multiplied by the crop coefficient for the stage, a number your adviser gives you. Then a "root-zone deficit" column adds that day's water use, subtracts rain and irrigation, and carries the total forward. Keep it from going below zero, because a negative deficit means the soil is full and the extra drains away.

If you already keep farm records in notebooks, using AI for farm records and paperwork covers turning the notebook into digital rows. Photographed pages can become spreadsheet rows too; turning handwritten forms into spreadsheet data describes what to check.

Getting the weather numbers without IoT

You need two weather feeds: yesterday's actuals and the next few days' forecast. Open-Meteo is one source that offers daily reference evapotranspiration (its variable is named et0_fao_evapotranspiration), daily rain totals and, hourly only, modelled soil-moisture values at several depths, chosen on its API page by ticking boxes and then downloading a CSV or XLSX file. A caution that matters for a farm: its free tier is for non-commercial use, and commercial use needs one of its paid plans. A farm selling produce is a commercial user, so read the current terms, then either pay for the plan, or use another source such as your national weather service's published data or a nearby station network.

Whichever feed you choose, three habits make it dependable:

  • Use the location of your field, not the nearest town, and note the source's grid resolution so you know it is an estimate for the area rather than your exact plot.
  • Install a plain rain gauge in an open spot and read it every morning. Model rainfall can miss a thunderstorm that fell on the next valley and not on you.
  • Download the file yourself and paste it into the sheet, rather than asking ChatGPT to look up the weather. A model that browses can misread a forecast table, and you will not notice.

Worked example: a 1.5-hectare vegetable grower

Illustration, with placeholder numbers. A grower has 1.5 hectares of field vegetables on sandy loam under sprinklers that apply 6 mm an hour. Her adviser has given her a crop coefficient of 0.9 for the current stage and a trigger level of 25 mm of accumulated deficit. Those two figures sit on her settings tab, and she wrote them from her adviser's table, not from the AI. The numbers below are illustrative.

DayET0 (mm)Crop use at Kc 0.9 (mm)Rain (mm)Irrigation (mm)Deficit at end of day (mm)
Start of week8.0
Mon4.54.10012.1
Tue5.04.50016.6
Wed5.24.70021.3
Thu4.84.30205.6
Fri3.02.7602.3
Sat2.52.3400.6
Sun4.03.6004.2

On Thursday the deficit crossed the trigger (25.6 mm before irrigation on Thursday's own use), so she ran the sprinklers for 3 hours 20 minutes (20 mm at 6 mm an hour) on Thursday evening. Rain on Friday and Saturday then did the rest. Her old routine was three sessions a week of 15 mm each, 45 mm in total. This week the log called for 20 mm, a gap of 25 mm. Over 1.5 hectares, 1 mm of water is about 15 cubic metres, so 25 mm is roughly 375 cubic metres not pumped. Treat that as an example of the arithmetic, not a promised saving: the true saving depends on your soil, crop and old habit.

Asking ChatGPT to draft the schedule

With the log filled in, paste the last fourteen days and the three-day forecast into ChatGPT, or upload the sheet if your plan allows file uploads. If you are unsure what it can read reliably, what ChatGPT can read in PDFs, spreadsheets and photos lists what breaks. A prompt that has worked well for this kind of job:

You are helping a grower plan irrigation. Use only the numbers I give you; do not use your own crop data.

Settings: crop coefficient 0.9; trigger level 25 mm of deficit; sprinkler rate 6 mm per hour; maximum single application 20 mm.

Table 1 (last 7 days): date, ET0 mm, rain mm, irrigation mm.
[paste]
Table 2 (next 3 days forecast): date, ET0 mm, rain mm, probability of rain %.
[paste]

Task:
1. Recalculate the running deficit by day, showing the arithmetic.
2. Say on which day the deficit is forecast to reach the trigger, using forecast rain only where probability is 70% or higher.
3. Suggest an irrigation date and run time in minutes. If forecast rain makes it unnecessary, say wait and why.
4. List any number in my tables that looks wrong or missing.

Illustrative reply:

Deficit at end of Sunday: 4.2 mm.
Forecast: Mon ET0 4.4 (use 4.0) -> 8.2; Tue ET0 5.1 (use 4.6) -> 12.8; Wed ET0 5.4 (use 4.9) -> 17.7 (rain 3 mm at 40%: ignored).
The trigger of 25 mm is not reached within the forecast. Suggestion: no irrigation Mon to Wed; recheck Wednesday evening.
Check: Friday's irrigation cell in Table 1 is blank rather than 0. I treated it as 0; confirm nothing was applied that day.

Notice the model has flagged a blank cell instead of quietly guessing. That is why item 4 is in the prompt. If its sums disagree with the spreadsheet's, trust the spreadsheet formulas, which do not make arithmetic slips, and use the model for the second reading, the recommendation wording and the questions.

Letting ChatGPT build the spreadsheet formulas

You do not need to write the formulas yourself. Describe the columns and ask for the cell formulas, then test them with three days of numbers you can check by hand. A prompt that gets a usable result:

My sheet has these columns: A date, B crop stage, C ET0 mm, D rain mm, E irrigation mm, F crop use mm, G deficit mm. The settings tab has a table of crop coefficients by stage in Settings!A2:B6 (stage in A, coefficient in B).
Write the formula for F2 that multiplies C2 by the coefficient for the stage in B2.
Write the formula for G2, where G1 holds the starting deficit, so that G2 = G1 + F2 - D2 - E2 but never goes below zero.
Add a conditional-format rule that turns G red when it is 25 or more.

Expect something like =C2*VLOOKUP(B2,Settings!$A$2:$B$6,2,FALSE) for the crop-use column (the dollar signs keep the lookup range fixed when you fill the formula down; if the reply leaves them out, every row below the first looks in the wrong place) and =MAX(0,G1+F2-D2-E2) for the deficit. Check both with a calculator for the first three rows. If you use Excel, the ChatGPT and Excel guide covers asking for formulas and checking them; the Google Sheets version of the same trick is the same idea with the same function names.

Three settings tabs for three different farms

The log is the same shape for every grower; the settings tab changes. Three illustrative setups, each with placeholder numbers that the farm's own adviser would replace:

  • Drip-irrigated tomatoes in a polytunnel. Rain never reaches the crop, so the rain column is zero and the tunnel's reference ET0 is lower than outdoors because the plastic cuts wind and some sun. The grower logs a daily water-use figure from the weather feed, scales it by a tunnel factor from her adviser, and enters irrigation as litres per plant converted to millimetres across the bed area. She irrigates often in small doses, so the maximum single application is set low.
  • A small orchard on drip lines. Only part of the ground is wetted, so the application depth is calculated over the wetted strip, not the whole orchard floor. The coefficient moves with the season: low before leaf-out, high at fruit growth, falling after harvest. The settings tab holds a small table of dates per stage, and the stage column reads from it.
  • Pasture with a travelling irrigator. A single pass puts down a large depth at once, so the trigger is higher and the maximum single application is the machine's minimum pass. The question the log answers is simple: how many days until the next pass, given forecast water use and rain?

Handling the forecast without chasing it

Forecast rain is the number most likely to waste your effort in either direction. Hold off irrigation for a forecast that does not arrive and the crop goes short; ignore a real downpour and you flood the field. Give the AI a fixed rule rather than leaving it to judgement: count forecast rain only when the stated probability is 70% or higher, and then count only half the amount, because forecast totals are less certain than forecast timing. Put both numbers on the settings tab. Review them at the end of the season by comparing what was forecast with what the gauge recorded, and move them if the forecasts for your area are consistently better or worse than that.

Checking the draft against local advice

The schedule is a suggestion, and a farm has realities no spreadsheet sees: the pump has a day off, the tractor is on the field, a fungicide needs a dry leaf, a crop is entering a stage where stress costs yield. Run the draft past three checks before acting on it.

  • Numbers. Are the coefficient, the trigger and the maximum application the ones your adviser gave you for this stage? Update them when the crop moves to its next stage; the AI will not know unless the settings tab changes.
  • Soil. Does the finger test agree? If the log says the deficit is low and the soil is crumbling at 10 cm, believe the soil and note the mismatch.
  • Constraints. Salt, disease, pump capacity, water licence limits and any restrictions on use come first. A log that recommends 20 mm when your licence allows 15 is still wrong.

Write down when you overrode the schedule and why. Each override is information: either a setting is wrong or the model of the soil is too simple.

Soil notes that earn their place

Free-text soil notes such as "bit dry" are hard to use later. Give yourself a fixed scale: 1 for cracking, 2 for dry and crumbly at spade depth, 3 for moist and holds together, 4 for wet and sticky, 5 for waterlogged. Score one or two spots per field at the same depth each time, and add a second column for anything unusual, such as a crust after heavy rain or wilting by midday.

This scale is useful to the AI too. Ask it each Friday: "Compare my soil scores with the calculated deficit over the last four weeks and tell me where they disagree by more than one step." Disagreements point to a wrong coefficient, a field with different soil or a faulty rain reading.

Before and after for one noisy field

A typical use: Field 3 always scored wetter than the calculated deficit suggested. The AI's comparison showed five weeks where the log said "21 mm deficit" and the soil score was 4. The explanation turned out to be a leaking joint on a feeder pipe nearby, not a modelling error. The log did not find the leak; the mismatch made the grower look for one. That is the realistic role of the system: it sharpens questions.

A weekly routine that takes twenty minutes

  1. Monday morning: read the gauge, write yesterday's rain, paste the weather download into the sheet.
  2. Check the soil scores for each field and fill in the stage column if anything has moved on.
  3. Paste the table and forecast into ChatGPT with the standing prompt.
  4. Compare the draft's deficit with the sheet's. Resolve differences by checking the inputs first.
  5. Apply the three checks above and decide the week's plan.
  6. After irrigating, enter the actual run time and flow. The log is only as good as what really happened.

Save the prompt text on your settings tab so each week is a paste, not a rewrite. Keep a separate tab named "overrides" with date, what the schedule said, what you did and why.

Mistakes that quietly ruin a water log

Four slips account for most bad logs. The first is mixing units: entering a pump run in minutes in a column of millimetres. Put units in every column heading. The second is carrying a deficit forward through a heavy rain without capping it, so the log shows a negative number and later months start from the wrong place; cap the root-zone balance at zero. The third is using last season's crop coefficient for a different crop or stage. The fourth is trusting a satellite-based rainfall figure over your own gauge after a localised storm.

A small example: a grower typed "30" into the irrigation column meaning 30 minutes, not 30 mm. The log thought the field had received a vast drenching, wiped out the deficit for two weeks and told him to hold off. The crop showed stress before he found it. The fix was a data-validation rule that rejects any irrigation entry over 25. When you set up your sheet, add such a limit to every column that you type into.

Keeping the log honest over a season

Review the system monthly with one question: did the crop ever show stress while the log said it was fine, or did the soil stay wet after the log called for water? Those are the two failures. If the first, lower the trigger level or raise the coefficient (with your adviser's agreement). If the second, the reverse.

Count the pump hours or read the water meter each month and compare with the same month last year, noting the weather difference. A drier year will use more water regardless, so look at litres per tonne of harvested crop if you can. The measure that makes sense for you is whichever one you can calculate without a debate. When the log is working, the spreadsheet is boring: the same twenty minutes each week and fewer tap openings than before. If you find the sheet outgrowing itself, when to replace manual spreadsheets with AI-assisted tools helps you decide what comes next, and an error log like the one in tracking AI mistakes so they stop repeating is a good home for the overrides.

Keeping the data on your side

The log is business data about your land, yields and water use. Use a work account for any chat tool, switch off training on your content where the settings allow it, and paste only the columns the task needs: dates and millimetres, not your plot names, supplier details or licence numbers. Keep a plain copy of the spreadsheet in your own storage; do not leave the only copy inside a chat history.

Questions growers ask before trusting a log-based schedule

Can ChatGPT look up my weather itself?

Not reliably. Depending on your plan and settings it may browse, but forecasts and rainfall figures can be misread or out of date. A safer routine is to download the daily figures yourself as a CSV and paste or upload them, so the model works from numbers you can see.

Is the free Open-Meteo service allowed for a farm business?

Open-Meteo's free tier is for non-commercial use; commercial use needs one of its paid plans. A working farm should read its terms and either pay, or use a national weather service, a nearby station network or its own rain gauge. Check the terms before relying on it.

Where do I get my crop coefficients?

From a local crop adviser, an agronomist, a growers' association or a university advisory service for your crop and region. Do not let the AI invent them. Put the adviser's numbers in a table on a settings sheet and let the spreadsheet use them.

How much water could a log save?

It depends on how far your current habit drifts from what the crop uses. Growers who irrigate on a fixed calendar often find they skip a few sessions after wet spells. Measure your own before and after with a water meter or pump hours, and judge from that.

Further reads

Sources: Open-Meteo pricing, terms and API documentation pages, read 5 November 2026 (free API non-commercial only; daily ET0 and rain sums; hourly soil moisture; CSV and XLSX download); general crop-water-balance method from standard irrigation guidance. Crop coefficients and trigger levels must come from local advice.

Want your watering records turned into a routine you can run?

On a 1:1 call we'll look at how you record water today, decide which rows the weather feed can fill in automatically, and set up a weekly check you can run yourself.

Book a 1:1 call with me