CoolTab Fridge - Project One MCT
by Daan Theys in Circuits > Raspberry Pi
36 Views, 0 Favorites, 0 Comments
CoolTab Fridge - Project One MCT
Welcome to my CoolTab Fridge project! This project is a smart fridge designed for shared spaces, student houses, or offices. The fridge remains securely locked until a user scans their personal RFID badge. Once unlocked, the system registers the exact weight difference inside the fridge using multiple load cells. It automatically calculates what product was taken, logs the transaction in a relational database, and deducts the correct price from the user's digital balance.
Additionally, managers can access a dynamic web dashboard to track live and historical temperature data, adjust settings, view user balances, and manage stock.
This Instructable will guide you through the database architecture, electronic schematics, Python/FastAPI backend configuration, and the final physical assembly.
Supplies
Core Processing & Interfacing
- 1 x Raspberry Pi 4 Model B (4GB version recommended)
- 1 x Assembled Pi T-cobbler & GPIO Breakout extension board
Access Control & User Feedback
- 1 x RFID-RC522 module (SPI interface) including standard card and keychain badge
- 1 x LCD-display 16x2 (Blue character backlight, 5V input)
- 1 x Potentiometer (10k Ohm, used for fine-tuning LCD hardware contrast)
- 1 x Active Buzzer 5V (Acoustic confirmation indicator)
Sensors & Actuators
- 1 x MPU-6050 Accelerometer / Gyroscope module (I2C interface, embedded temperature tracking)
- 4 x Strain-gauge Load Cells (50kg capacity each, arranged in a Wheatstone bridge)
- 1 x HX711 Load Cell Amplifier & 24-bit A/D converter board
- 1 x Relay Module 5V Low-trigger isolation block (OT951-C101)
- 1 x Solenoid Electronic Lock 5V (OT4872) with spring latch and feedback signal wire
Structural Materials
- 1 x MDF Wooden Sheet ($61\text{ cm} \times 122\text{ cm} \times 12\text{ mm}$)
- 2 x Heavy-duty door hinges & industrial mounting screws
Setting Up the Relational Database
Setting Up the Relational Database
A robust smart device needs a solid database to ensure persistence, even during power outages.
For the CoolTab Fridge, we designed a MySQL database consisting of 7 interconnected tables:
- Users: Stores names, unique RFID tag IDs, digital balances, authorization roles (User vs. Admin), and whether or not a users account is blocked.
- Products: Keeps track of productnames, individual unit weights, prices, and live inventory status.
- Transactions & Transaction_lines: Logs every buying session, recording exactly who took what, when, and for how much.
- Components & Measurements: Act as a centralized logging system for raw sensor data (such as temperature intervals and door states).
- Settings: A key-value system used to dynamically adjust global parameters directly from the web interface, such as the maximum overdraft credit limit and the low-stock warning thresholds.
Fritzing & Electronics
Wiring the Components to the Raspberry
In this step, we connect our sensors and actuators to the GPIO pins of the Raspberry Pi 4. The electronics can be divided into three main subsystems:
1. Access Control & UI: The RFID-RC522 reader handles user identification via SPI communication. The 16x2 LCD display provides real-time feedback (showing the Pi's active IP address, greeting the user, and revealing their active balance) using a 4-bit parallel connection layout.
2. Actuators: A 5V relay module safely switches the current required to activate the 5V electronic solenoid lock when access is granted.
3. Telemetry & Weight Scale: An MPU6050 accelerometer/gyroscope measures internal temperature. To weigh the contents, 4 strain-gauge load cells (50kg each) are placed in a Wheatstone bridge configuration and connected to the HX711 amplifier, which sends clean digital data to the Pi.
Refer to the Fritzing schematic attached above for the exact pin mapping and wiring routes.
Python Backend & Frontend Logic
The brain of the CoolTab Fridge is written in Python, leveraging FastAPI for the asynchronous REST API and Socket.IO for instantaneous, real-time telemetry updates to the frontend web interface.
You can find the complete code for front-and backend on my github:
https://github.com/howest-mct/2025-2026-projectone-mct-Daan-Theys-howest
The Build & Physical Assembly
Constructing the Enclosure
The physical build consists of a custom-milled wooden cabinet divided into an upper hardware compartment and a lower refrigerated/storage zone.
Assembly Steps:
1. Milling & Mounts: Cut out precision windows in the front panel to flush-mount the RFID reader and the 16x2 LCD screen.
2. Scale Base: Mount the 4 load cells into the corners of the inner base plate using 3D-printed brackets to ensure the weight is distributed correctly onto the sensors. [insert img of the 4 load cells mounted on the inner base plate]
3. Lock Mechanism: Align the electronic solenoid lock with the cabinet door, routing the feedback wire (yellow wire) to a GPIO pin with an internal pull-up resistor to detect whether the door is physically latched or swinging open.
4. Cable Management: Keep low-voltage data cables (SPI/I2C) shielded and separated from the 5V switching lines to prevent electromagnetic interference from freezing the LCD or RFID reader.