Implementation of a Near Field Communication-Based Reverse Vending Machine for a Rice-Incentivized Recycling Program Using an MIT App Inventor Mobile Application.
CABI Machine was developed by two students of SMA Negeri 1 Semarang, Central Java, Indonesia, and presented under Fakultas Teknik Universitas Brawijaya for IYSA and the World Youth Invention and Innovation Award (Indonesia).


Low public participation in plastic-waste recycling is partly caused by limited direct incentives and inefficient collection systems. CABI is a Reverse Vending Machine (RVM) prototype that accepts PET bottles and awards points automatically. Points can be exchanged for rice through an integrated dispenser. The prototype uses an ESP8266, RC522 NFC reader, HC-SR04 ultrasonic sensor, OLED display, metal-gear servo, Firebase, and an MIT App Inventor application.
Keywords: Reverse Vending Machine, NFC, ESP8266, Internet of Things, Firebase, MIT App Inventor, recycling, rice incentive.
Plastic waste keeps growing with single-use packaging. PET beverage bottles pile up in landfills, pollute soil and water, and take very long to decompose. Collection programs exist, but participation stays low because people rarely receive a direct benefit, and manual record-keeping causes errors in counting waste and incentives.
A Reverse Vending Machine accepts used packaging and rewards the user, automating collection, counting, and incentives. Some RVMs still rely on coupons or records not linked to user identity and an online database. CABI addresses this: it reads user identity by NFC, detects bottles, calculates points, stores data in Firebase, and shows balances in a mobile app.
Each accepted bottle is one point (IDR 100). At 10 points (IDR 1,000) the user presses the exchange button and receives one preset portion of rice, a staple food that gives direct social and economic value.
Academic: example of NFC, IoT, and cloud in waste management. Practical: faster, more transparent recording. Environmental: more bottle collection. Social: rice as a direct benefit. Technological: integrated microcontroller, sensors, cloud, and app.
An electromechanical device that accepts used packaging and gives money, coupons, points, or goods. Parts: insertion slot, detection sensor, counting system, controller, storage, transaction record, and incentive unit. In CABI the incentive is points exchangeable for rice.
PET is widely used for beverage bottles and can be recycled when properly collected. The ultrasonic sensor only detects and counts bottles; it does not analyze material, so inserted objects are assumed to be PET.
Short-range wireless at 13.56 MHz. Each card has a UID that identifies the user. The RC522 reads it and the ESP8266 compares it with Firebase. Unregistered cards show “UID Not Registered”.
Wi-Fi microcontroller that reads the UID and sensor, counts bottles, calculates points and balance, drives the OLED and rice dispenser, and syncs with Firebase.
Measures distance from the time between emitted and reflected waves. A distance threshold and reading delay stop one bottle being counted twice.
Cloud database storing UID, user name, bottle count, points, rupiah balance, deposit and redemption histories, and transaction time.
Block-based app platform. The CABI app registers users, links names to UIDs, and displays bottle count, points, rupiah balance, transaction history, and redemption requirements.
Time and location: September–November 2025 and August–September 2026; design, assembly, and field tests in a residential environment in Semarang, Central Java. Application tested by 10 respondents using NFC cards with different UIDs.
Method: Research and Development with a prototyping approach.
Hardware (ESP8266, RC522, HC-SR04, OLED, servo, storage, rice dispenser) → Firebase database → MIT App Inventor app.
Data flow: NFC Card → RC522 → ESP8266 → Firebase → Mobile App.
Reward flow: Bottle → Sensor → Point Added → Exchange → Point Verification → Rice Dispensed.
| Period | Activity |
|---|---|
| Sep 2025 | Literature review, system design, hardware development |
| Oct 2025 | Mobile app, Firebase, integration, black-box testing |
| Nov 2025 | Field testing and data analysis |
| Aug 2026 | Add-on design and rice-redemption development |
| Sep 2026 | System testing, user evaluation, data analysis |
Standby, scan NFC card, RC522 reads UID, ESP8266 checks Firebase. Registered users see name, bottles, points, balance.
HC-SR04 detects, delay prevents double count, then +1 bottle, +1 point, +IDR 100 shown on OLED.
Exchange button checks 10 points. Fewer shows “Insufficient Bottles” with no deduction. Otherwise deduct, dispense, record.
After 10 seconds of inactivity the session ends and the ESP8266 uploads data to Firebase for the app.
System Usability Scale: 10 respondents completed the 10-item questionnaire after using the app. Black-box test: NFC scanning (registered and unregistered), bottle detection, point calculation, insufficient-point rejection, point deduction, dispenser activation, Firebase updates, and app display.
Figure 1. Complete CABI-RVM operational flowchart.
ESP8266 (processing and Wi-Fi), RC522 NFC module (authentication), HC-SR04 (bottle detection), 0.96-inch I2C OLED (status display), metal-gear servo (rice gate), PlatformIO/Arduino IDE/VS Code, MIT App Inventor, Firebase, NFC card ISO 14443 Type A/B, and standard PET bottles.
The firmware is state-based: wait for card, verify UID, display balance, count bottles, check exchange, validate points, dispense rice, update Firebase, reset. Points are deducted before the dispenser runs, so rice is never released without a recorded transaction.
| # | Test scenario | Actual result | Status |
|---|---|---|---|
| 1 | System powered on | OLED showed scan instruction | Passed |
| 2 | Registered NFC card | User data matched Firebase | Passed |
| 3 | Unregistered NFC card | Warning message appeared | Passed |
| 4–5 | One PET bottle inserted and accepted | Detected; +1 point and IDR 100 | Passed |
| 6 | Several bottles inserted | Ten bottles = 10 points / IDR 1,000 | Passed |
| 7 | Exchange with fewer than 10 points | Rejected, balance unchanged | Passed |
| 8–9 | Exchange with at least 10 points | Redemption started; balance reduced correctly | Passed |
| 10–11 | Dispenser activation and cycle end | Rice released in one cycle; gate closed | Passed |
| 12 | No activity for 10 seconds | Latest data stored in Firebase | Passed |
| 13 | App reads registered UID | Data matched Firebase | Passed |
| 14 | New user session | Next user's data loaded correctly | Passed |
All critical functions operated as designed: black-box success rate 100%.
Errors may occur when a bottle is inserted too fast, sits outside sensor range, or several objects pass at once. The sensor detects presence only; verifying PET would need extra sensors or Computer Vision.
Uploads after 10 seconds without activity, grouping bottles into one session: bottle count, points, balance, time history, redemptions, balance after redemption. The OLED still updates instantly.
10 respondents; rated Excellent, Acceptable, with very high user acceptance. The app was easy to understand and users felt confident.
NFC ties every transaction to the right user and is more efficient and less error-prone than manual records. The ESP8266 connects directly over Wi-Fi without extra modules. One bottle equals one point equals IDR 100, so the value is easy to grasp, and rice gives a tangible staple-food benefit that may raise motivation.