
Our earlier smart-lock project used a pre-stored card ID to grant access; this project takes the same MFRC522 reader in a different direction — a trash bin whose lid opens automatically for an authorized card, with the "authorized" card registered dynamically instead of hardcoded in advance.
Components needed
An Arduino Uno, an MFRC522 RFID reader with test cards, an SG90 servo motor to actuate the lid, a 16x2 LCD display with an I2C adapter for feedback, and connecting wires.
Wiring it up
The MFRC522 uses 3.3 V logic, and the pin marked SDA on many modules is actually the SPI SS/CS signal. Power the servo from a suitable separate supply when necessary and connect the grounds; do not rely on a small Arduino regulator for stall current.
How enrollment works safely
Provision authorized card identifiers ahead of time and protect the administration path. Treating the first card seen after every restart as a master card lets an attacker claim the system after a power interruption, so that pattern belongs only in a supervised classroom demo.
The access logic
A match opens the lid: the servo rotates to its open position, the LCD shows a confirmation message, and after a short delay the servo returns the lid to its closed position automatically. A card that doesn't match displays a rejection message on the LCD instead and prompts the user to try again, without moving the servo.
Why this differs from our smart-lock project
The smart lock keeps a genuinely fixed, hardcoded authorized ID meant to persist across power cycles — appropriate for a door. This trash bin's dynamic first-scan enrollment is simpler to demo and reset, but it isn't meant for anything needing real persistent security, since restarting the board resets which card is considered "authorized."
You can find the MFRC522 RFID reader, servo motors, and I2C LCD displays at Juthour Tech.
اترك تعليقا