Skip to content
experience

My grandson and I built a weather station on the terrace. He wrote the Python, I wrote the SQL, and the rain did the rest.

S. Ramanathan@ramanathan_retd

October 15, 2026 · 5 min read

Dear friends,

Some of you have read my long stories about the bank. This one is shorter, and happier, and I hope you will forgive an old man for being a little proud.

My grandson Vignesh is fourteen. He lives with us in Chennai while his parents work in Bengaluru, and for most of last year our relationship consisted of me asking him to put his phone down and him explaining to me, very patiently, that Python is better than COBOL. I do not dispute this. I only dispute his tone.

In July his school announced a science exhibition. He came to me (this alone was remarkable) and asked if I would help him build "something with that Raspberry Pi you keep on the terrace". That Pi had been sitting in a plastic box for a year, running nothing but a clock.

What we built

Over three months of Saturday mornings, with filter coffee for me and Horlicks for him (he denies the Horlicks):

  • A Raspberry Pi 4 in a ventilated box in the shade under the water tank on the terrace.
  • A BME280 sensor for temperature, humidity and pressure, on the I2C pins. Vignesh soldered the header himself. I held the torch. We both burnt our fingers, him once and me twice.
  • A tipping bucket rain gauge, bought online for about Rs. 2,000. Every time its little bucket fills with rain and tips, it closes a magnetic switch, and the Pi counts it. Each tip is 0.2794 mm of rain, because it is an old American design and the number is really 0.011 inches. Vignesh wanted to know why such a strange number. I told him that is what happens when you let Americans design rain gauges. He found this very funny and repeated it to his teacher, who did not.
  • Python to read the sensors every five minutes (his part). With the gpiozero library, the rain counter was only a few lines:
from gpiozero import Button

tips = 0
def tipped():
    global tips
    tips += 1

gauge = Button(17, pull_up=True, bounce_time=0.05)
gauge.when_pressed = tipped
  • SQLite to store the readings (my part, and I was firm about this). He wanted to write everything to a text file. I gave him a lecture on data integrity which he says was forty minutes, and which I maintain was twenty. We agreed on this table:
CREATE TABLE reading (
  taken_at   TEXT PRIMARY KEY,   -- ISO time in UTC, one row per 5 minutes
  temp_c     REAL NOT NULL,
  humidity   REAL NOT NULL,
  pressure   REAL NOT NULL,
  rain_tips  INTEGER NOT NULL DEFAULT 0
);

And then the query I am proudest of, daily rainfall in millimetres, which he now calls "Thatha's query":

SELECT date(taken_at, '+5 hours', '+30 minutes') AS day_ist,
       ROUND(SUM(rain_tips) * 0.2794, 1)        AS rain_mm,
       ROUND(MAX(temp_c), 1)                     AS max_c,
       ROUND(MIN(temp_c), 1)                     AS min_c
FROM reading
GROUP BY day_ist
ORDER BY day_ist DESC;

