It was 2019. I was deep into the "Internet of Things" phase of my life. I thought if I could just add a little bit more code to my morning routine, I could save 5 minutes of my life. So, I decided to build a smart coffee maker.
The plan was simple: A Raspberry Pi, a relay board, a coffee maker, and a whole lot of confidence. The goal? To wake me up at 7 AM with a fresh cup of coffee, ready and waiting.
Here's the thing about relays and water: they don't always play nice. I wired the relay to control the coffee maker's power. Simple, right? Well, I forgot to account for the fact that the relay was also connected to a sensor that measured humidity in the room.
Long story short, the humidity sensor malfunctioned, and instead of brewing coffee, it triggered the water reservoir to dump its entire contents onto my kitchen floor. A gallon of espresso beans and water, all over my hardwood floors.
That flood taught me more about system architecture than any course I've ever taken. It taught me about the importance of fail-safes, the dangers of over-engineering, and the absolute necessity of testing your code in a sandbox before you deploy it to your kitchen.
Here's a snippet of the code that almost drowned my kitchen:
def brew_coffee():
if humidity_sensor.read() > 80:
print("It's raining inside! Let's make some coffee!")
relay.turn_on() # Big mistake.
time.sleep(300) # 5 minutes of brewing... and flooding.
relay.turn_off()
print("Coffee's ready! Oh wait, my kitchen is now a pool.")
I spent the next three days mopping up espresso and trying to salvage my hardwood floors. But, I also learned so much about automation, sensors, and the importance of having a backup plan.
Want to see more of my adventures? Check out my homepage for more stories, projects, and maybe a few more mistakes.
Visit My Homepage