WB081: The IoT Theory Meets Reality
As Japan's summer is incredibly hot, I have found it nearly impossible to keep outdoor plants alive. My late bonsai (Japanese: 盆栽), which did not survive last year's summer, was one such example.
Such experiences have prompted me to wonder if I could design and build an Internet of Things ("IoT") device that self-waters a potted plant. An IoT device, such as a wireless sensor or camera, collects and transmits data wirelessly to the cloud. The data can then be acted upon.
Impatience is the enemy of any grand vision, so I decided to start small by first learning how to automate measuring soil moisture data and transmitting it to the cloud.
Armed with the necessary parts from my geeky trip to an electronics hobby shop in Akihabara (Japanese: 秋葉原) and with Claude AI's help, I coded and assembled version 1 of my IoT device ("IoT Sensor").
Conceptually, it does the following:
- Wake up once a day at a pre-determined time
- Measure a plant's soil moisture level
- Wirelessly transmit the reading to a Google Excel workbook stored in the cloud
- Go into deep sleep mode to conserve energy
The IoT Sensor comprises the following parts:
- Raspberry Pico 2 W Microcontroller: The "brains" of the device. Programmed using a coding language called Python
- 3 x 1.5V AA Battery Pack: Total voltage of 4.5V powers the IoT Sensor
- Real-Time Clock Module: Keeps track of time when the IoT Sensor is in deep sleep mode. Also functions as an "alarm clock" to wakeup the IoT Sensor
- Maker Soil Moisture Sensor: A capacitive sensor manufactured by a Malaysian company called Cytron Technologies

Based on my calculations, the IoT Sensor's battery pack can theoretically power the system for nearly two months, with the sensor's ability to go into "deep sleep" mode key to this expected outcome.
Theory meets reality
Unfortunately, the IoT Sensor stopped logging the soil's moisture level six days after I got it to start working, evidenced by the Google Excel spreadsheet below.

During the process of figuring out what the issue was, I realised that troubleshooting IoT devices is much more difficult compared to a software application. The issue could either be a hardware- and/or software-related one, necessitating a lot of trial, error and patience.
That said, the thought process of breaking down a problem into small, testable parts is part and parcel of being a "builder".
So far, I have concluded that the IoT Sensor is not going into deep sleep mode as designed, resulting in current being continuously drawn from the battery pack.
Back to the drawing board for version 1.1!
--Ends