We designed a smart fridge addon that tracks items placed into a fridge. On the Arduino Nano (ATMEGA328p), we implemented various features to track fridge state. We write and read from EEPROM to maintain state in power loss, and use a real time clock module to compare the time against expiration dates. This system could potentially support thousands of food items, although only two keywords were added for demo purposes (these are apple and orange). The Arduino writes over UART to the Raspberry Pi whenever a food item expires, which is then displayed on the touch screen through a Flask server (running in parallel with the detection scripts). Whenever the Raspberry Pi camera sees a new food item, a message is sent back to add it to the database. By isolating expiration tracking and food detections in this way, we have created a flexible, customizable fridge system. For example, we could extend this system to support other features such as barcode scanning, and the Arduino system would not need to change. Additionally, there is a photoresistor used to detect whether the fridge is closed or not, so we can update Flask accordingly, and not accept food entries when the fridge is closed. Finally, we use a buzzer to indicate to the user that food has expired.
From a technical perspective on the C side, we run an infinite blocking loop, which waits for food input from the Raspberry Pi. Once it receives this, it immediately inserts the relevant food item into the database. We also have two interrupts. The first is a timer interrupt which periodically interrupts the polling process to check for existing expirations. It loops the database, and if it finds any will trigger the buzzer to a relevant frequency. The second interrupt is the ADC interrupt, which is enabled within the timer interrupt and then called before it exits. In this manner, we can update ADC state, without conflicting with the existing expiration checking process.
The vision side uses YOLOv8 detections paired with DeepSort tracking to reduce context switching, implemented on the Raspberry Pi. For simplicity in this project we force single detections, and will not register a new item until the old exits the frame. However, these systems are designed to work with multi-object tracking and could be enabled as we improve our technology more.
Log in or sign up for Devpost to join the conversation.