(The '+5 hours', '+30 minutes' is because we store UTC, and in India the day begins five and a half hours earlier. Vignesh asked why we do not simply store Indian time. I told him about a night in 1998 when a vendor's system running in two time zones posted interest on the wrong day for nine thousand accounts, and he has stored UTC ever since.)

The exhibition

The exhibition was last Saturday. By luck we had a tremendous thunderstorm the week before, and on the Wednesday the station recorded 71 mm in one afternoon. Vignesh printed a graph. He made a poster that said "Real Chennai Rain, Measured on Our Terrace".

I went along, because he asked me to. I sat at the back. When the judges came to his table, he explained the sensors, the Python and the rain gauge, and then he said, and I am quoting exactly because I wrote it down in the car afterwards:

"The database part was done by my Thatha. He wrote software for banks before the internet. He says if the data is wrong, nothing else matters."

Then he pointed at me. At the back. The judges turned around, and I did not know what to do with my hands.

He got second prize. He says first prize went to a robot that "did not even work properly". I have told him that this is also how it is in industry.

What I want to say

For thirty-four years I wrote software that nobody saw. Batch jobs at 2 am, files moving from one machine to another, interest calculated correctly on accounts belonging to people who never knew my name. That was fine. That is the job. But I did not expect, at sixty-two, to be pointed at in a school auditorium by a fourteen-year-old who until July thought I was mainly a person who tells him to put his phone down.

The weather station is still running. Last night it rained 18 mm. Vignesh checked it on his phone before school this morning, using Thatha's query, and told me at breakfast. He did not put his phone down. For once I did not ask him to.

Avvaiyar wrote "Ilamaiyil kal": learn while you are young. She said nothing about learning when you are old, so I am adding that part myself. He taught me gpiozero. I taught him a primary key. I think we both came out ahead.

With regards,
S. Ramanathan

Get the best of #touch-grass weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.

Comments

31

Sign in to join the conversation.

Sign in to comment
Karthik Subramaniam@karthi_rustacean1 rep in Touch Grass
Sir, I have tears in my eyes at my desk. "If the data is wrong, nothing else matters" is the best thing a fourteen year old has ever said. And storing UTC at fourteen, he is already ahead of half my team only. Please tell Vignesh a stranger in Chennai is proud of him. @chaminda_sysops you must read this
13 net votes
S. Ramanathan@ramanathan_retd#1 in Touch Grass
Dear Karthi, I will tell him tonight. He will pretend not to care and then ask me to read it twice. With regards
8 net votes
Karthikeyan S@karthik_embedded1 rep in Touch Grass
Sir, BME280 in the shade under the water tank with ventilation, correct placement. Most people put it in direct sun and measure 48 degrees in Chennai 😄 Second prize with real data beats first prize with a robot that doesn't work. Field engineering wins.
12 net votes
Anitha Joseph@anitha_miss1 rep in Touch Grass
Sir, I am going to read this to my class tomorrow. The primary key and gpiozero exchange is what learning should look like, in both directions. Please congratulate Vignesh from Anitha miss in Kochi.
11 net votes
Lakshmi Prasad@lakshmi_teaches_py1 rep in Touch Grass
Respected sir, I am a teacher and I am crying in the staff room. "He taught me gpiozero. I taught him a primary key." I will remember this sentence for the rest of my career. Thanking you for sharing.
15 net votes
Nikhil Sharan@nikhil_twopointers1 rep in Touch Grass
Sir, this is the best "how to teach" post on the site. Python from the kid, SQL from the grandfather, data integrity as the moral. Vignesh ko meri taraf se bahut bahut badhai 🙏
16 net votes
Sam Whitaker@segfault_sam1 rep in Touch Grass
i make jokes about software every day and this is the first post in months that made me put the phone down. congrats vignesh. congrats thatha
12 net votes
박지우@jiwoo_front#4 in Touch Grass
this made me call my 할아버지 today. thank you sir... 🙏
18 net votes
S. Ramanathan@ramanathan_retd#1 in Touch Grass
Dear Jiwoo, That is the best thing anyone could have done after reading it. With regards
11 net votes
Renee Whitfield@renee_em3 rep in Touch Grass
"I did not know what to do with my hands." I've read this three times and that line gets me every time. Congratulations to you both. What a gift, to be seen like that.
16 net votes
Hamish Turner@hamish_on_the_farm#2 in Touch Grass
mate. best post on here, no contest. tell young Vignesh a dairy farmer in NZ is checking his own rain gauge this morning because of him. chur
20 net votes
Walt Hendricks@walt_mainframe1 rep in Touch Grass
Mr. Ramanathan, I read this out loud to my wife. She asked why I was quiet afterwards. I told her I was wondering whether my grandchildren will ever point at me in an auditorium. Congratulations, sir. To both of you.
12 net votes
S. Ramanathan@ramanathan_retd#1 in Touch Grass
Dear Walt, They will. But first you must find a Raspberry Pi and a rainy season. I recommend both. With regards
12 net votes
Peter Hughes@amiga_pete1 rep in Touch Grass
Lovely, lovely stuff, Mr Ramanathan. This is exactly what I hoped this place would be when I joined. The judges turning round to look at you got me. Cheers, Pete
15 net votes
Karl Lindqvist@kernel_karl1 rep in Touch Grass
Correct schema. Correct time zone handling. Correct debounce. Second prize is an injustice. Good post.
15 net votes
Matt O'Brien@pi_tinker_matt4 rep in Touch Grass
Sir this has absolutely made my week. Storing UTC, a proper schema with NOT NULL, bounce_time on the rain gauge (most people forget and count every bounce as 3 tips 😅). Vignesh is going to be dangerous. Tell him Matt from Brisbane says second prize is the real first prize. My weather station got eaten by a possum. His is still running. 🍓
16 net votes
S. Ramanathan@ramanathan_retd#1 in Touch Grass
Dear Matt, Vignesh watches your videos. He did not believe me when I said you might read this. I am going to enjoy this evening very much.
9 net votes
Matt O'Brien@pi_tinker_matt4 rep in Touch Grass
well now I have to send him a sticker pack. DM me an address sir 😄
6 net votes
Olivia Martin@liv_codes1 rep in Touch Grass
This is the most wholesome thing on the internet this week. Storing UTC at 14 is honestly more than I knew at 19!
10 net votes
Graham Whitfield@greybeard_graham5 rep in Touch Grass
Mr Ramanathan, I have been on this site since nearly the beginning and I believe this is the best thing anyone has posted on it. The line about Americans and their rain gauges will stay with me. So will the bit where you did not know what to do with your hands. Congratulations to you both. Cheers, G.
15 net votes
S. Ramanathan@ramanathan_retd#1 in Touch Grass
Dear Graham, Coming from you, this means a great deal. I still do not know what to do with my hands. With regards
6 net votes
Meenal Deshpande@meenal_restarts1 rep in Touch Grass
Sir, reading this at 5.30 am before the tiffin boxes, and now I have to go and make them with wet eyes. Congratulations to Vignesh, and to you.
17 net votes
Divya Ramanathan@divya_ramanathan2 rep in Touch Grass
Sir (no relation, though I wish!), my daughter is seven and I am saving this for her. Avvaiyar would approve of your addendum.
7 net votes
Jen Hayes@night_owl_jen1 rep in Touch Grass
i'm ugly crying at 10pm with a sleeping toddler on me. my 9 year old is getting a raspberry pi for christmas, i've decided. thank you sir 🦉
10 net votes
Wyatt Kessler@wagmi_wyatt1 rep in Touch Grass
ok boomer content but kinda wholesome ngl. teach him crypto next so he can retire way before 62 🚀
-22 net votes
Sayan Mukherjee@bong_bugs2 rep in Touch Grass
bro read the most wholesome post of the year and still found a way to shill 💀
10 net votes
Rohit Verma@rohit_codes1 rep in Touch Grass
bhai har post pe crypto mat ghusao 😂 sir ka post hai, respect se
5 net votes
Chaminda Perera@chaminda_sysops1 rep in Touch Grass
Machan, I mean, sir, this is beautiful. From one bank IT veteran to another: the most important thing you ever taught anyone was not COBOL, it was "if the data is wrong, nothing else matters". Your grandson heard it. Congratulations.
15 net votes
Aman Raj@kota_coder_171 rep in Touch Grass
dada ji bahut accha laga padh ke 🙏 main bhi python seekh raha hu kota mein. vignesh bhaiya ko congrats. mera snake game abhi chal raha hai 😅
18 net votes
S. Ramanathan@ramanathan_retd#1 in Touch Grass
Dear Aman, Thank you. Vignesh says snake games are where all good programmers begin. Please also do your physics. With regards
14 net votes
Kang Minjun@minjun032 rep in Touch Grass
sorry english not good. this story very warm. 감동이에요 😭 congratulations
14 net votes