Skip to content
experience

A retired banker's first Raspberry Pi: a weather station on my terrace in Chennai

S. Ramanathan@ramanathan_retd

June 3, 2026 · 4 min read

Dear friends,

I retired two years ago after 34 years in the IT department of a public sector bank. I began with punched cards, spent most of my career with COBOL, CICS and DB2, and learned Java in my fifties because the bank said so. My grandson, who is 17, informed me last year that COBOL is "basically dead" and that I should learn Python. I informed him that COBOL processed his grandmother's pension this morning. We agreed that I would learn Python if he would learn to make filter coffee properly. He has not kept his side of the agreement. I have kept mine.

கற்றது கைமண் அளவு, கல்லாதது உலகளவு. "What we have learned is a handful of sand; what we have not learned is the size of the world." Avvaiyar said it long before computers, and it has never been more true for me than this year.

What I built

A small weather station on the terrace: temperature, humidity and air pressure every ten minutes, stored in a database, with a simple graph my wife checks each morning to decide whether to put the clothes out to dry. For a Chennai household this is a serious application.

The parts

  • Raspberry Pi 4, 2GB, purchased from a shop on Ritchie Street after a long negotiation
  • A BME280 sensor module (temperature, humidity, pressure), which speaks I2C
  • A USB pen drive instead of an SD card, on the advice of Matt from this very site
  • Four jumper wires, and a plastic box from the kitchen, with permission

The steps, as a COBOL man understood them

  1. Enabled I2C in sudo raspi-config, under Interface Options.
  2. Connected the sensor: 3.3V, ground, SDA to GPIO 2, SCL to GPIO 3. I checked each wire twice, as one checks a JCL card before submitting a job.
  3. Ran i2cdetect -y 1, and the number 76 appeared in the grid. That is the sensor's address. I was more pleased by this number than I have been by most salary revisions.
  4. Installed the Python library. Here I met the first surprise: Raspberry Pi OS refuses pip install system-wide now, with the message "externally-managed-environment". My grandson explained virtual environments, which reminded me of having a separate load library for each application. Some ideas simply come back with new names.
python3 -m venv /home/ram/wx
/home/ram/wx/bin/pip install RPi.bme280

The program itself is short. I wrote it in vi. Not Vim. vi.

import smbus2, bme280, sqlite3, time

bus = smbus2.SMBus(1)
cal = bme280.load_calibration_params(bus, 0x76)
d = bme280.sample(bus, 0x76, cal)

con = sqlite3.connect('/home/ram/weather.db')
con.execute("INSERT INTO readings VALUES (?, ?, ?, ?)",
            (int(time.time()), d.temperature, d.humidity, d.pressure))
con.commit()
con.close()

And one line in the crontab, which needed no explanation from anybody, as cron is older than my grandson's father:

*/10 * * * * /home/ram/wx/bin/python /home/ram/read.py

Mistakes

  • On the first sunny day the station reported 47 degrees. Chennai is hot, but it is not that hot. The sensor was in direct sun. I built a small radiation shield from five white plastic plates stacked with spacers, so that air passes through but the sun does not reach the sensor. It now reads within a degree of the airport figure.
  • During the first heavy rain, water entered the kitchen box. My wife has asked for a new box. The station now lives in a proper junction box from the electrical shop, with a drip loop on the cable.
  • In the first week I wrote the timestamp as a string in DD-MM-YYYY format. Sorting did not work. Thirty-four years in banking and I made the oldest date mistake in the book. The integer timestamp above is the corrected version.

To the young people

Learn something new every year, however old you are. And save twenty percent of your salary from the first month. The second advice is more important than the first, but nobody listens to it until they are fifty.

With regards,
S. Ramanathan

Get the best of #raspberry_pi_lab weekly

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

Comments

10

Sign in to join the conversation.

Sign in to comment
Karthikeyan S@karthik_embedded#2 in Pi Lab
ஐயா, அருமை! 🙏 One small tip for Chennai monsoon: BME280 humidity reading will go to 100% and stay there for some time after heavy rain, condensation inside the sensor. It is normal, it recovers when it dries. If it stays stuck for days, the sensor is gone, they are cheap to replace.
1 net votes
S. Ramanathan@ramanathan_retd#6 in Pi Lab
Thank you, Karthikeyan. This explains the morning after the rain last week, when my wife's graph showed 100% until lunchtime. I had assumed the program was at fault. Old habits.
3 net votes
Rohit Verma@rohit_codes1 rep in Pi Lab
Uncle ji salute 🙏 "COBOL processed his grandmother's pension this morning" is the best line I have read on this site. bhai koi isko frame karo
3 net votes
Matt O'Brien@pi_tinker_matt#1 in Pi Lab
Mr Ramanathan, this made my whole morning. The stacked plates radiation shield is exactly right, that's what the proper ones are. And "more pleased by this number than by most salary revisions" is going on the wall of my shed. Welcome to the club!
0 net votes
Graham Whitfield@greybeard_graham#7 in Pi Lab
A fellow greybeard, and a welcome one. The DD-MM-YYYY confession made me laugh out loud, because I did the same thing in 1991 and again, I am ashamed to say, in 2019. Lovely post. Cheers, G.
0 net votes
Karthik Subramaniam@karthi_rustacean1 rep in Pi Lab
Sir, I respect everything in this post, except vi. Neovim is waiting for you 😄
4 net votes
S. Ramanathan@ramanathan_retd#6 in Pi Lab
Young man, vi was waiting for me in 1991. It is still waiting, and so am I.
1 net votes
Chaminda Perera@chaminda_sysops2 rep in Pi Lab
Ramanathan sir, from one bank IT man to another: the JCL card comparison made me smile. I still check my cron lines the same way. Welcome to the terrace computing club, machan.
2 net votes
Mehmet Aydoğan@malloc_mehmet#9 in Pi Lab
Finally an adult on this website. Good work sir. The radiation shield shows you read before you build. Most people here do the opposite.
2 net votes
Anitha Joseph@anitha_miss2 rep in Pi Lab
Sir, I showed this post to my Class 11 children today. They were very surprised that a grandfather writes Python. Two of them want to build the same station for our school terrace now. Thank you for the inspiration.
4 net votes