Every good project needs a brain.
But the real magic? That’s in the flow — how information moves from sensors to the cloud and back.
This blog is all about that invisible choreography. The part you don’t really see but totally depends on.

Working of my Project
Let’s break it down.
Imagine water rising in a river.
Here’s what happens, step by step, inside my setup:
- TDK Ultrasonic Sensors measure water level distance from Sensor which is placed at Danger line marking.
- Arduino will Connect to wifi. If not connected it will keep trying until its connected.
- Once wifi connected it will fetch the google sheet Named “TDK-MKR-Logger’ tab “ConfigDetails”
- From there it will fetch the THRESHOLD_VALUE and POST_INTERVAL_MS parameter
- THRESHOLD_VALUE will define the alarming water level to send upcoming flood alert
- POST_INTERVAL_MS will tell the frequency of distance measurement i.e. interval after which distance is measured
- Arduino will keep measureing distance of water level from Danger mark at fixed time interval (POST_INTERVAL_MS ) from TKD Sensors. It packages that info into a neat little JSON payload .
- Then send this distance to Google sheet. payload is sent via HTTPS POST to my Google Apps Script Web App . The script logs it in Google Sheets under the “DataLog” tab.
- When distance from water level is received by google sheet it will check if Distance is less than threshold ?
if yes then it will send alert to Predefined Email addresses stored in “Email_list” Tab in sheet. - I keep configuration in google sheet so that in case if you want to change the threshold level or frequency of measurement taken , yoou don’t need to go to riverbed or waterbody and take Arduino out of box and reprogram it. Just simply change configuration details in google sheet and it will work . no need to reprogram Arduino for each time we change Flood parameters Configuration.
The System at a glance
So when the water rises, this happens in about 3–4 seconds:
- Sensor sees distance drop
- Arduino detects it’s below threshold
- JSON sent to script
- Sheet updates
- Email alert sent
- Arduino confirms
From splash to inbox — all automated.
Why This Flow Works
It’s modular, lightweight, and transparent.
- Change the cloud? Just update the endpoint URL.
- Change sensors? Code barely changes.
- No complex cloud subscription, no hidden dependencies.
- Can be created multiple such small packets of devices at different places of the water body or river with unique names so can be get more clear picture of flood estimation
It’s simple enough for DIYers, yet structured enough for scaling. But for now we will be focused only on our useful tiny Project.