Skip to content
Adaptive AgroTech NetworkUniversity of Southern Denmark · SDU Drone Center
Cover for Fridge Door Left Open? Build a 20-Second Arduino Alarm

Video by Adaptive AgroTech. If the embedded player is unavailable, open the original video ↗.

Fridge Door Left Open? Build a 20-Second Arduino Alarm

A door switch gives an Arduino a simple timing problem. The alarm sounds only when the fridge door stays open for 20 continuous seconds.

Understand the concept

The key idea

Opening the door starts the timer. Closing it clears the elapsed time, so two short visits to the fridge count as separate events.

What to remember

  • Time one uninterrupted opening.
  • Clear the timer when the door closes.
Pause & think

Check your understanding

The door opens for 12 seconds, closes, then opens for another 12 seconds. Should the alarm sound?

Show the explanation

No. Each opening lasted less than 20 seconds.